void onSrcRectChange() { if (mirrored) quad.setTexRect(srcRect->toFloatRect().hFlipped()); else quad.setTexRect(srcRect->toFloatRect()); quad.setPosRect(IntRect(0, 0, srcRect->width, srcRect->height)); recomputeBushDepth(); }
void onSrcRectChange() { if (mirrored) quad.setTexRect(srcRect->toFloatRect().hFlipped()); else quad.setTexRect(srcRect->toFloatRect()); quad.setPosRect(IntRect(0, 0, srcRect->width, srcRect->height)); recomputeBushDepth(); #ifdef RGSS2 wave.dirty = true; #endif }
void onSrcRectChange() { FloatRect rect = srcRect->toFloatRect(); Vec2i bmSize; if (!nullOrDisposed(bitmap)) bmSize = Vec2i(bitmap->width(), bitmap->height()); /* Clamp the rectangle so it doesn't reach outside * the bitmap bounds */ rect.w = clamp<int>(rect.w, 0, bmSize.x-rect.x); rect.h = clamp<int>(rect.h, 0, bmSize.y-rect.y); quad.setTexRect(mirrored ? rect.hFlipped() : rect); quad.setPosRect(FloatRect(0, 0, rect.w, rect.h)); recomputeBushDepth(); wave.dirty = true; }