Continue checkpoint rendering

This commit is contained in:
Miloslav Ciz 2024-10-07 22:07:58 +02:00
parent 2c5162b635
commit ac5bddd9f4
5 changed files with 33 additions and 33 deletions

View file

@ -35,17 +35,10 @@
kinda hotfixes it -- later try to discover source of this bug. TODO */
#define _LCR_MAP_MODEL_SCALE 1034
#define LCR_RENDERER_MAT_CP0 0x0f
#define LCR_RENDERER_MAT_CP0 0x0f ///< material for untaken checkpoint
#define LCR_RENDERER_MAT_CP1 0x0e
#define LCR_RENDERER_MAT_FIN 0x0d
struct
{
S3L_Scene scene;
@ -170,16 +163,18 @@ void _LCR_pixelFunc3D(S3L_PixelInfo *pixel)
switch (mat)
{
#define CL (type ? 0x8210 : 0x0000)
case LCR_RENDERER_MAT_CP0:
LCR_renderer.flatAndTransparent = LCR_SETTING_CHECKPOINT0_COLOR;
LCR_renderer.flatAndTransparent = LCR_SETTING_CHECKPOINT_0_COLOR | CL;
break;
case LCR_RENDERER_MAT_CP1:
LCR_renderer.flatAndTransparent = LCR_SETTING_CHECKPOINT1_COLOR;
LCR_renderer.flatAndTransparent = LCR_SETTING_CHECKPOINT_1_COLOR | CL;
break;
case LCR_RENDERER_MAT_FIN:
LCR_renderer.flatAndTransparent = LCR_SETTING_FINISH_COLOR;
LCR_renderer.flatAndTransparent = LCR_SETTING_FINISH_COLOR | CL;
#undef CL
break;
default:
@ -234,7 +229,6 @@ void _LCR_pixelFunc3D(S3L_PixelInfo *pixel)
}
break;
}
}
}
@ -242,6 +236,12 @@ void _LCR_pixelFunc3D(S3L_PixelInfo *pixel)
{
if (pixel->x % 2 == pixel->y % 2)
LCR_drawPixelXYUnsafe(pixel->x,pixel->y,LCR_renderer.flatAndTransparent);
else
S3L_zBufferWrite(pixel->x,pixel->y,S3L_MAX_DEPTH);
/* ^ Clear z-buffer if we don't draw the pixel. Without this further
geometry drawn later on won't be seen through transparent objects which
looks bad. With this "fix" glitches may still appear (wrong draw order)
but it generally looks better this way. */
return;
}
@ -712,9 +712,9 @@ uint8_t _LCR_buildMapModel(void)
uint8_t triData;
if (blockType == LCR_BLOCK_CHECKPOINT_0)
triData = LCR_RENDERER_MAT_CP0;
triData = LCR_RENDERER_MAT_CP0 | ((i % 2) << 4);
else if (blockType == LCR_BLOCK_FINISH)
triData = LCR_RENDERER_MAT_FIN;
triData = LCR_RENDERER_MAT_FIN | ((i % 2) << 4);
else
{
uint8_t blockMat = LCR_mapBlockGetMaterial(block);