diff options
| author | untodesu <kirill@untode.su> | 2025-07-01 03:08:39 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-07-01 03:08:39 +0500 |
| commit | 458e0005690ea9d579588a0a12368fc2c2c9a93a (patch) | |
| tree | 588a9ca6cb3c76d9193b5bd4601d64f0e50e8c8c /game/shared/game_items.cc | |
| parent | c7b0c8e0286a1b2bb7ec55e579137dfc3b22eeb9 (diff) | |
| download | voxelius-458e0005690ea9d579588a0a12368fc2c2c9a93a.tar.bz2 voxelius-458e0005690ea9d579588a0a12368fc2c2c9a93a.zip | |
I hyper-focued on refactoring again
- I put a cool-sounding "we are number one" remix on repeat and straight
up grinded the entire repository to a better state until 03:09 AM. I
guess I have something wrong in my brain that makes me do this shit
Diffstat (limited to 'game/shared/game_items.cc')
| -rw-r--r-- | game/shared/game_items.cc | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/game/shared/game_items.cc b/game/shared/game_items.cc new file mode 100644 index 0000000..58f379f --- /dev/null +++ b/game/shared/game_items.cc @@ -0,0 +1,69 @@ +#include "shared/pch.hh" + +#include "shared/game_items.hh" + +#include "shared/world/item_registry.hh" + +#include "shared/game_voxels.hh" + +item_id game_items::stone = NULL_ITEM_ID; +item_id game_items::cobblestone = NULL_ITEM_ID; +item_id game_items::dirt = NULL_ITEM_ID; +item_id game_items::grass = NULL_ITEM_ID; +item_id game_items::oak_leaves = NULL_ITEM_ID; +item_id game_items::oak_planks = NULL_ITEM_ID; +item_id game_items::oak_log = NULL_ITEM_ID; +item_id game_items::glass = NULL_ITEM_ID; +item_id game_items::slime = NULL_ITEM_ID; +item_id game_items::mud = NULL_ITEM_ID; + +void game_items::populate(void) +{ + // Stone; a hardened slate rock + game_items::stone = + world::item_registry::construct("stone").set_texture("textures/item/stone.png").set_place_voxel(game_voxels::stone).build(); + + // Cobblestone; a bunch of small stones + game_items::cobblestone = + world::item_registry::construct("cobblestone") + .set_texture("textures/item/cobblestone.png") + .set_place_voxel(game_voxels::cobblestone) + .build(); + + // Dirt; it's very dirty + game_items::dirt = + world::item_registry::construct("dirt").set_texture("textures/item/dirt.png").set_place_voxel(game_voxels::dirt).build(); + + // Grass; literally just grassy dirt + game_items::grass = + world::item_registry::construct("grass").set_texture("textures/item/grass.png").set_place_voxel(game_voxels::grass).build(); + + // Oak leaves; they're bushy! + game_items::oak_leaves = + world::item_registry::construct("oak_leaves") + .set_texture("textures/item/oak_leaves.png") + .set_place_voxel(game_voxels::oak_leaves) + .build(); + + // Oak planks; watch for splinters! + game_items::oak_planks = + world::item_registry::construct("oak_planks") + .set_texture("textures/item/oak_planks.png") + .set_place_voxel(game_voxels::oak_planks) + .build(); + + // Oak log; a big wad of wood + game_items::oak_log = + world::item_registry::construct("oak_log").set_texture("textures/item/oak_log.png").set_place_voxel(game_voxels::oak_log).build(); + + // Glass; used for windowing + game_items::glass = + world::item_registry::construct("glass").set_texture("textures/item/glass.png").set_place_voxel(game_voxels::glass).build(); + + // Slime; it's bouncy! + game_items::slime = + world::item_registry::construct("slime").set_texture("textures/item/slime.png").set_place_voxel(game_voxels::slime).build(); + + // Mud; you sink in it! + game_items::mud = world::item_registry::construct("mud").set_texture("textures/item/mud.png").build(); +} |
