Skip to content

Commit bda7c9c

Browse files
committed
nice 3d shadows
1 parent dd7c09f commit bda7c9c

9 files changed

+47
-158
lines changed

data/gfx.tgz

23.5 KB
Binary file not shown.

src/gfx.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ void gfx_init(void)
177177
gfx_init3();
178178
gfx_init_32x32();
179179
gfx_init_48x48();
180+
gfx_init_64x64();
180181
gfx_init4();
181182
gfx_init5();
182183
gfx_init6();

src/gfx_32x32.cpp

-114
Original file line numberDiff line numberDiff line change
@@ -47,120 +47,6 @@ void gfx_init_32x32(void)
4747
"",
4848
"",
4949
// ##############################################################################
50-
"",
51-
"",
52-
"",
53-
"",
54-
"",
55-
"",
56-
"",
57-
"",
58-
"",
59-
"",
60-
"",
61-
"",
62-
"",
63-
"",
64-
"",
65-
"",
66-
"",
67-
"",
68-
// ##############################################################################
69-
"dungeon_wall.IS_JOIN_TL2",
70-
"dungeon_wall.IS_JOIN_T_3",
71-
"dungeon_wall.IS_JOIN_TR2",
72-
"",
73-
"dungeon_wall.IS_JOIN_TOP",
74-
"",
75-
"dungeon_wall.IS_JOIN_X4_180",
76-
"dungeon_wall.IS_JOIN_X4_270",
77-
"",
78-
"dungeon_wall.IS_JOIN_X2_270",
79-
"dungeon_wall.IS_JOIN_X2",
80-
"",
81-
"dungeon_wall.IS_JOIN_X1_180",
82-
"dungeon_wall.IS_JOIN_X1",
83-
"",
84-
"dungeon_wall.IS_JOIN_X",
85-
"",
86-
"",
87-
// ##############################################################################
88-
"dungeon_wall.IS_JOIN_T270_3",
89-
"dungeon_wall.IS_JOIN_BLOCK",
90-
"dungeon_wall.IS_JOIN_T90_3",
91-
"",
92-
"dungeon_wall.IS_JOIN_VERT",
93-
"",
94-
"dungeon_wall.IS_JOIN_X4_90",
95-
"dungeon_wall.IS_JOIN_X4",
96-
"",
97-
"dungeon_wall.IS_JOIN_X2_180",
98-
"dungeon_wall.IS_JOIN_X2_90",
99-
"",
100-
"dungeon_wall.IS_JOIN_X1_90",
101-
"dungeon_wall.IS_JOIN_X1_270",
102-
"",
103-
"dungeon_wall.IS_JOIN_X3_180",
104-
"dungeon_wall.IS_JOIN_X3",
105-
"",
106-
// ##############################################################################
107-
"dungeon_wall.IS_JOIN_BL2",
108-
"dungeon_wall.IS_JOIN_T180_3",
109-
"dungeon_wall.IS_JOIN_BR2",
110-
"",
111-
"dungeon_wall.IS_JOIN_BOT",
112-
"",
113-
"",
114-
"",
115-
"",
116-
"",
117-
"",
118-
"",
119-
"",
120-
"",
121-
"",
122-
"",
123-
"",
124-
"",
125-
// ##############################################################################
126-
"",
127-
"",
128-
"",
129-
"",
130-
"",
131-
"",
132-
"dungeon_wall.IS_JOIN_T_1",
133-
"dungeon_wall.IS_JOIN_T_2",
134-
"",
135-
"dungeon_wall.IS_JOIN_T270_2",
136-
"dungeon_wall.IS_JOIN_T90_1",
137-
"",
138-
"dungeon_wall.IS_JOIN_T",
139-
"dungeon_wall.IS_JOIN_T90",
140-
"",
141-
"dungeon_wall.IS_JOIN_TL",
142-
"dungeon_wall.IS_JOIN_TR",
143-
"",
144-
// ##############################################################################
145-
"dungeon_wall.IS_JOIN_LEFT",
146-
"dungeon_wall.IS_JOIN_HORIZ",
147-
"dungeon_wall.IS_JOIN_RIGHT",
148-
"",
149-
"dungeon_wall.IS_JOIN_NODE",
150-
"",
151-
"dungeon_wall.IS_JOIN_T180_2",
152-
"dungeon_wall.IS_JOIN_T180_1",
153-
"",
154-
"dungeon_wall.IS_JOIN_T270_1",
155-
"dungeon_wall.IS_JOIN_T90_2",
156-
"",
157-
"dungeon_wall.IS_JOIN_T270",
158-
"dungeon_wall.IS_JOIN_T180",
159-
"",
160-
"dungeon_wall.IS_JOIN_BL",
161-
"dungeon_wall.IS_JOIN_BR",
162-
"",
163-
// ##############################################################################
16450
};
16551
const std::vector< std::string > arr(tiles);
16652
tile_load_arr("data/gfx/tiles_32x32.tga", "tiles_32x32", 32, 32, arr);

