Skip to content

Commit

Permalink
wip mountains
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Jan 28, 2024
1 parent 5e42fb9 commit 5ab6be5
Show file tree
Hide file tree
Showing 10 changed files with 185 additions and 151 deletions.
Binary file modified data/gfx.tgz
Binary file not shown.
8 changes: 4 additions & 4 deletions src/core/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void tile_load_arr(std::string file, std::string name, uint32_t width, uint32_t

if (name != "") {
if (tile_find(name)) {
ERR("Tile name [%s] already used", name.c_str());
DIE("Tile name [%s] already used", name.c_str());
}

auto t = new Tile(); // std::make_shared< class Tile >();
Expand Down Expand Up @@ -278,7 +278,7 @@ void tile_load_arr(std::string file, std::string name, uint32_t width, uint32_t

if (name != "") {
if (tile_find(name)) {
ERR("Tile name [%s] already used", name.c_str());
DIE("Tile name [%s] already used", name.c_str());
}

auto t = new Tile(); // std::make_shared< class Tile >();
Expand Down Expand Up @@ -427,7 +427,7 @@ void tile_load_arr_sprites(std::string file, std::string name, uint32_t width, u

if (name != "") {
if (tile_find(name)) {
ERR("Tile name [%s] already used", name.c_str());
DIE("Tile name [%s] already used", name.c_str());
}

IF_DEBUG3 { LOG("Add tile name [%s]", name.c_str()); }
Expand Down Expand Up @@ -582,7 +582,7 @@ void tile_load_arr_sprites(std::string file, std::string name, uint32_t width, u
for (auto &name : arr) {
if (name != "") {
if (tile_find(name)) {
ERR("Tile name [%s] already used", name.c_str());
DIE("Tile name [%s] already used", name.c_str());
}

auto t = new Tile(); // std::make_shared< class Tile >();
Expand Down
3 changes: 1 addition & 2 deletions src/gfx/gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ void gfx_init(void)
gfx_init_font_ui();

// begin sort marker1 {
// end sort marker1 }
gfx_init0();
gfx_init1();
gfx_init10();
Expand All @@ -179,6 +178,7 @@ void gfx_init(void)
gfx_init_24x24();
gfx_init3();
gfx_init_32x32();
gfx_init_48x48();
gfx_init4();
gfx_init5();
gfx_init6();
Expand All @@ -188,7 +188,6 @@ void gfx_init(void)
gfx_init_ui();
gfx_init_world();
// end sort marker1 }
// end sort marker1 }
}

void gfx_fini(void) {}
24 changes: 24 additions & 0 deletions src/gfx/gfx_48x48.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// Copyright Neil McGill, [email protected]
//

#include "my_tile.hpp"
#include "my_ui.hpp"

void gfx_init_48x48(void)
{
std::initializer_list< std::string > tiles = {
// clang-format off
"world_mountains.0",
"world_forest.0",
"",
"",
"",
"",
"",
"",
// clang-format on
};
const std::vector< std::string > arr(tiles);
tile_load_arr("data/gfx/tiles_48x48.tga", "tiles_48x48", 48, 48, arr);
}
82 changes: 41 additions & 41 deletions src/gfx/gfx_world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,47 @@ void gfx_init_world(void)
std::initializer_list< std::string > tiles = {
// clang-format off
// ###############################################################################
"world_mountains.tl.0", "world_mountains.top.0", "world_mountains.tr.0",
"world_mountains.tl.1", "world_mountains.top.1", "world_mountains.tr.1",
"world_mountains.tl.2", "world_mountains.top.2", "world_mountains.tr.2",
"world_mountains.tl.3", "world_mountains.top.3", "world_mountains.tr.3",
"world_mountains.tl.4", "world_mountains.top.4", "world_mountains.tr.4",
"world_mountains.tl.5", "world_mountains.top.5", "world_mountains.tr.5",
// ###############################################################################
"world_mountains.left.0", "world_mountains.0", "world_mountains.right.0",
"world_mountains.left.1", "world_mountains.1", "world_mountains.right.1",
"world_mountains.left.2", "world_mountains.2", "world_mountains.right.2",
"world_mountains.left.3", "world_mountains.3", "world_mountains.right.3",
"world_mountains.left.4", "world_mountains.4", "world_mountains.right.4",
"world_mountains.left.5", "world_mountains.5", "world_mountains.right.5",
// ###############################################################################
"world_mountains.bl.0", "world_mountains.bot.0", "world_mountains.br.0",
"world_mountains.bl.1", "world_mountains.bot.1", "world_mountains.br.1",
"world_mountains.bl.2", "world_mountains.bot.2", "world_mountains.br.2",
"world_mountains.bl.3", "world_mountains.bot.3", "world_mountains.br.3",
"world_mountains.bl.4", "world_mountains.bot.4", "world_mountains.br.4",
"world_mountains.bl.5", "world_mountains.bot.5", "world_mountains.br.5",
// ###############################################################################
"world_forest.tl.0", "world_forest.top.0", "world_forest.tr.0",
"world_forest.tl.1", "world_forest.top.1", "world_forest.tr.1",
"world_forest.tl.2", "world_forest.top.2", "world_forest.tr.2",
"world_forest.tl.3", "world_forest.top.3", "world_forest.tr.3",
"world_forest.tl.4", "world_forest.top.4", "world_forest.tr.4",
"world_forest.tl.5", "world_forest.top.5", "world_forest.tr.5",
// ###############################################################################
"world_forest.left.0", "world_forest.0", "world_forest.right.0",
"world_forest.left.1", "world_forest.1", "world_forest.right.1",
"world_forest.left.2", "world_forest.2", "world_forest.right.2",
"world_forest.left.3", "world_forest.3", "world_forest.right.3",
"world_forest.left.4", "world_forest.4", "world_forest.right.4",
"world_forest.left.5", "world_forest.5", "world_forest.right.5",
// ###############################################################################
"world_forest.bl.0", "world_forest.bot.0", "world_forest.br.0",
"world_forest.bl.1", "world_forest.bot.1", "world_forest.br.1",
"world_forest.bl.2", "world_forest.bot.2", "world_forest.br.2",
"world_forest.bl.3", "world_forest.bot.3", "world_forest.br.3",
"world_forest.bl.4", "world_forest.bot.4", "world_forest.br.4",
"world_forest.bl.5", "world_forest.bot.5", "world_forest.br.5",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
// ###############################################################################
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
// ###############################################################################
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
// ###############################################################################
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
// ###############################################################################
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
// ###############################################################################
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
"", "", "",
// ###############################################################################
"world_grassland.tl.0", "world_grassland.top.0", "world_grassland.tr.0",
"world_grassland.tl.1", "world_grassland.top.1", "world_grassland.tr.1",
Expand Down
1 change: 1 addition & 0 deletions src/inc/my_gfx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extern void gfx_init_32x32();
extern void gfx_init_16x16();
extern void gfx_init_world();
extern void gfx_init_24x24();
extern void gfx_init_48x48();
extern void gfx_init(void);
extern void gfx_fini(void);

Expand Down
2 changes: 1 addition & 1 deletion src/inc/my_level.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Level
void display_world_tile(Tpp, Tilep, point tl, point br, point offset);
void display_world_tile(Tpp, uint16_t, point tl, point br, point offset);
void display_world(void);
void display_world_z_layer(int z, bool deco);
void display_world_z_layer(int x, int y, int slot, int z, bool deco);
void map_set(LevelDatap, const char *);
void player_create_and_place(void);
void player_map_center(void);
Expand Down
Loading

0 comments on commit 5ab6be5

Please sign in to comment.