Fix a few things

This commit is contained in:
Miloslav Ciz 2025-02-01 14:10:22 +01:00
parent 1f0d3587f6
commit 19d3c1cbe5
5 changed files with 37 additions and 37 deletions

View file

@ -252,6 +252,9 @@ void LCR_rendererDrawText(const char *text, int x, int y, uint16_t color,
}
}
uint16_t _LCR_pixelColor = 0; /**< Holds pixel color for _LCR_pixelFunc3D. This
is needed is texture subsampling is on. */
/**
Used as a fragment shader by small3dlib. This function will be called for
every rasterized 3D pixel, we use it write actual pixels to the screen with
@ -436,8 +439,6 @@ void _LCR_pixelFunc3D(S3L_PixelInfo *pixel)
return;
}
uint16_t color;
#if LCR_SETTING_TEXTURE_SUBSAMPLE != 0
if (LCR_renderer.texSubsampleCount == 0)
{
@ -448,7 +449,7 @@ void _LCR_pixelFunc3D(S3L_PixelInfo *pixel)
barycentric[1] = pixel->barycentric[1] / 8;
barycentric[2] = pixel->barycentric[2] / 8;
color = LCR_sampleImage(
_LCR_pixelColor = LCR_sampleImage(
(barycentric[0] * LCR_renderer.triUVs[0] +
barycentric[1] * LCR_renderer.triUVs[2] +
barycentric[2] * LCR_renderer.triUVs[4])
@ -465,7 +466,7 @@ void _LCR_pixelFunc3D(S3L_PixelInfo *pixel)
LCR_renderer.texSubsampleCount--;
#endif
LCR_drawPixelXYUnsafe(pixel->x,pixel->y,color);
LCR_drawPixelXYUnsafe(pixel->x,pixel->y,_LCR_pixelColor);
#endif // LCR_SETTING_POTATO_GRAPHICS
}
@ -1803,9 +1804,10 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
#if LCR_SETTING_POTATO_GRAPHICS
);
#else
^ (effect & 0x1827));
^ (effect &
0x20c3));
effect += 3;
effect += 5 + i % 4;
#endif
++i;
@ -1884,7 +1886,8 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
stripHeight / LCR_IMAGE_SIZE,0xffff);
#endif
LCR_rendererDrawText(LCR_texts[LCR_TEXTS_VERSION],5,5,0xe71c,2);
LCR_rendererDrawText(LCR_texts[LCR_TEXTS_VERSION],
LCR_EFFECTIVE_RESOLUTION_X / 64,LCR_EFFECTIVE_RESOLUTION_Y / 64,0xe71c,2);
LCR_renderer.frame++;
}