Add 332 color
This commit is contained in:
parent
76cc3227bb
commit
b4aa9cd867
9 changed files with 128 additions and 29 deletions
46
renderer.h
46
renderer.h
|
@ -328,6 +328,11 @@ void _LCR_pixelFunc3D(S3L_PixelInfo *pixel)
|
|||
|
||||
// alter each triangle's color slightly:
|
||||
LCR_renderer.flatAndTransparent += pixel->triangleIndex % 4;
|
||||
|
||||
#if LCR_SETTING_332_COLOR
|
||||
LCR_renderer.flatAndTransparent =
|
||||
LCR_CONVERT_COLOR(LCR_renderer.flatAndTransparent);
|
||||
#endif
|
||||
}
|
||||
|
||||
LCR_gameDrawPixelXYUnsafe(pixel->x,pixel->y,LCR_renderer.flatAndTransparent);
|
||||
|
@ -359,6 +364,7 @@ void _LCR_pixelFunc3D(S3L_PixelInfo *pixel)
|
|||
|
||||
#if (LCR_SETTING_CAR_TINT & 0x7) != 0x07
|
||||
for (int i = 0; i < 256; ++i)
|
||||
{
|
||||
LCR_currentImage.palette[i] &=
|
||||
#if LCR_SETTING_CAR_TINT & 0x01
|
||||
0x001f |
|
||||
|
@ -375,7 +381,12 @@ void _LCR_pixelFunc3D(S3L_PixelInfo *pixel)
|
|||
#else
|
||||
0x1800
|
||||
#endif
|
||||
;
|
||||
;
|
||||
#if LCR_SETTING_332_COLOR
|
||||
LCR_currentImage.palette[i] =
|
||||
LCR_CONVERT_COLOR(LCR_currentImage.palette[i]);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
@ -399,14 +410,20 @@ void _LCR_pixelFunc3D(S3L_PixelInfo *pixel)
|
|||
#define CL (type ? 0x8210 : 0x0000)
|
||||
case LCR_RENDERER_MAT_CP0:
|
||||
LCR_renderer.flatAndTransparent = LCR_SETTING_CHECKPOINT_0_COLOR | CL;
|
||||
LCR_renderer.flatAndTransparent =
|
||||
LCR_CONVERT_COLOR(LCR_renderer.flatAndTransparent);
|
||||
break;
|
||||
|
||||
case LCR_RENDERER_MAT_CP1:
|
||||
LCR_renderer.flatAndTransparent = LCR_SETTING_CHECKPOINT_1_COLOR | CL;
|
||||
LCR_renderer.flatAndTransparent =
|
||||
LCR_CONVERT_COLOR(LCR_renderer.flatAndTransparent);
|
||||
break;
|
||||
|
||||
case LCR_RENDERER_MAT_FIN:
|
||||
LCR_renderer.flatAndTransparent = LCR_SETTING_FINISH_COLOR | CL;
|
||||
LCR_renderer.flatAndTransparent =
|
||||
LCR_CONVERT_COLOR(LCR_renderer.flatAndTransparent);
|
||||
break;
|
||||
#undef CL
|
||||
|
||||
|
@ -1410,7 +1427,7 @@ void LCR_rendererDrawSky(int sky, S3L_Unit offsetH, S3L_Unit offsetV)
|
|||
|
||||
#if LCR_SETTING_POTATO_GRAPHICS
|
||||
LCR_rendererDrawRect(0,0,LCR_EFFECTIVE_RESOLUTION_X,
|
||||
LCR_EFFECTIVE_RESOLUTION_Y,0x7bfd,0);
|
||||
LCR_EFFECTIVE_RESOLUTION_Y,LCR_CONVERT_COLOR(0xffff),0);
|
||||
#else
|
||||
int anchorPoint[2], y;
|
||||
unsigned long pixelIndex;
|
||||
|
@ -1870,8 +1887,8 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
|
|||
|
||||
while (i < stripHeight * LCR_EFFECTIVE_RESOLUTION_X)
|
||||
{
|
||||
LCR_gameDrawPixel(i,0x4a8c
|
||||
#if LCR_SETTING_POTATO_GRAPHICS
|
||||
LCR_gameDrawPixel(i,LCR_CONVERT_COLOR(0x4a8c)
|
||||
#if LCR_SETTING_POTATO_GRAPHICS || LCR_SETTING_332_COLOR
|
||||
);
|
||||
#else
|
||||
^ (effect & 0x41c3));
|
||||
|
@ -1885,7 +1902,7 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
|
|||
#if LCR_SETTING_POTATO_GRAPHICS
|
||||
while (i < stripHeight * LCR_EFFECTIVE_RESOLUTION_X)
|
||||
{
|
||||
LCR_gameDrawPixel(i,0x73ae);
|
||||
LCR_gameDrawPixel(i,LCR_CONVERT_COLOR(0x73ae));
|
||||
++i;
|
||||
}
|
||||
#else
|
||||
|
@ -1898,7 +1915,8 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
|
|||
{
|
||||
LCR_gameDrawPixel(i,(x > LCR_EFFECTIVE_RESOLUTION_X / 4 - limit &&
|
||||
(x < LCR_EFFECTIVE_RESOLUTION_X - LCR_EFFECTIVE_RESOLUTION_X / 4 + limit)
|
||||
? 0x73ae : 0x31a6) + ((x + y) % 8));
|
||||
? LCR_CONVERT_COLOR(0x73ae) : LCR_CONVERT_COLOR(0x31a6)) +
|
||||
((x + y) % 8));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
@ -1906,11 +1924,11 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
|
|||
|
||||
while (i < LCR_EFFECTIVE_RESOLUTION_Y * LCR_EFFECTIVE_RESOLUTION_X)
|
||||
{
|
||||
LCR_gameDrawPixel(i,0xce9c
|
||||
LCR_gameDrawPixel(i,LCR_CONVERT_COLOR(0xce9c)
|
||||
#if LCR_SETTING_POTATO_GRAPHICS
|
||||
);
|
||||
#else
|
||||
+ (i & 0x1002));
|
||||
+ (i & LCR_CONVERT_COLOR(0x1002)));
|
||||
#endif
|
||||
|
||||
++i;
|
||||
|
@ -1922,12 +1940,12 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
|
|||
{
|
||||
const char *s = j ? (j <= itemCount ? items[j - 1] : "...") : tabName;
|
||||
const char *s2 = s;
|
||||
uint16_t textColor = 0x5aeb;
|
||||
uint16_t textColor = LCR_CONVERT_COLOR(0x5aeb);
|
||||
|
||||
while (*s2) // if the item contains '#' (check), we draw it as green
|
||||
{
|
||||
if (*s2 == '#')
|
||||
textColor = 0x0700;
|
||||
textColor = LCR_CONVERT_COLOR(0x0700);
|
||||
|
||||
s2++;
|
||||
}
|
||||
|
@ -1944,7 +1962,8 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
|
|||
|
||||
LCR_rendererDrawText(s,(LCR_EFFECTIVE_RESOLUTION_X -
|
||||
LCR_rendererComputeTextWidth(s,_FONT_SIZE)) / 2,i,
|
||||
(j == 0 || j == selectedItem + 1) ? 0xf79c : textColor,_FONT_SIZE);
|
||||
(j == 0 || j == selectedItem + 1) ? LCR_CONVERT_COLOR(0xf79c) :
|
||||
textColor,_FONT_SIZE);
|
||||
|
||||
if (j == 0)
|
||||
i = stripHeight + stripHeight2;
|
||||
|
@ -1958,11 +1977,12 @@ void LCR_rendererDrawMenu(const char *tabName,const char **items,
|
|||
#if !LCR_SETTING_POTATO_GRAPHICS
|
||||
LCR_rendererBlitImage(21,(LCR_EFFECTIVE_RESOLUTION_X -
|
||||
LCR_IMAGE_SIZE * (stripHeight / LCR_IMAGE_SIZE)) / 2,0,
|
||||
stripHeight / LCR_IMAGE_SIZE,0xffff);
|
||||
stripHeight / LCR_IMAGE_SIZE,LCR_CONVERT_COLOR(0xffff));
|
||||
#endif
|
||||
|
||||
LCR_rendererDrawText(LCR_texts[LCR_TEXTS_VERSION],
|
||||
LCR_EFFECTIVE_RESOLUTION_X / 64,LCR_EFFECTIVE_RESOLUTION_Y / 64,0xe71c,2);
|
||||
LCR_EFFECTIVE_RESOLUTION_X / 64,LCR_EFFECTIVE_RESOLUTION_Y / 64,
|
||||
LCR_CONVERT_COLOR(0xe71c),2);
|
||||
|
||||
LCR_renderer.frame++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue