Adjust block LODs a bit
This commit is contained in:
parent
fde803bb18
commit
31d820b4b9
2 changed files with 27 additions and 11 deletions
|
@ -12,6 +12,10 @@
|
|||
#define LCR_FREE_CAMERA_STEP \
|
||||
(LCR_SETTING_FREE_CAMERA_SPEED / LCR_SETTING_FPS)
|
||||
|
||||
#if LCR_FREE_CAMERA_STEP == 0
|
||||
#define LCR_FREE_CAMERA_STEP 1
|
||||
#endif
|
||||
|
||||
#define LCR_FREE_CAMERA_TURN_STEP \
|
||||
(LCR_SETTING_FREE_CAMERA_TURN_SPEED / LCR_SETTING_FPS)
|
||||
|
||||
|
|
34
renderer.h
34
renderer.h
|
@ -816,7 +816,7 @@ void LCR_rendererDrawRect(int x, int y, unsigned int w, unsigned int h,
|
|||
}
|
||||
|
||||
void _LCR_rendererDrawLODBlock(int blockX, int blockY, int blockZ, unsigned int size,
|
||||
uint16_t color)
|
||||
uint16_t color, uint8_t variability)
|
||||
{
|
||||
S3L_Vec4 p, r;
|
||||
|
||||
|
@ -836,10 +836,23 @@ void _LCR_rendererDrawLODBlock(int blockX, int blockY, int blockZ, unsigned int
|
|||
if (r.w > 0 && r.z > LCR_SETTING_LOD_DISTANCE * LCR_RENDERER_UNIT &&
|
||||
r.w < LCR_EFFECTIVE_RESOLUTION_X)
|
||||
{
|
||||
LCR_rendererDrawRect(r.x - r.w / 2,r.y - r.w / 2,(5 * r.w) / 8,
|
||||
(5 * r.w) / 8,color,1);
|
||||
LCR_rendererDrawRect(r.x - r.w / 4,r.y,
|
||||
(3 * r.w) / 4,r.w / 2,color,1);
|
||||
switch (variability % 4)
|
||||
{
|
||||
case 0: r.w += r.w / 4; r.x += LCR_BLOCK_SIZE / 8; break;
|
||||
case 1: r.w += r.w / 8; r.y -= LCR_BLOCK_SIZE / 16; break;
|
||||
case 2: r.w += r.w / 4; break;
|
||||
default: r.z += LCR_BLOCK_SIZE / 8; break;
|
||||
}
|
||||
|
||||
if (variability % 8 < 5)
|
||||
LCR_rendererDrawRect(r.x - r.w / 2,r.y - r.w / 2,r.w,r.w,color,1);
|
||||
else
|
||||
{
|
||||
r.w /= 2;
|
||||
LCR_rendererDrawRect(r.x - r.w / 2,r.y - r.w / 2,r.w,r.w,color,1);
|
||||
r.w += r.w / 2;
|
||||
LCR_rendererDrawRect(r.x - r.w / 8,r.y - r.w / 4,r.w,r.w,color,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1051,6 +1064,8 @@ void _LCR_rendererLoadMapChunks(void)
|
|||
void LCR_rendererDrawLOD(void)
|
||||
{
|
||||
#if LCR_SETTING_LOD_DISTANCE < 64
|
||||
int variability = 0;
|
||||
|
||||
for (unsigned int i = 0; i < LCR_RENDERER_LOD_BLOCKS; ++i)
|
||||
if (LCR_renderer.gridOfLODs[i])
|
||||
{
|
||||
|
@ -1060,18 +1075,15 @@ void LCR_rendererDrawLOD(void)
|
|||
bz = (i / 8) * 8 + 4;
|
||||
by = (i % 8) * 8 + 4;
|
||||
|
||||
int var = 0;
|
||||
|
||||
for (unsigned int j = 0; j < 8; ++j)
|
||||
{
|
||||
if (byte & 0x01)
|
||||
{
|
||||
var = var < 2 ? var + 1 : 0;
|
||||
variability = variability < 14 ? variability + 1 : 0;
|
||||
bx = j * 8 + 4;
|
||||
|
||||
_LCR_rendererDrawLODBlock(bx,by,bz,
|
||||
(LCR_EFFECTIVE_RESOLUTION_X * (2 + var)) / 2,
|
||||
LCR_SETTING_LOD_COLOR | (0x4108 >> var));
|
||||
_LCR_rendererDrawLODBlock(bx,by,bz,(4 * LCR_EFFECTIVE_RESOLUTION_Y)
|
||||
/ 3,LCR_SETTING_LOD_COLOR,variability);
|
||||
}
|
||||
|
||||
byte >>= 1;
|
||||
|
|
Loading…
Reference in a new issue