Skip to content

Commit

Permalink
add shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed May 4, 2024
1 parent 17ba9ac commit 136b30d
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 163 deletions.
Binary file modified data/gfx.tgz
Binary file not shown.
107 changes: 2 additions & 105 deletions src/gfx_12x12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,117 +11,14 @@ void gfx_init_12x12(void)
const char *tiles[] = {
/* clang-format off */
// ##############################################################################
"wall1.IS_JOIN_TL2",
"wall1.IS_JOIN_T_3",
"wall1.IS_JOIN_TR2",
"wall1.IS_JOIN_TOP",
"wall1.IS_JOIN_X4_180",
"wall1.IS_JOIN_X4_270",
"wall1.IS_JOIN_X2_270",
"wall1.IS_JOIN_X2",
"wall1.IS_JOIN_X1_180",
"wall1.IS_JOIN_X1",
"wall1.IS_JOIN_X",
"",
// ##############################################################################
"wall1.IS_JOIN_T270_3",
"wall1.IS_JOIN_BLOCK",
"wall1.IS_JOIN_T90_3",
"wall1.IS_JOIN_VERT",
"wall1.IS_JOIN_X4_90",
"wall1.IS_JOIN_X4",
"wall1.IS_JOIN_X2_180",
"wall1.IS_JOIN_X2_90",
"wall1.IS_JOIN_X1_90",
"wall1.IS_JOIN_X1_270",
"wall1.IS_JOIN_X3_180",
"wall1.IS_JOIN_X3",
// ##############################################################################
"wall1.IS_JOIN_BL2",
"wall1.IS_JOIN_T180_3",
"wall1.IS_JOIN_BR2",
"wall1.IS_JOIN_BOT",
"wall1.IS_JOIN_T_1",
"wall1.IS_JOIN_T_2",
"wall1.IS_JOIN_T270_2",
"wall1.IS_JOIN_T90_1",
"wall1.IS_JOIN_T",
"wall1.IS_JOIN_T90",
"wall1.IS_JOIN_TL",
"wall1.IS_JOIN_TR",
// ##############################################################################
"wall1.IS_JOIN_LEFT",
"wall1.IS_JOIN_HORIZ",
"wall1.IS_JOIN_RIGHT",
"wall1.IS_JOIN_NODE",
"wall1.IS_JOIN_T180_2",
"wall1.IS_JOIN_T180_1",
"wall1.IS_JOIN_T270_1",
"wall1.IS_JOIN_T90_2",
"wall1.IS_JOIN_T270",
"wall1.IS_JOIN_T180",
"wall1.IS_JOIN_BL",
"wall1.IS_JOIN_BR",
/* clang-format on */
// ##############################################################################
"door.IS_JOIN_TL2",
"door.IS_JOIN_T_3",
"door.IS_JOIN_TR2",
"door.IS_JOIN_TOP",
"door.IS_JOIN_X4_180",
"door.IS_JOIN_X4_270",
"door.IS_JOIN_X2_270",
"door.IS_JOIN_X2",
"door.IS_JOIN_X1_180",
"door.IS_JOIN_X1",
"door.IS_JOIN_X",
"",
// ##############################################################################
"door.IS_JOIN_T270_3",
"door.IS_JOIN_BLOCK",
"door.IS_JOIN_T90_3",
"door.IS_JOIN_VERT",
"door.IS_JOIN_X4_90",
"door.IS_JOIN_X4",
"door.IS_JOIN_X2_180",
"door.IS_JOIN_X2_90",
"door.IS_JOIN_X1_90",
"door.IS_JOIN_X1_270",
"door.IS_JOIN_X3_180",
"door.IS_JOIN_X3",
// ##############################################################################
"door.IS_JOIN_BL2",
"door.IS_JOIN_T180_3",
"door.IS_JOIN_BR2",
"door.IS_JOIN_BOT",
"door.IS_JOIN_T_1",
"door.IS_JOIN_T_2",
"door.IS_JOIN_T270_2",
"door.IS_JOIN_T90_1",
"door.IS_JOIN_T",
"door.IS_JOIN_T90",
"door.IS_JOIN_TL",
"door.IS_JOIN_TR",
// ##############################################################################
"door.IS_JOIN_LEFT",
"door.IS_JOIN_HORIZ",
"door.IS_JOIN_RIGHT",
"door.IS_JOIN_NODE",
"door.IS_JOIN_T180_2",
"door.IS_JOIN_T180_1",
"door.IS_JOIN_T270_1",
"door.IS_JOIN_T90_2",
"door.IS_JOIN_T270",
"door.IS_JOIN_T180",
"door.IS_JOIN_BL",
"door.IS_JOIN_BR",
// ##############################################################################
"floor.1",
"floor.2",
"floor.3",
"floor.4",
"floor.5",
"floor.6",
// ##############################################################################
/* clang-format on */
};
tile_load_arr("data/gfx/tiles_12x12.tga", "tiles_12x12", 12, 12, ARRAY_SIZE(tiles), tiles);
}
Expand Down
205 changes: 155 additions & 50 deletions src/gfx_24x24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,58 @@ void gfx_init_24x24(void)
const char *tiles[] = {
/* clang-format off */
// ##############################################################################
"wall1.IS_JOIN_TL2",
"wall1.IS_JOIN_T_3",
"wall1.IS_JOIN_TR2",
"wall1.IS_JOIN_TOP",
"wall1.IS_JOIN_X4_180",
"wall1.IS_JOIN_X4_270",
"wall1.IS_JOIN_X2_270",
"wall1.IS_JOIN_X2",
"wall1.IS_JOIN_X1_180",
"wall1.IS_JOIN_X1",
"wall1.IS_JOIN_X",
"",
// ##############################################################################
"wall1.IS_JOIN_T270_3",
"wall1.IS_JOIN_BLOCK",
"wall1.IS_JOIN_T90_3",
"wall1.IS_JOIN_VERT",
"wall1.IS_JOIN_X4_90",
"wall1.IS_JOIN_X4",
"wall1.IS_JOIN_X2_180",
"wall1.IS_JOIN_X2_90",
"wall1.IS_JOIN_X1_90",
"wall1.IS_JOIN_X1_270",
"wall1.IS_JOIN_X3_180",
"wall1.IS_JOIN_X3",
// ##############################################################################
"wall1.IS_JOIN_BL2",
"wall1.IS_JOIN_T180_3",
"wall1.IS_JOIN_BR2",
"wall1.IS_JOIN_BOT",
"wall1.IS_JOIN_T_1",
"wall1.IS_JOIN_T_2",
"wall1.IS_JOIN_T270_2",
"wall1.IS_JOIN_T90_1",
"wall1.IS_JOIN_T",
"wall1.IS_JOIN_T90",
"wall1.IS_JOIN_TL",
"wall1.IS_JOIN_TR",
// ##############################################################################
"wall1.IS_JOIN_LEFT",
"wall1.IS_JOIN_HORIZ",
"wall1.IS_JOIN_RIGHT",
"wall1.IS_JOIN_NODE",
"wall1.IS_JOIN_T180_2",
"wall1.IS_JOIN_T180_1",
"wall1.IS_JOIN_T270_1",
"wall1.IS_JOIN_T90_2",
"wall1.IS_JOIN_T270",
"wall1.IS_JOIN_T180",
"wall1.IS_JOIN_BL",
"wall1.IS_JOIN_BR",
// ##############################################################################
"wall1.IS_JOIN_TL2.shadow",
"wall1.IS_JOIN_T_3.shadow",
"wall1.IS_JOIN_TR2.shadow",
Expand Down Expand Up @@ -62,59 +114,112 @@ void gfx_init_24x24(void)
"wall1.IS_JOIN_T180.shadow",
"wall1.IS_JOIN_BL.shadow",
"wall1.IS_JOIN_BR.shadow",
/* clang-format on */
// ##############################################################################
"door.IS_JOIN_TL2.shadow",
"door.IS_JOIN_T_3.shadow",
"door.IS_JOIN_TR2.shadow",
"door.IS_JOIN_TOP.shadow",
"door.IS_JOIN_X4_180.shadow",
"door.IS_JOIN_X4_270.shadow",
"door.IS_JOIN_X2_270.shadow",
"door.IS_JOIN_X2.shadow",
"door.IS_JOIN_X1_180.shadow",
"door.IS_JOIN_X1.shadow",
"door.IS_JOIN_X.shadow",
"door.IS_JOIN_TL2",
"door.IS_JOIN_T_3",
"door.IS_JOIN_TR2",
"door.IS_JOIN_TOP",
"door.IS_JOIN_X4_180",
"door.IS_JOIN_X4_270",
"door.IS_JOIN_X2_270",
"door.IS_JOIN_X2",
"door.IS_JOIN_X1_180",
"door.IS_JOIN_X1",
"door.IS_JOIN_X",
"",
// ##############################################################################
"door.IS_JOIN_T270_3.shadow",
"door.IS_JOIN_BLOCK.shadow",
"door.IS_JOIN_T90_3.shadow",
"door.IS_JOIN_VERT.shadow",
"door.IS_JOIN_X4_90.shadow",
"door.IS_JOIN_X4.shadow",
"door.IS_JOIN_X2_180.shadow",
"door.IS_JOIN_X2_90.shadow",
"door.IS_JOIN_X1_90.shadow",
"door.IS_JOIN_X1_270.shadow",
"door.IS_JOIN_X3_180.shadow",
"door.IS_JOIN_X3.shadow",
// ##############################################################################
"door.IS_JOIN_BL2.shadow",
"door.IS_JOIN_T180_3.shadow",
"door.IS_JOIN_BR2.shadow",
"door.IS_JOIN_BOT.shadow",
"door.IS_JOIN_T_1.shadow",
"door.IS_JOIN_T_2.shadow",
"door.IS_JOIN_T270_2.shadow",
"door.IS_JOIN_T90_1.shadow",
"door.IS_JOIN_T.shadow",
"door.IS_JOIN_T90.shadow",
"door.IS_JOIN_TL.shadow",
"door.IS_JOIN_TR.shadow",
// ##############################################################################
"door.IS_JOIN_LEFT.shadow",
"door.IS_JOIN_HORIZ.shadow",
"door.IS_JOIN_RIGHT.shadow",
"door.IS_JOIN_NODE.shadow",
"door.IS_JOIN_T180_2.shadow",
"door.IS_JOIN_T180_1.shadow",
"door.IS_JOIN_T270_1.shadow",
"door.IS_JOIN_T90_2.shadow",
"door.IS_JOIN_T270.shadow",
"door.IS_JOIN_T180.shadow",
"door.IS_JOIN_BL.shadow",
"door.IS_JOIN_BR.shadow",
"door.IS_JOIN_T270_3",
"door.IS_JOIN_BLOCK",
"door.IS_JOIN_T90_3",
"door.IS_JOIN_VERT",
"door.IS_JOIN_X4_90",
"door.IS_JOIN_X4",
"door.IS_JOIN_X2_180",
"door.IS_JOIN_X2_90",
"door.IS_JOIN_X1_90",
"door.IS_JOIN_X1_270",
"door.IS_JOIN_X3_180",
"door.IS_JOIN_X3",
// ##############################################################################
"door.IS_JOIN_BL2",
"door.IS_JOIN_T180_3",
"door.IS_JOIN_BR2",
"door.IS_JOIN_BOT",
"door.IS_JOIN_T_1",
"door.IS_JOIN_T_2",
"door.IS_JOIN_T270_2",
"door.IS_JOIN_T90_1",
"door.IS_JOIN_T",
"door.IS_JOIN_T90",
"door.IS_JOIN_TL",
"door.IS_JOIN_TR",
// ##############################################################################
"door.IS_JOIN_LEFT",
"door.IS_JOIN_HORIZ",
"door.IS_JOIN_RIGHT",
"door.IS_JOIN_NODE",
"door.IS_JOIN_T180_2",
"door.IS_JOIN_T180_1",
"door.IS_JOIN_T270_1",
"door.IS_JOIN_T90_2",
"door.IS_JOIN_T270",
"door.IS_JOIN_T180",
"door.IS_JOIN_BL",
"door.IS_JOIN_BR",
// ##############################################################################
"door1.IS_JOIN_TL2.shadow",
"door1.IS_JOIN_T_3.shadow",
"door1.IS_JOIN_TR2.shadow",
"door1.IS_JOIN_TOP.shadow",
"door1.IS_JOIN_X4_180.shadow",
"door1.IS_JOIN_X4_270.shadow",
"door1.IS_JOIN_X2_270.shadow",
"door1.IS_JOIN_X2.shadow",
"door1.IS_JOIN_X1_180.shadow",
"door1.IS_JOIN_X1.shadow",
"door1.IS_JOIN_X.shadow",
"",
// ##############################################################################
"door1.IS_JOIN_T270_3.shadow",
"door1.IS_JOIN_BLOCK.shadow",
"door1.IS_JOIN_T90_3.shadow",
"door1.IS_JOIN_VERT.shadow",
"door1.IS_JOIN_X4_90.shadow",
"door1.IS_JOIN_X4.shadow",
"door1.IS_JOIN_X2_180.shadow",
"door1.IS_JOIN_X2_90.shadow",
"door1.IS_JOIN_X1_90.shadow",
"door1.IS_JOIN_X1_270.shadow",
"door1.IS_JOIN_X3_180.shadow",
"door1.IS_JOIN_X3.shadow",
// ##############################################################################
"door1.IS_JOIN_BL2.shadow",
"door1.IS_JOIN_T180_3.shadow",
"door1.IS_JOIN_BR2.shadow",
"door1.IS_JOIN_BOT.shadow",
"door1.IS_JOIN_T_1.shadow",
"door1.IS_JOIN_T_2.shadow",
"door1.IS_JOIN_T270_2.shadow",
"door1.IS_JOIN_T90_1.shadow",
"door1.IS_JOIN_T.shadow",
"door1.IS_JOIN_T90.shadow",
"door1.IS_JOIN_TL.shadow",
"door1.IS_JOIN_TR.shadow",
// ##############################################################################
"door1.IS_JOIN_LEFT.shadow",
"door1.IS_JOIN_HORIZ.shadow",
"door1.IS_JOIN_RIGHT.shadow",
"door1.IS_JOIN_NODE.shadow",
"door1.IS_JOIN_T180_2.shadow",
"door1.IS_JOIN_T180_1.shadow",
"door1.IS_JOIN_T270_1.shadow",
"door1.IS_JOIN_T90_2.shadow",
"door1.IS_JOIN_T270.shadow",
"door1.IS_JOIN_T180.shadow",
"door1.IS_JOIN_BL.shadow",
"door1.IS_JOIN_BR.shadow",
// ##############################################################################
/* clang-format on */
};
tile_load_arr("data/gfx/tiles_24x24.tga", "tiles_24x24", 24, 24, ARRAY_SIZE(tiles), tiles);
}
Expand Down
14 changes: 6 additions & 8 deletions src/level_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static void level_display_z_layer(Levelp l, int x, int y, int slot, int z, bool
br.y = tl.y + pix_height;

if (deco) {
level_display_tile(l, tp, tile_index, tl, br, point(0, 0));
level_display_tile(l, tp, tile_index + 47, tl, br, point(0, 0));
} else {
level_display_tile(l, tp, tile_index, tl, br, point(0, 0));
}
Expand Down Expand Up @@ -144,13 +144,11 @@ void level_display(Levelp l)
//
// Shadows
//
if (0) {
for (auto y = l->miny; y < l->maxy; y++) {
for (auto x = l->maxx - 1; x >= l->minx; x--) {
for (auto slot = 0; slot < MAP_SLOTS; slot++) {
level_display_z_layer(l, x, y, slot, MAP_DEPTH_WALL, deco);
level_display_z_layer(l, x, y, slot, MAP_DEPTH_DOOR, deco);
}
for (auto y = l->miny; y < l->maxy; y++) {
for (auto x = l->maxx - 1; x >= l->minx; x--) {
for (auto slot = 0; slot < MAP_SLOTS; slot++) {
level_display_z_layer(l, x, y, slot, MAP_DEPTH_WALL, deco);
level_display_z_layer(l, x, y, slot, MAP_DEPTH_DOOR, deco);
}
}
}
Expand Down

0 comments on commit 136b30d

Please sign in to comment.