A bit more code cleanup

This commit is contained in:
2021-11-22 20:25:45 -08:00
parent a4198e8396
commit 6c9eb8b685
217 changed files with 206 additions and 184 deletions

View File

@ -18,19 +18,18 @@ target_include_directories(${PROJECT_NAME}
)
# Dawn Sources
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/dawn/*.c(pp|xx))
file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/dawn/*.h(pp|xx))
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.c(pp|xx))
file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h(pp|xx))
# Exclude Game Sources
list(FILTER SOURCES EXCLUDE REGEX ".*games\\/.*")
list(FILTER HEADERS EXCLUDE REGEX ".*games\\/.*")
target_sources(${PROJECT_NAME}
PRIVATE
${SOURCES}
${HEADERS}
)
# Sandbox Game Sources
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/sandbox/*.c(pp|xx))
file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/sandbox/*.h(pp|xx))
target_sources(${PROJECT_NAME}
PRIVATE
${SOURCES}
${HEADERS}
)
# Add Game Sources
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/games/${TARGET_GAME})

View File

@ -1,32 +0,0 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "loadingscene.h"
void loadingSceneInit(
loadingscene_t *scene,
assetmanager_t *assetManager
) {
scene->manager = assetManager;
}
void loadingSceneStart(loadingscene_t *scene) {
assetManagerStart(scene->manager);
}
bool loadingSceneUpdate(loadingscene_t *scene) {
assetManagerUpdate(scene->manager);
return scene->manager->finished;
}
void loadingSceneRender(loadingscene_t *scene) {
}
void loadingSceneDispose(loadingscene_t *scene) {
}

View File

@ -1,26 +0,0 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../file/assetmanager.h"
typedef struct {
assetmanager_t *manager;
} loadingscene_t;
void loadingSceneInit(
loadingscene_t *scene,
assetmanager_t *assetManager
);
void loadingSceneStart(loadingscene_t *scene);
bool loadingSceneUpdate(loadingscene_t *scene);
void loadingSceneRender(loadingscene_t *scene);
void loadingSceneDispose(loadingscene_t *scene);

View File

@ -1,9 +0,0 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include <sandbox/game.h>

View File

@ -6,7 +6,7 @@
*/
#pragma once
#include <dawn/libs.h>
#include "../libs.h"
#include "matrix.h"
#include "camera.h"
#include "texture.h"

View File

@ -0,0 +1,62 @@
# Copyright (c) 2021 Dominic Msters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
tool_game(
"Penny's Poker"
1.0
)
file(GLOB_RECURSE SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.c(pp|xx))
file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h(pp|xx))
target_sources(${PROJECT_NAME}
PRIVATE
${SOURCES}
${HEADERS}
)
# Characters
set(DIR_CHARS "${ASSETS_SOURCE_DIR}/poker/characters")
tool_vn_character(vn_penny
${DIR_CHARS}/penny/character.xml poker/characters/penny/sprite
)
tool_vn_character(vn_lucy
${DIR_CHARS}/lucy/character.xml poker/characters/lucy/sprite
)
tool_vn_character(vn_julie
${DIR_CHARS}/julie/character.xml poker/characters/julie/sprite
)
tool_vn_character(vn_sammy
${DIR_CHARS}/sammy/character.xml poker/characters/sammy/sprite
)
tool_vn_character(vn_jenny
${DIR_CHARS}/jenny/character.xml poker/characters/jenny/sprite
)
# World
tool_texture(texture_pub
${ASSETS_SOURCE_DIR}/poker/world/pub/pub_skywall.png poker/world/pub
)
# Generate assets
tool_assets(
shader_textured
shader_singlerenderlist
font_opensans
texture_test
texture_pub
vn_penny
vn_lucy
vn_julie
vn_sammy
vn_jenny
locale_en
)
# Add Assets
add_dependencies(${PROJECT_NAME} assets)

37
src/games/poker/game.h Normal file
View File

@ -0,0 +1,37 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../../libs.h"
#include "../../engine/engine.h"
typedef struct {
engine_t engine;
} game_t;
/**
* Initializes the Dawn Game instance.
*
* @param game Game to instanciate.
* @return True if successful otherwise false.
*/
bool gameInit(game_t *game);
/**
* Update the Dawn Game Instance.
*
* @param game Game to update.
* @param delta The delta of the game to tick by.
*/
bool gameUpdate(game_t *game, float delta);
/**
* Cleanup the dawn game instance.
*
* @param game Game to dispose.
*/
void gameDispose(game_t *game);

Some files were not shown because too many files have changed in this diff Show More