Add SAF frontend

This commit is contained in:
Miloslav Ciz 2025-05-19 18:40:36 +02:00
parent bf2cd38337
commit c2bcf2d325
8 changed files with 131 additions and 40 deletions

View file

@ -34,6 +34,7 @@
#define S3L_Z_BUFFER 1
#define LCR_FONT_PIXEL_SIZE (1 + LCR_EFFECTIVE_RESOLUTION_X / 512)
#define LCR_ANIMATE_CAR (LCR_SETTING_CAR_ANIMATION_SUBDIVIDE != 0)
#define LCR_ANT_RESOLUTION (LCR_EFFECTIVE_RESOLUTION_Y <= 96)
#if LCR_SETTING_POTATO_GRAPHICS
#undef S3L_PERSPECTIVE_CORRECTION
@ -1951,8 +1952,14 @@ void LCR_rendererBlitImage(uint8_t index, unsigned int x, unsigned int y,
void LCR_rendererDrawMenu(const char *tabName,const char **items,
unsigned char itemCount,char selectedItem, char scroll)
{
#if !LCR_ANT_RESOLUTION
int stripHeight = (2 * LCR_EFFECTIVE_RESOLUTION_Y) / 7;
int stripHeight2 = LCR_EFFECTIVE_RESOLUTION_Y / 9;
#else
int stripHeight = 6;
int stripHeight2 = 0;
#endif
int i = 0;
#if !(LCR_SETTING_POTATO_GRAPHICS || LCR_SETTING_332_COLOR)
uint16_t effect = LCR_renderer.frame >> 1;
@ -1974,7 +1981,7 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
++i;
}
#if LCR_SETTING_POTATO_GRAPHICS
#if LCR_SETTING_POTATO_GRAPHICS || LCR_ANT_RESOLUTION
while (i < stripHeight * LCR_EFFECTIVE_RESOLUTION_X)
{
LCR_gameDrawPixel(i,LCR_CONVERT_COLOR(0x73ae));
@ -2041,23 +2048,30 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
(j == 0 || j == selectedItem + 1) ? LCR_CONVERT_COLOR(0xf79c) :
textColor,_FONT_SIZE);
#if LCR_ANT_RESOLUTION
i += LCR_rendererComputeTextHeight(_FONT_SIZE) + 3 * LCR_FONT_PIXEL_SIZE;
#else
if (j == 0)
i = stripHeight + stripHeight2;
i += LCR_rendererComputeTextHeight(_FONT_SIZE) + 6 * LCR_FONT_PIXEL_SIZE;
#endif
#undef _FONT_SIZE
}
#if !LCR_SETTING_POTATO_GRAPHICS
#if (!LCR_SETTING_POTATO_GRAPHICS) && (!LCR_ANT_RESOLUTION)
LCR_rendererBlitImage(21,(LCR_EFFECTIVE_RESOLUTION_X -
LCR_IMAGE_SIZE * (stripHeight / LCR_IMAGE_SIZE)) / 2,0,
stripHeight / LCR_IMAGE_SIZE,LCR_CONVERT_COLOR(0xffff));
#endif
#if !LCR_ANT_RESOLUTION
LCR_rendererDrawText(LCR_texts[LCR_TEXTS_VERSION],
LCR_EFFECTIVE_RESOLUTION_X / 64,LCR_EFFECTIVE_RESOLUTION_Y / 64,
LCR_CONVERT_COLOR(0xe71c),2);
#endif
LCR_renderer.frame++;
}