mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-04-21 21:52:04 +02:00
Merge 5092b0f2f9
into 68a344afcf
This commit is contained in:
commit
d1a1140c21
2 changed files with 35 additions and 5 deletions
|
@ -67,9 +67,9 @@ void vaoUnbind(VAO &vao);
|
|||
/* EXT_framebuffer_blit */
|
||||
int blitScaleIsSpecial(TEXFBO &target, bool targetPreferHires, const IntRect &targetRect, TEXFBO &source, const IntRect &sourceRect);
|
||||
int smoothScalingMethod(int scaleIsSpecial);
|
||||
void blitBegin(TEXFBO &target, bool preferHires = false, int scaleIsOne = 0);
|
||||
void blitBeginScreen(const Vec2i &size, int scaleIsOne = 0);
|
||||
void blitSource(TEXFBO &source, int scaleIsOne = 0);
|
||||
void blitBegin(TEXFBO &target, bool preferHires = false, int scaleIsSpecial = 0);
|
||||
void blitBeginScreen(const Vec2i &size, int scaleIsSpecial = 0);
|
||||
void blitSource(TEXFBO &source, int scaleIsSpecial = 0);
|
||||
void blitRectangle(const IntRect &src, const Vec2i &dstPos);
|
||||
void blitRectangle(const IntRect &src, const IntRect &dst,
|
||||
bool smooth = false);
|
||||
|
|
|
@ -274,7 +274,37 @@ void build(TEXFBO &tf, Bitmap *bitmaps[BM_COUNT])
|
|||
{
|
||||
assert(tf.width == ATLASVX_W && tf.height == ATLASVX_H);
|
||||
|
||||
GLMeta::blitBegin(tf, true);
|
||||
int scaleIsSpecial = SameScale;
|
||||
|
||||
if (shState->config().enableHires)
|
||||
{
|
||||
double bitmapScaleX = 0.0;
|
||||
double bitmapScaleY = 0.0;
|
||||
double atlasScale = shState->config().atlasScalingFactor;
|
||||
for (int i = 0; i < BM_COUNT; i++)
|
||||
{
|
||||
bitmapScaleX = 1.0;
|
||||
bitmapScaleY = 1.0;
|
||||
if (bitmaps[i]->hasHires())
|
||||
{
|
||||
bitmapScaleX = (double)(bitmaps[i]->getHires()->width()) / (double)(bitmaps[i]->width());
|
||||
bitmapScaleY = (double)(bitmaps[i]->getHires()->height()) / (double)(bitmaps[i]->height());
|
||||
}
|
||||
|
||||
if (atlasScale < bitmapScaleX || atlasScale < bitmapScaleY)
|
||||
{
|
||||
scaleIsSpecial = DownScale;
|
||||
}
|
||||
|
||||
if (atlasScale > bitmapScaleX || atlasScale > bitmapScaleY)
|
||||
{
|
||||
scaleIsSpecial = UpScale;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GLMeta::blitBegin(tf, true, scaleIsSpecial);
|
||||
|
||||
glState.clearColor.pushSet(Vec4());
|
||||
FBO::clear();
|
||||
|
@ -316,7 +346,7 @@ void build(TEXFBO &tf, Bitmap *bitmaps[BM_COUNT])
|
|||
#define EXEC_BLITS(part) \
|
||||
if (!nullOrDisposed(bm = bitmaps[BM_##part])) \
|
||||
{ \
|
||||
GLMeta::blitSource(bm->getGLTypes()); \
|
||||
GLMeta::blitSource(bm->getGLTypes(), scaleIsSpecial); \
|
||||
for (size_t i = 0; i < blits##part##N; ++i) \
|
||||
{\
|
||||
const IntRect &src = blits##part[i].src; \
|
||||
|
|
Loading…
Add table
Reference in a new issue