@@ -2,10 +2,10 @@ | |||||
cmake \ | cmake \ | ||||
-DCMAKE_SIZEOF_VOID_P=8 \ | -DCMAKE_SIZEOF_VOID_P=8 \ | ||||
-DCMAKE_BUILD_TYPE=Debug \ | |||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \ | |||||
-DCMAKE_MAKE_PROGRAM=ninja \ | -DCMAKE_MAKE_PROGRAM=ninja \ | ||||
-DCMAKE_C_COMPILER=cc \ | -DCMAKE_C_COMPILER=cc \ | ||||
-DCMAKE_C_FLAGS=-m64 \ | -DCMAKE_C_FLAGS=-m64 \ | ||||
-G Ninja \ | -G Ninja \ | ||||
-S . \ | -S . \ | ||||
-B ./build/Debug | |||||
-B ./build/$BUILD_TYPE |
@@ -0,0 +1,15 @@ | |||||
#!/usr/bin/env sh | |||||
if [ "$BUILD_TYPE" = "" ] | |||||
then | |||||
echo "No build type specified. Try Debug or Release." | |||||
exit | |||||
fi | |||||
if [ "$EXECUTABLE" = "" ] | |||||
then | |||||
echo "No executable specified. Refer to CMakeLists.txt for available executables to build." | |||||
exit | |||||
fi | |||||
cmake --build "./build/$BUILD_TYPE" -t "$EXECUTABLE" |
@@ -1,3 +0,0 @@ | |||||
#!/usr/bin/env sh | |||||
cmake --build build/Debug -t game |
@@ -1,3 +0,0 @@ | |||||
#!/usr/bin/env sh | |||||
cmake --build build/Debug -t server |
@@ -0,0 +1,7 @@ | |||||
#!/usr/bin/env sh | |||||
if [ "$BUILD_TYPE" = "" ] | |||||
then | |||||
return 1 | |||||
fi | |||||
cmake --build "./build/$BUILD_TYPE" -t server |
@@ -217,7 +217,7 @@ target_link_libraries( | |||||
) | ) | ||||
add_executable( | add_executable( | ||||
game-test-geometry | |||||
test-game-geometry | |||||
subprojects/bdd-for-c/bdd-for-c.h | subprojects/bdd-for-c/bdd-for-c.h | ||||
subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h | subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h | ||||
@@ -229,7 +229,7 @@ add_executable( | |||||
) | ) | ||||
add_executable( | add_executable( | ||||
game-test-input | |||||
test-game-input | |||||
subprojects/bdd-for-c/bdd-for-c.h | subprojects/bdd-for-c/bdd-for-c.h | ||||
subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h | subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h | ||||
@@ -265,13 +265,13 @@ add_executable( | |||||
) | ) | ||||
target_link_libraries( | target_link_libraries( | ||||
game-test-input | |||||
test-game-input | |||||
SDL2main | SDL2main | ||||
SDL2 | SDL2 | ||||
) | ) | ||||
add_executable( | add_executable( | ||||
game-test-output | |||||
test-game-output | |||||
subprojects/bdd-for-c/bdd-for-c.h | subprojects/bdd-for-c/bdd-for-c.h | ||||
subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h | subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h | ||||
@@ -286,7 +286,7 @@ add_executable( | |||||
) | ) | ||||
add_executable( | add_executable( | ||||
game-test-memory | |||||
test-game-memory | |||||
subprojects/bdd-for-c/bdd-for-c.h | subprojects/bdd-for-c/bdd-for-c.h | ||||
subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h | subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h | ||||
@@ -310,13 +310,13 @@ add_executable( | |||||
) | ) | ||||
target_link_libraries( | target_link_libraries( | ||||
game-test-memory | |||||
test-game-memory | |||||
SDL2main | SDL2main | ||||
SDL2 | SDL2 | ||||
) | ) | ||||
add_executable( | add_executable( | ||||
game-test-data | |||||
test-game-data | |||||
subprojects/bdd-for-c/bdd-for-c.h | subprojects/bdd-for-c/bdd-for-c.h | ||||
subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h | subprojects/bdd-for-c-mocks/bdd-for-c-mocks.h | ||||
@@ -329,7 +329,7 @@ add_executable( | |||||
) | ) | ||||
target_link_libraries( | target_link_libraries( | ||||
game-test-data | |||||
test-game-data | |||||
SDL2main | SDL2main | ||||
SDL2 | SDL2 | ||||
) | ) | ||||
@@ -443,10 +443,10 @@ if (IZ_PLATFORM STREQUAL "WINDOWS") | |||||
"${CMAKE_HOME_DIRECTORY}/dependencies/openssl/${IZ_PROJECT_ARCH}/bin/libcrypto-1_1-${IZ_SDL_ARCH}.dll" | "${CMAKE_HOME_DIRECTORY}/dependencies/openssl/${IZ_PROJECT_ARCH}/bin/libcrypto-1_1-${IZ_SDL_ARCH}.dll" | ||||
$<TARGET_FILE_DIR:server>) | $<TARGET_FILE_DIR:server>) | ||||
add_custom_command(TARGET game-test-input POST_BUILD | |||||
add_custom_command(TARGET test-game-input POST_BUILD | |||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different | COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||||
"${CMAKE_HOME_DIRECTORY}/subprojects/SDL/VisualC/${IZ_SDL_ARCH}/${CMAKE_BUILD_TYPE}/SDL2.dll" | "${CMAKE_HOME_DIRECTORY}/subprojects/SDL/VisualC/${IZ_SDL_ARCH}/${CMAKE_BUILD_TYPE}/SDL2.dll" | ||||
$<TARGET_FILE_DIR:game-test-input>) | |||||
$<TARGET_FILE_DIR:test-game-input>) | |||||
endif () | endif () | ||||
add_custom_command(TARGET game POST_BUILD | add_custom_command(TARGET game POST_BUILD | ||||
@@ -31,7 +31,7 @@ The following are required for building on all platforms: | |||||
5. Generate the CMake cache. | 5. Generate the CMake cache. | ||||
```shell | |||||
```batch | |||||
cmake^ | cmake^ | ||||
-DCMAKE_SIZEOF_VOID_P=8^ | -DCMAKE_SIZEOF_VOID_P=8^ | ||||
"-DCMAKE_MT=%CMAKE_MT%"^ | "-DCMAKE_MT=%CMAKE_MT%"^ | ||||
@@ -48,6 +48,12 @@ The following are required for building on all platforms: | |||||
6. Build the specific executables you want to build, which are defined in `CMakeLists.txt`. | 6. Build the specific executables you want to build, which are defined in `CMakeLists.txt`. | ||||
```batch | |||||
cmake^ | |||||
--build "./build/%BUILD_TYPE%"^ | |||||
-t "%EXECUTABLE%" | |||||
``` | |||||
### macOS/*NIX | ### macOS/*NIX | ||||
1. Ensure additional tools are present in the system: | 1. Ensure additional tools are present in the system: | ||||
@@ -64,15 +70,21 @@ The following are required for building on all platforms: | |||||
```shell | ```shell | ||||
cmake \ | cmake \ | ||||
-DCMAKE_SIZEOF_VOID_P=8 \ | -DCMAKE_SIZEOF_VOID_P=8 \ | ||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \ | |||||
"-DCMAKE_BUILD_TYPE=$BUILD_TYPE" \ | |||||
-DCMAKE_MAKE_PROGRAM=ninja \ | -DCMAKE_MAKE_PROGRAM=ninja \ | ||||
-DCMAKE_C_COMPILER=cc \ | -DCMAKE_C_COMPILER=cc \ | ||||
-DCMAKE_C_FLAGS=-m64 \ | -DCMAKE_C_FLAGS=-m64 \ | ||||
-G Ninja \ | -G Ninja \ | ||||
-S . \ | -S . \ | ||||
-B ./build/$BUILD_TYPE | |||||
-B "./build/$BUILD_TYPE" | |||||
``` | ``` | ||||
> **Important:** Create the directories under `/build` per each `BUILD_TYPE` you are generating. | > **Important:** Create the directories under `/build` per each `BUILD_TYPE` you are generating. | ||||
5. Build the specific executables you want to build, which are defined in `CMakeLists.txt`. | 5. Build the specific executables you want to build, which are defined in `CMakeLists.txt`. | ||||
```shell | |||||
cmake \ | |||||
--build "./build/$BUILD_TYPE" \ | |||||
-t "$EXECUTABLE" | |||||
``` |
@@ -2,6 +2,8 @@ | |||||
- [X] Unify memset/memcpy/free/malloc functions (remove SDL/lws dependency) | - [X] Unify memset/memcpy/free/malloc functions (remove SDL/lws dependency) | ||||
- [ ] Revisit unit tests | - [ ] Revisit unit tests | ||||
- [ ] Implement character sprites + animations | - [ ] Implement character sprites + animations | ||||
- [ ] Finalize initial character sprite for rendering | |||||
- [ ] Acquire Affinity Designer (so we can move on from Corel) | |||||
- [ ] Implement memory pool | - [ ] Implement memory pool | ||||
- [ ] Fix gamepad mapping | - [ ] Fix gamepad mapping | ||||
- [ ] Provide default mapping | - [ ] Provide default mapping | ||||
@@ -48,16 +48,17 @@ void IZ_LogInitialize(const char* context, bool force_output) { | |||||
stderr_dest = stderr; | stderr_dest = stderr; | ||||
#else | #else | ||||
const char* log_dir = "logs"; | const char* log_dir = "logs"; | ||||
if (!IZ_isdir(log_dir)) { | |||||
IZ_mkdir(log_dir); | |||||
char base_log_dir[128]; | |||||
sprintf(base_log_dir, "%s/%s", SDL_GetBasePath(), log_dir); | |||||
if (!IZ_isdir(base_log_dir)) { | |||||
IZ_mkdir(base_log_dir); | |||||
} | } | ||||
char stdout_filename[128] = ""; | char stdout_filename[128] = ""; | ||||
char stderr_filename[128] = ""; | char stderr_filename[128] = ""; | ||||
char* now = IZ_TimerNowPathSafe(); | char* now = IZ_TimerNowPathSafe(); | ||||
// fixme | |||||
sprintf(stdout_filename, "%s/%s-out-%s.log", log_dir, context, now); | |||||
sprintf(stderr_filename, "%s/%s-err-%s.log", log_dir, context, now); | |||||
sprintf(stdout_filename, "%s/%s-out-%s.log", base_log_dir, context, now); | |||||
sprintf(stderr_filename, "%s/%s-err-%s.log", base_log_dir, context, now); | |||||
IZ_fopen(&stdout_dest, stdout_filename, "a"); | IZ_fopen(&stdout_dest, stdout_filename, "a"); | ||||
IZ_fopen(&stderr_dest, stderr_filename, "a"); | IZ_fopen(&stderr_dest, stderr_filename, "a"); | ||||
#endif | #endif | ||||
@@ -16,6 +16,7 @@ | |||||
#define IZ_LOG_LEVEL_FLAG_WARN | #define IZ_LOG_LEVEL_FLAG_WARN | ||||
#define IZ_LOG_LEVEL_FLAG_ERROR | #define IZ_LOG_LEVEL_FLAG_ERROR | ||||
#include <SDL_filesystem.h> | |||||
#if defined IZ_WINDOWS | #if defined IZ_WINDOWS | ||||
#include <io.h> | #include <io.h> | ||||
#include <SDL_syswm.h> | #include <SDL_syswm.h> | ||||
@@ -26,7 +26,7 @@ errno_t IZ_strlwr(char* dest, const char* str, rsize_t str_size) { | |||||
} | } | ||||
return _strlwr_s(dest, str_size); | return _strlwr_s(dest, str_size); | ||||
#else | #else | ||||
memcpy(dest, str, str_size -1); | |||||
memcpy(dest, str, str_size - 1); | |||||
for (unsigned int i = 0; i < str_size; i += 1) { | for (unsigned int i = 0; i < str_size; i += 1) { | ||||
if ('A' <= dest[i] && dest[i] <= 'Z') { | if ('A' <= dest[i] && dest[i] <= 'Z') { | ||||
dest[i] += 0x20; | dest[i] += 0x20; | ||||
@@ -1 +1 @@ | |||||
Subproject commit dc3396c806d500802cb8a8dad15d3e46a9621954 | |||||
Subproject commit 04b34ae8ffd6527c0d9f87a09e96e09d0fc59f7f |