예제 #1
0
	void onSrcRectChange()
	{
		if (mirrored)
			quad.setTexRect(srcRect->toFloatRect().hFlipped());
		else
			quad.setTexRect(srcRect->toFloatRect());

		quad.setPosRect(IntRect(0, 0, srcRect->width, srcRect->height));
		recomputeBushDepth();
	}
예제 #2
0
파일: sprite.cpp 프로젝트: BlackLotus/mkxp
	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
	}
예제 #3
0
파일: sprite.cpp 프로젝트: Ancurio/mkxp-abs
	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;
	}