change STBVOX_MAKE_LIGHTING to STBVOX_MAKE_LIGHTING_EXT so header file

doesn't have to see the config variables (although this way is actually
more bug prone since you can now use the wrong macro)
This commit is contained in:
Sean Barrett
2015-04-11 01:05:55 -07:00
parent e2b645e4d7
commit 6685256560
3 changed files with 12 additions and 14 deletions

View File

@ -406,12 +406,12 @@ void convert_fastchunk_inplace(fast_chunk *fc)
bright = (lt[o]&15)*12 + 15 + (sky[o]&15)*16;
if (bright > 255) bright = 255;
if (bright < 32) bright = 32;
outb[o*2+0] = STBVOX_MAKE_LIGHTING((unsigned char) bright, (rot[o*2+0]&3));
outb[o*2+0] = STBVOX_MAKE_LIGHTING_EXT((unsigned char) bright, (rot[o*2+0]&3));
bright = (lt[o]>>4)*12 + 15 + (sky[o]>>4)*16;
if (bright > 255) bright = 255;
if (bright < 32) bright = 32;
outb[o*2+1] = STBVOX_MAKE_LIGHTING((unsigned char) bright, (rot[o*2+1]&3));
outb[o*2+1] = STBVOX_MAKE_LIGHTING_EXT((unsigned char) bright, (rot[o*2+1]&3));
}
} else {
// @TODO: if blocktype is in between others, this breaks; need to find which side has two pointers, and use that
@ -426,12 +426,12 @@ void convert_fastchunk_inplace(fast_chunk *fc)
bright = (lt[o]&15)*12 + 15 + (sky[o]&15)*16;
if (bright > 255) bright = 255;
if (bright < 32) bright = 32;
rot[o*2+0] = STBVOX_MAKE_LIGHTING((unsigned char) bright, (rot[o*2+0]&3));
rot[o*2+0] = STBVOX_MAKE_LIGHTING_EXT((unsigned char) bright, (rot[o*2+0]&3));
bright = (lt[o]>>4)*12 + 15 + (sky[o]>>4)*16;
if (bright > 255) bright = 255;
if (bright < 32) bright = 32;
rot[o*2+1] = STBVOX_MAKE_LIGHTING((unsigned char) bright, (rot[o*2+1]&3));
rot[o*2+1] = STBVOX_MAKE_LIGHTING_EXT((unsigned char) bright, (rot[o*2+1]&3));
}
memcpy(outb, rot, 4096);

View File

@ -3,7 +3,6 @@
#include "stb.h"
#define STBVOX_CONFIG_ROTATION_IN_LIGHTING
#include "stb_voxel_render.h"
typedef struct