Merge tilesets into one
This commit is contained in:
41
game/main.c
41
game/main.c
@@ -93,35 +93,26 @@ bool init(void *userData) {
|
||||
game->camera.zoom = 3.0f;
|
||||
game->frameDuration = 0.16f;
|
||||
|
||||
game->terrainTileset = bzTilesetCreate( &(BzTilesetDesc) {
|
||||
.path="assets/terrain.tsj",
|
||||
.texturePath="assets/terrain.png"
|
||||
});
|
||||
game->buildingsTileset = bzTilesetCreate(&(BzTilesetDesc) {
|
||||
.path="assets/buildings.tsj",
|
||||
.texturePath="assets/buildings.png"
|
||||
});
|
||||
game->entitiesTileset = bzTilesetCreate(&(BzTilesetDesc) {
|
||||
.path="assets/entities.tsj",
|
||||
.texturePath="assets/entities.png"
|
||||
game->tileset = bzTilesetCreate( &(BzTilesetDesc) {
|
||||
.path="assets/game.tsj",
|
||||
.texturePath="assets/game.png"
|
||||
});
|
||||
|
||||
game->map = bzTileMapCreate(&(BzTileMapDesc) {
|
||||
.path="assets/maps/test.tmj",
|
||||
.path="assets/maps/map_01.tmj",
|
||||
.generateCollisionMap=true,
|
||||
.tilesets[0]=game->terrainTileset,
|
||||
.tilesets[1]=game->buildingsTileset,
|
||||
.tilesets[2]=game->entitiesTileset,
|
||||
.tilesets[0]=game->tileset,
|
||||
|
||||
.layers[LAYER_TERRAIN]=(BzTileLayerDesc) {"Terrain", .applyColliders=true},
|
||||
.layers[LAYER_FOLIAGE]=(BzTileLayerDesc) {"Foliage"},
|
||||
.layers[LAYER_TREES]=(BzTileLayerDesc) {"Trees"},
|
||||
.layers[LAYER_TREES2]=(BzTileLayerDesc) {"TreesS"},
|
||||
.layers[LAYER_BUILDINGS]=(BzTileLayerDesc) {"Buildings", .applyColliders=true},
|
||||
.layers[LAYER_BUILDING_OWNER]=(BzTileLayerDesc) {"BuildingOwnership", BZ_TILE_LAYER_SKIP_RENDER},
|
||||
.layers[LAYER_TERRAIN]=(BzTileLayerDesc) {"terrain", .applyColliders=true},
|
||||
.layers[LAYER_ROCKS]=(BzTileLayerDesc) {"rocks"},
|
||||
.layers[LAYER_ROCKS2]=(BzTileLayerDesc) {"rocks_s"},
|
||||
.layers[LAYER_TREES]=(BzTileLayerDesc) {"trees"},
|
||||
.layers[LAYER_TREES2]=(BzTileLayerDesc) {"trees_s"},
|
||||
.layers[LAYER_BUILDINGS]=(BzTileLayerDesc) {"buildings", .applyColliders=true},
|
||||
.layers[LAYER_BUILDING_OWNER]=(BzTileLayerDesc) {"building_ownership", BZ_TILE_LAYER_SKIP_RENDER},
|
||||
|
||||
.objectGroups[OBJECTS_GAME]=(BzTileObjectsDesc) {"Game"},
|
||||
.objectGroups[OBJECTS_ENTITIES]=(BzTileObjectsDesc ) {"Entities"}
|
||||
.objectGroups[OBJECTS_GAME]=(BzTileObjectsDesc) {"game"},
|
||||
.objectGroups[OBJECTS_ENTITIES]=(BzTileObjectsDesc ) {"entities"}
|
||||
});
|
||||
game->entityGrid = bzSpatialGridCreate(&(BzSpatialGridDesc) {
|
||||
.maxWidth=game->map.width * game->map.tileWidth,
|
||||
@@ -179,9 +170,7 @@ void deinit(void *userData) {
|
||||
InputState *input = ecs_singleton_get_mut(ECS, InputState);
|
||||
|
||||
bzTileMapDestroy(&game->map);
|
||||
bzTilesetDestroy(&game->terrainTileset);
|
||||
bzTilesetDestroy(&game->buildingsTileset);
|
||||
bzTilesetDestroy(&game->entitiesTileset);
|
||||
bzTilesetDestroy(&game->tileset);
|
||||
|
||||
Game gameCopy = *game;
|
||||
InputState inputCopy = *input;
|
||||
|
||||
Reference in New Issue
Block a user