Project: Added cmake build process, also fixed mixups

This commit is contained in:
Thomas 2021-11-09 21:15:06 +01:00
parent 920347f828
commit d3ec227451
14 changed files with 56 additions and 19 deletions

5
.gitignore vendored
View File

@ -1,3 +1,6 @@
build*/
*build/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
@ -337,4 +340,4 @@ ASALocalRun/
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
healthchecksdb

11
CMakeLists.txt Normal file
View File

@ -0,0 +1,11 @@
project(sly1-decomp)
cmake_minimum_required(VERSION 3.16)
set(CMAKE_CXX_STANDARD 20)
add_subdirectory(Sly1Decomp)

View File

@ -0,0 +1,3 @@
add_subdirectory(lib)
add_subdirectory(src)

View File

@ -1,6 +0,0 @@
#pragma once
char chetkido_ciphertext[];;
char s_the_password_is[];
void activate_code_chetkido();

0
Sly1Decomp/include/.keep Normal file
View File

0
Sly1Decomp/lib/.keep Normal file
View File

View File

View File

View File

@ -0,0 +1,16 @@
set (FILES
Cheats/cheats.cpp
Savegame/savegame.cpp
# ...
)
add_library(DECOMP ${FILES})
target_include_directories(DECOMP PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(test main.cpp)
target_link_libraries(test PUBLIC DECOMP)

View File

@ -1,7 +1,9 @@
#include "cheats.h"
#include "savegame.h"
#include <stdio.h>
#include <string.h>
#include <Savegame/savegame.h>
#include <cstdio>
#include <cstring>
#include <iostream>
char chetkido_ciphertext[] = "@KFWHJGL";
@ -24,7 +26,7 @@ void activate_code_chetkido()
) || i_am_a_hacker) // Hacker override
{
// Copy encrypted string into sipher
strcpy_s(cipher_slice, chetkido_ciphertext);
std::strncpy(cipher_slice, chetkido_ciphertext, 16);
next_xor_char = cipher_slice;
if (cipher_slice[0] != 0)
@ -44,4 +46,4 @@ void activate_code_chetkido()
std::cout << "Conditions not met" << "\n";
}
return;
}
}

View File

@ -0,0 +1,6 @@
#pragma once
extern char chetkido_ciphertext[];
extern char s_the_password_is[];
void activate_code_chetkido();

View File

@ -1,5 +1,6 @@
#include "savegame.h"
#include <stdio.h>
#include <cstdio>
#include <iostream>
GameSave* g_pgsCur = new GameSave;
@ -130,4 +131,4 @@ int calculate_percent_completion(GameSave* pgs)
}
}
return finalPercent;
}
}

View File

@ -122,8 +122,8 @@ struct PchzLevel
extern GameSave* g_pgsCur;
extern WorldSave* g_pwsCur;
extern LevelSave* g_plsCur;
PchzLevel pchzLevelTable[];
extern PchzLevel pchzLevelTable[];
void populatePchzLevelTable();
int check_game_completion();
int calculate_percent_completion(GameSave* pgs);
int calculate_percent_completion(GameSave* pgs);

View File

@ -1,5 +1,6 @@
#include "savegame.h"
#include "cheats.h"
#include <Savegame/savegame.h>
#include <Cheats/cheats.h>
#include <stdio.h>
#include <iostream>
@ -13,4 +14,4 @@ int main(int argc, char* argv[])
getchar();
return 1;
}
}