diff --git a/.gitignore b/.gitignore index 5704d07..938a4d8 100644 --- a/.gitignore +++ b/.gitignore @@ -433,3 +433,6 @@ FodyWeavers.xsd 4J_Profile.h extraX64.h + +.vscode/ +build/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..0d9f0b3 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.25 FATAL_ERROR) + +project(4JLibs LANGUAGES CXX) + +# TODO: target selection? +add_subdirectory(Windows_Libs/Dev) \ No newline at end of file diff --git a/Windows_Libs/Dev/CMakeLists.txt b/Windows_Libs/Dev/CMakeLists.txt new file mode 100644 index 0000000..3e9068f --- /dev/null +++ b/Windows_Libs/Dev/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.25 FATAL_ERROR) + +project(4JLibs.Windows LANGUAGES CXX) + +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + +add_subdirectory(Input) +add_subdirectory(Profile) +add_subdirectory(Render) +add_subdirectory(Storage) diff --git a/Windows_Libs/Dev/Input/CMakeLists.txt b/Windows_Libs/Dev/Input/CMakeLists.txt new file mode 100644 index 0000000..1bd6aa9 --- /dev/null +++ b/Windows_Libs/Dev/Input/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.25 FATAL_ERROR) + +project(4JLibs.Windows.Input LANGUAGES CXX) + +add_library(${PROJECT_NAME} STATIC + 4J_Input.cpp + INP_ForceFeedback.cpp + INP_Keyboard.cpp + INP_Main.cpp + INP_StringCheck.cpp + LinkedList.cpp + stdafx.cpp +) + +target_include_directories(${PROJECT_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_precompile_headers(${PROJECT_NAME} PRIVATE + stdafx.h +) + +set_target_properties(${PROJECT_NAME} PROPERTIES + PREFIX "" + OUTPUT_NAME "4J_Input" +) \ No newline at end of file diff --git a/Windows_Libs/Dev/Input/INP_ForceFeedback.cpp b/Windows_Libs/Dev/Input/INP_ForceFeedback.cpp index 181004a..969b87d 100644 --- a/Windows_Libs/Dev/Input/INP_ForceFeedback.cpp +++ b/Windows_Libs/Dev/Input/INP_ForceFeedback.cpp @@ -98,7 +98,7 @@ void CForceFeedback::Tick(void) LinkedList::_LL_NODE *pTemp = pRumbleNode; pRumbleNode = pRumbleNode->m_Next; - delete pTemp->m_pvData; + delete pTemp->GetDataAs(); delete pTemp; } else diff --git a/Windows_Libs/Dev/Profile/CMakeLists.txt b/Windows_Libs/Dev/Profile/CMakeLists.txt new file mode 100644 index 0000000..0c52582 --- /dev/null +++ b/Windows_Libs/Dev/Profile/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.25 FATAL_ERROR) + +project(4JLibs.Windows.Profile LANGUAGES CXX) + +add_library(${PROJECT_NAME} STATIC + 4J_Profile.cpp + PRO_AwardManager.cpp + PRO_Data.cpp + PRO_Main.cpp + PRO_RichPresence.cpp + PRO_Sys.cpp + stdafx.cpp +) + +target_include_directories(${PROJECT_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_precompile_headers(${PROJECT_NAME} PRIVATE + stdafx.h +) + +set_target_properties(${PROJECT_NAME} PROPERTIES + PREFIX "" + OUTPUT_NAME "4J_Profile" +) \ No newline at end of file diff --git a/Windows_Libs/Dev/Render/CMakeLists.txt b/Windows_Libs/Dev/Render/CMakeLists.txt new file mode 100644 index 0000000..d53e645 --- /dev/null +++ b/Windows_Libs/Dev/Render/CMakeLists.txt @@ -0,0 +1,53 @@ +cmake_minimum_required(VERSION 3.25 FATAL_ERROR) + +project(4JLibs.Windows.Render LANGUAGES C CXX) + +set(LIBPNG_SOURCES + libpng/png.c + libpng/pngerror.c + libpng/pngget.c + libpng/pngmem.c + libpng/pngpread.c + libpng/pngread.c + libpng/pngrio.c + libpng/pngrtran.c + libpng/pngrutil.c + libpng/pngset.c + libpng/pngtest.c + libpng/pngtrans.c + libpng/pngwio.c + libpng/pngwrite.c + libpng/pngwtran.c + libpng/pngwutil.c +) + +add_library(${PROJECT_NAME} STATIC + ${LIBPNG_SOURCES} + 4J_Render.cpp + RendererCBuff.cpp + RendererCore.cpp + RendererMatrix.cpp + RendererState.cpp + RendererTexture.cpp + RendererVertex.cpp + stdafx.cpp +) + +target_include_directories(${PROJECT_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/zlib +) + +target_precompile_headers(${PROJECT_NAME} PRIVATE + stdafx.h +) + +set_target_properties(${PROJECT_NAME} PROPERTIES + PREFIX "" + OUTPUT_NAME "4J_Render" +) + +set_source_files_properties(${LIBPNG_SOURCES} PROPERTIES + LANGUAGE C + SKIP_PRECOMPILE_HEADERS ON +) \ No newline at end of file diff --git a/Windows_Libs/Dev/Storage/CMakeLists.txt b/Windows_Libs/Dev/Storage/CMakeLists.txt new file mode 100644 index 0000000..b27c0ba --- /dev/null +++ b/Windows_Libs/Dev/Storage/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.25 FATAL_ERROR) + +project(4JLibs.Windows.Storage LANGUAGES C CXX) + +add_library(${PROJECT_NAME} STATIC + 4J_Storage.cpp + stdafx.cpp + STO_DLC.cpp + STO_Main.cpp + STO_SaveGame.cpp +) + +target_include_directories(${PROJECT_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_precompile_headers(${PROJECT_NAME} PRIVATE + stdafx.h +) + +set_target_properties(${PROJECT_NAME} PROPERTIES + PREFIX "" + OUTPUT_NAME "4J_Storage" +) \ No newline at end of file diff --git a/Windows_Libs/Dev/Storage/STO_SaveGame.cpp b/Windows_Libs/Dev/Storage/STO_SaveGame.cpp index f1c830a..a6e39b6 100644 --- a/Windows_Libs/Dev/Storage/STO_SaveGame.cpp +++ b/Windows_Libs/Dev/Storage/STO_SaveGame.cpp @@ -65,7 +65,7 @@ C4JStorage::ESaveGameState CSaveGame::GetSavesInfo(int iPad, int (*Func)(LPVOID if (h == INVALID_HANDLE_VALUE) { DWORD error = GetLastError(); - printf("Error finding save dirs: 0x%08x\n", error); + printf("Error finding save dirs: 0x%08lx\n", error); } else {