diff --git a/demo1.cpp b/demo1.cpp index b0f1dfa..7b34631 100644 --- a/demo1.cpp +++ b/demo1.cpp @@ -13,7 +13,7 @@ //#define COMPUTE_WALL_TEXCOORDS 0 // ^ this turns off textures -#define SUBSAMPLE 1 +//#define SUBSAMPLE 1 #define RCL_COMPUTE_FLOOR_TEXCOORDS 1 @@ -1028,7 +1028,7 @@ int16_t intensity; else { color = pixel->isFloor ? - heightLevelColors[(pixel->height / RCL_UNITS_PER_SQUARE) & 0b00000011] : + (pixel->height == RCL_FLOOR_TEXCOORDS_HEIGHT ? sampleImage(texture1,pixel->texCoords.x / 2,pixel->texCoords.y / 2) : 8) : 18; color = addIntensity(color,intensity); @@ -1107,20 +1107,22 @@ int main() player.setPositionSquare(6,4); - sprites[0] = Sprite(spriteStatue,10,5,1,100); - sprites[1] = Sprite(spriteStatue,14,5,1,100); + #define addSpriteHeightFract(i,f) sprites[i].mHeight += RCL_UNITS_PER_SQUARE / f + + sprites[0] = Sprite(spriteStatue,10,5,1,100); addSpriteHeightFract(0,8); + sprites[1] = Sprite(spriteStatue,14,5,1,100); addSpriteHeightFract(1,8); sprites[2] = Sprite(spriteNPC,15,19,1,200); - sprites[3] = Sprite(spriteTree,8,2,1,300); + sprites[3] = Sprite(spriteTree,8,2,1,300); addSpriteHeightFract(3,4); sprites[3].mPosition.y -= RCL_UNITS_PER_SQUARE / 2; - sprites[4] = Sprite(spriteTree,20,5,1,300); - sprites[5] = Sprite(spriteTree,26,18,1,300); - sprites[6] = Sprite(spriteTree,16,12,1,300); - sprites[7] = Sprite(spriteGrass,27,16,0,100); - sprites[8] = Sprite(spriteGrass,6,6,0,150); - sprites[9] = Sprite(spriteGrass,8,5,0,120); - sprites[10] = Sprite(spriteGrass,17,6,0,150); - sprites[11] = Sprite(spriteBarrel,12,16,0,120); - sprites[12] = Sprite(spriteBarrel,27,5,0,120); + sprites[4] = Sprite(spriteTree,20,5,1,300); addSpriteHeightFract(4,4); + sprites[5] = Sprite(spriteTree,26,18,1,300); addSpriteHeightFract(5,2); + sprites[6] = Sprite(spriteTree,16,12,1,300); addSpriteHeightFract(6,4); + sprites[7] = Sprite(spriteGrass,27,16,0,100); addSpriteHeightFract(7,8); + sprites[8] = Sprite(spriteGrass,6,6,0,150); addSpriteHeightFract(8,8); + sprites[9] = Sprite(spriteGrass,8,5,0,120); addSpriteHeightFract(9,8); + sprites[10] = Sprite(spriteGrass,17,6,0,150); addSpriteHeightFract(10,8); + sprites[11] = Sprite(spriteBarrel,12,16,0,120); addSpriteHeightFract(11,4); + sprites[12] = Sprite(spriteBarrel,27,5,0,120); addSpriteHeightFract(12,4); sprites[13] = Sprite(spriteTorch1,11,9,2,120); sprites[13].mPosition.y += RCL_UNITS_PER_SQUARE / 3; sprites[14] = Sprite(spriteTorch1,13,9,2,120); @@ -1130,6 +1132,8 @@ int main() sprites[16] = Sprite(spriteTorch1,1,19,3,120); sprites[16].mPosition.y += RCL_UNITS_PER_SQUARE / 3; + #undef addSpriteHeightFract + uint32_t previousTime = 0; uint32_t dt;