mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-07-02 06:35:18 +02:00
Revert adding Bitmap#v_flip/h_flip
This commit is contained in:
parent
689911510a
commit
4e6e291624
3 changed files with 0 additions and 76 deletions
|
@ -225,26 +225,6 @@ RB_METHOD(bitmapSetPixel) {
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
RB_METHOD(bitmapHFlip) {
|
|
||||||
RB_UNUSED_PARAM;
|
|
||||||
|
|
||||||
Bitmap *b = getPrivateData<Bitmap>(self);
|
|
||||||
|
|
||||||
b->hFlip();
|
|
||||||
|
|
||||||
return Qnil;
|
|
||||||
}
|
|
||||||
|
|
||||||
RB_METHOD(bitmapVFlip) {
|
|
||||||
RB_UNUSED_PARAM;
|
|
||||||
|
|
||||||
Bitmap *b = getPrivateData<Bitmap>(self);
|
|
||||||
|
|
||||||
b->vFlip();
|
|
||||||
|
|
||||||
return Qnil;
|
|
||||||
}
|
|
||||||
|
|
||||||
RB_METHOD(bitmapHueChange) {
|
RB_METHOD(bitmapHueChange) {
|
||||||
Bitmap *b = getPrivateData<Bitmap>(self);
|
Bitmap *b = getPrivateData<Bitmap>(self);
|
||||||
|
|
||||||
|
@ -760,8 +740,6 @@ void bitmapBindingInit() {
|
||||||
_rb_define_method(klass, "clear", bitmapClear);
|
_rb_define_method(klass, "clear", bitmapClear);
|
||||||
_rb_define_method(klass, "get_pixel", bitmapGetPixel);
|
_rb_define_method(klass, "get_pixel", bitmapGetPixel);
|
||||||
_rb_define_method(klass, "set_pixel", bitmapSetPixel);
|
_rb_define_method(klass, "set_pixel", bitmapSetPixel);
|
||||||
_rb_define_method(klass, "h_flip", bitmapHFlip);
|
|
||||||
_rb_define_method(klass, "v_flip", bitmapVFlip);
|
|
||||||
_rb_define_method(klass, "hue_change", bitmapHueChange);
|
_rb_define_method(klass, "hue_change", bitmapHueChange);
|
||||||
_rb_define_method(klass, "draw_text", bitmapDrawText);
|
_rb_define_method(klass, "draw_text", bitmapDrawText);
|
||||||
_rb_define_method(klass, "text_size", bitmapTextSize);
|
_rb_define_method(klass, "text_size", bitmapTextSize);
|
||||||
|
|
|
@ -398,41 +398,6 @@ struct BitmapPrivate
|
||||||
|
|
||||||
self->modified();
|
self->modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void flip(const IntRect &srcRect)
|
|
||||||
{
|
|
||||||
TEXFBO ¤t = getGLTypes();
|
|
||||||
TEXFBO newTex = shState->texPool().request(current.width, current.height);
|
|
||||||
|
|
||||||
SimpleShader &shader = shState->shaders().simple;
|
|
||||||
shader.bind();
|
|
||||||
shader.setTexOffsetX(0);
|
|
||||||
bindTexture(shader);
|
|
||||||
|
|
||||||
Quad &quad = shState->gpQuad();
|
|
||||||
quad.setTexPosRect(srcRect, IntRect(0, 0, current.width, current.height));
|
|
||||||
quad.setColor(Vec4(1, 1, 1, 1));
|
|
||||||
|
|
||||||
glState.blend.pushSet(false);
|
|
||||||
pushSetViewport(shader);
|
|
||||||
|
|
||||||
FBO::bind(newTex.fbo);
|
|
||||||
blitQuad(quad);
|
|
||||||
|
|
||||||
popViewport();
|
|
||||||
glState.blend.pop();
|
|
||||||
|
|
||||||
if (!animation.enabled) {
|
|
||||||
shState->texPool().release(gl);
|
|
||||||
gl = newTex;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
shState->texPool().release(animation.frames[animation.currentFrameI()]);
|
|
||||||
animation.frames[animation.currentFrameI()] = newTex;
|
|
||||||
}
|
|
||||||
|
|
||||||
onModified();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct BitmapOpenHandler : FileSystem::OpenHandler
|
struct BitmapOpenHandler : FileSystem::OpenHandler
|
||||||
|
@ -1313,22 +1278,6 @@ void Bitmap::setPixel(int x, int y, const Color &color)
|
||||||
p->onModified(false);
|
p->onModified(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bitmap::vFlip() {
|
|
||||||
guardDisposed();
|
|
||||||
GUARD_MEGA;
|
|
||||||
|
|
||||||
TEXFBO ¤t = getGLTypes();
|
|
||||||
p->flip(IntRect(0, current.height, current.width, -current.height));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bitmap::hFlip() {
|
|
||||||
guardDisposed();
|
|
||||||
GUARD_MEGA;
|
|
||||||
|
|
||||||
TEXFBO ¤t = getGLTypes();
|
|
||||||
p->flip(IntRect(current.width, 0, -current.width, current.height));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Bitmap::getRaw(void *output, int output_size)
|
bool Bitmap::getRaw(void *output, int output_size)
|
||||||
{
|
{
|
||||||
if (output_size != width()*height()*4) return false;
|
if (output_size != width()*height()*4) return false;
|
||||||
|
|
|
@ -87,9 +87,6 @@ public:
|
||||||
Color getPixel(int x, int y) const;
|
Color getPixel(int x, int y) const;
|
||||||
void setPixel(int x, int y, const Color &color);
|
void setPixel(int x, int y, const Color &color);
|
||||||
|
|
||||||
void vFlip();
|
|
||||||
void hFlip();
|
|
||||||
|
|
||||||
bool getRaw(void *output, int output_size);
|
bool getRaw(void *output, int output_size);
|
||||||
void replaceRaw(void *pixel_data, int size);
|
void replaceRaw(void *pixel_data, int size);
|
||||||
void saveToFile(const char *filename);
|
void saveToFile(const char *filename);
|
||||||
|
|
Loading…
Add table
Reference in a new issue