src/level_display_dungeon.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void Level::display_dungeon(void)
183183
const bool no_deco = false;
184184

185185
for (auto y = miny; y < maxy; y++) {
186-
for (auto x = minx; x < maxx; x++) {
186+
for (auto x = maxx - 1; x >= minx; x--) {
187187
for (auto slot = 0; slot < MAP_SLOTS; slot++) {
188188
display_dungeon_z_layer(x, y, slot, MAP_DEPTH_FLOOR, no_deco);
189189
display_dungeon_z_layer(x, y, slot, MAP_DEPTH_WALL, no_deco);

src/level_dungeon.cpp

+30-30
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,35 @@ void Level::dungeon_create_and_place()
99
TRACE_NO_INDENT();
1010
map_set(data,
1111
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
12-
"x...x..........................x"
13-
"x...x..x.......................x"
14-
"x...x..x.......................x"
15-
"x...x..x.......................x"
16-
"x......x.......................x"
17-
"x......x.......................x"
18-
"xxxxxxxx.......................x"
19-
"x..............................x"
20-
"x..............................x"
21-
"x..............................x"
22-
"x..............................x"
23-
"x..............................x"
24-
"x..............................x"
25-
"x..............................x"
26-
"x..............................x"
27-
"x..............................x"
28-
"x..............................x"
29-
"x..............................x"
30-
"x..............................x"
31-
"x..............................x"
32-
"x..............................x"
33-
"x..............................x"
34-
"x..............................x"
35-
"x..............................x"
36-
"x..............................x"
37-
"x..............................x"
38-
"x..............................x"
39-
"x..............................x"
40-
"x..............................x"
41-
"x..............................x"
12+
"x...x...........x..............x"
13+
"x...x.xx..x.....x..xxxx..xxxx..x"
14+
"x...x..x...x....x..xxxx..xxxx..x"
15+
"x...x..xx...x...x..xxx....xxx..x"
16+
"x.....xx........x..............x"
17+
"x......x........x..xxx....xxx..x"
18+
"xxxxxxxx........x..xxxx..xxxx..x"
19+
"x...............x..xxxx..xxxx..x"
20+
"x..xxxxxxx......x..............x"
21+
"x..x.....x..xxxxx...x.......x..x"
22+
"x..x.xxx.x..x...x..x.x.....x...x"
23+
"x......x........x...x.....x....x"
24+
"xx...xxx........x........x.....x"
25+
"x..............x........x......x"
26+
"xxxx.xxxxxxxxxx..x.....x.......x"
27+
"x..x.x...........xx............x"
28+
"x..x.x............x.x......x...x"
29+
"x..x.x....xxx.......x..xxxxxxx.x"
30+
"x.........x.x.....xxx....x.....x"
31+
"x..xxx.x..xxx.....xx...........x"
32+
"x...x..x...........x...x....x..x"
33+
"x.........xxx...........x..x...x"
34+
"x...x..xx.xxx......x...x.......x"
35+
"x..xxx....xxx.xxxxxx....x...x..x"
36+
"x...x...x..........x...x...x...x"
37+
"x.......x..........x....x......x"
38+
"x.......x..........x...........x"
39+
"x.......x.........xxxxxxxxxxxxxx"
40+
"x.......x......................x"
41+
"x.......x......................x"
4242
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
4343
}

src/my_gfx.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ extern void gfx_init14();
2525
extern void gfx_init15();
2626
extern void gfx_init_32x32();
2727
extern void gfx_init_48x48();
28+
extern void gfx_init_64x64();
2829
extern void gfx_init(void);
2930
extern void gfx_fini(void);
3031

src/things/dungeon/tp_dungeon_floor.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ bool tp_load_dungeon_floor(void)
1616
tp->z_depth_set(MAP_DEPTH_FLOOR);
1717
tp->is_dungeon_floor = true;
1818
tp->is_blit_on_ground = true;
19+
tp->is_blit_centered = true;
1920
// end sort marker1 }
2021

2122
tp->tiles.push_back(tile_find_mand("dungeon_floor.1"));

src/things/dungeon/tp_dungeon_wall.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ bool tp_load_dungeon_wall(void)
1414
auto tp = tp_load("dungeon_wall");
1515
// begin sort marker1 {
1616
tp->z_depth_set(MAP_DEPTH_WALL);
17-
tp->is_dungeon_wall = true;
18-
tp->is_blit_on_ground = true;
19-
tp->is_blit_tiled = true;
17+
tp->is_dungeon_wall = true;
18+
tp->is_blit_tiled = true;
19+
tp->is_blit_centered = true;
2020
// end sort marker1 }
2121

2222
tp->tiles.push_back(tile_find_mand("dungeon_wall.IS_JOIN_TL2"));

src/tile.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void tile_load_arr(std::string file, std::string name, uint32_t width, uint32_t
244244

245245
if (y * height > tex_get_height(tex)) {
246246
if (name != "") {
247-
ERR("Overflow reading tile arr[%s]", name.c_str());
247+
DIE("Overflow reading tile arr[%s]", name.c_str());
248248
} else {
249249
ERR("Overflow reading tile arr at x %d y %d", x, y);
250250
}
@@ -284,7 +284,7 @@ void tile_load_arr(std::string file, std::string name, uint32_t width, uint32_t
284284
auto t = new Tile(); // std::make_shared< class Tile >();
285285
auto result = all_tiles.insert(std::make_pair(name, t));
286286
if (! result.second) {
287-
ERR("Tile insert name [%s] failed", name.c_str());
287+
DIE("Tile insert name [%s] failed", name.c_str());
288288
}
289289

290290
//
@@ -392,9 +392,9 @@ void tile_load_arr(std::string file, std::string name, uint32_t width, uint32_t
392392

393393
if (y * height > tex_get_height(tex)) {
394394
if (name != "") {
395-
ERR("Overflow reading tile arr[%s]", name.c_str());
395+
DIE("Overflow reading tile arr[%s]", name.c_str());
396396
} else {
397-
ERR("Overflow reading tile arr at x %d y %d", x, y);
397+
DIE("Overflow reading tile arr at x %d y %d", x, y);
398398
}
399399
}
400400
}
@@ -435,7 +435,7 @@ void tile_load_arr_sprites(std::string file, std::string name, uint32_t width, u
435435
auto t = new Tile(); // std::make_shared< class Tile >();
436436
auto result = all_tiles.insert(std::make_pair(name, t));
437437
if (! result.second) {
438-
ERR("Tile insert name [%s] failed", name.c_str());
438+
DIE("Tile insert name [%s] failed", name.c_str());
439439
}
440440

441441
//
@@ -549,9 +549,9 @@ void tile_load_arr_sprites(std::string file, std::string name, uint32_t width, u
549549

550550
if (y * height > tex_get_height(tex)) {
551551
if (name != "") {
552-
ERR("Overflow reading tile arr[%s]", name.c_str());
552+
DIE("Overflow reading tile arr[%s]", name.c_str());
553553
} else {
554-
ERR("Overflow reading tile arr at x %d y %d", x, y);
554+
DIE("Overflow reading tile arr at x %d y %d", x, y);
555555
}
556556
}
557557
}
@@ -588,7 +588,7 @@ void tile_load_arr_sprites(std::string file, std::string name, uint32_t width, u
588588
auto t = new Tile(); // std::make_shared< class Tile >();
589589
auto result = all_tiles.insert(std::make_pair(name, t));
590590
if (! result.second) {
591-
ERR("Tile insert name [%s] failed", name.c_str());
591+
DIE("Tile insert name [%s] failed", name.c_str());
592592
}
593593

594594
//
@@ -699,9 +699,9 @@ void tile_load_arr_sprites(std::string file, std::string name, uint32_t width, u
699699

700700
if (y * height > tex_get_height(tex)) {
701701
if (name != "") {
702-
ERR("Overflow reading tile arr[%s]", name.c_str());
702+
DIE("Overflow reading tile arr[%s]", name.c_str());
703703
} else {
704-
ERR("Overflow reading tile arr at x %d y %d", x, y);
704+
DIE("Overflow reading tile arr at x %d y %d", x, y);
705705
}
706706
}
707707
}

0 commit comments

Comments
 (0)