Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4825450
Add initial CharacterDef reading (wip for Mikey)
Feb 16, 2025
49a4507
Change file path to void*
Feb 16, 2025
d9f9b5d
Set up Google Test
Feb 16, 2025
457fed0
Add CharacterDef unit test
Feb 16, 2025
17f07df
Finish CharacterDef serialization
Feb 16, 2025
86f8c70
Added ObjectDef
MikeyLORR Feb 16, 2025
53981db
Merge branch 'serialization' of https://github.com/ThuverX/MySimsModL…
MikeyLORR Feb 16, 2025
b4a72a6
Added ObjectDefTest (INCOMPLETE), cleaned up ObjectDef
MikeyLORR Feb 16, 2025
a255120
Add World and related structs
Feb 16, 2025
77856bf
Merge branch 'serialization' of https://github.com/ThuverX/MySimsModL…
Feb 16, 2025
495ccf2
Add XML parsing error handling
Feb 16, 2025
e5add55
Fix ObjectDef unit test
Feb 16, 2025
dfab8ef
Optimize CharacterDef and ObjectDef parsing
Feb 17, 2025
87f5b0e
Move XML related parsers to subdirectory
Feb 20, 2025
67c5b00
Add basic material reading
Feb 20, 2025
ed84dc2
Loading subdirectories, they are loaded but the game doesn't see them…
ThuverX Mar 11, 2025
49ffae6
x64 now works again
ThuverX Mar 20, 2025
1f382ab
fix build pipeline
ThuverX Mar 20, 2025
25b9eb4
change pipeline name
ThuverX Mar 20, 2025
c539893
Changed dsound to be included the same way as wsock
ThuverX Mar 20, 2025
8bf4fa8
Merge remote-tracking branch 'origin/serialization' into x64-support
ThuverX Mar 20, 2025
3affae6
Include EASTL from Spore mod api
ThuverX May 17, 2025
df076c9
Initial x64 (Cozy Bundle) support. Entire systems rewrite
ThuverX May 17, 2025
517ace2
Add enhanced asset handling, material system updates, and tests
ThuverX May 23, 2025
9c317bb
Missed a testing file. I think including game files is fine, as long …
ThuverX May 23, 2025
6feb067
Remove debug stuff from test
ThuverX May 23, 2025
469203e
Initial implementation of the Clothing tweaker
ThuverX May 23, 2025
b367445
Support for editing files that are loaded via LoadXMLFromPath
ThuverX May 30, 2025
8f981ad
Added comments and defines + Fix pipeline?
ThuverX May 30, 2025
6f4509e
Fix pipeline?
ThuverX May 30, 2025
40ac301
Fix pipeline!
ThuverX May 30, 2025
82f1658
Beginnings of the x86 clothing tweaker.
ThuverX Jun 6, 2025
e20cd6c
Fix submodule for directxtex, update README.md
ThuverX Jun 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 48 additions & 4 deletions .github/workflows/cmake-single-platform.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CMake on a single platform
name: CMake build all

on:
push:
Expand All @@ -11,7 +11,7 @@ env:
BUILD_TYPE: Release

jobs:
build:
build-x86:
runs-on: windows-latest

steps:
Expand All @@ -22,7 +22,12 @@ jobs:

- name: Get Tag Name
shell: bash
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "TAG_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
fi

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G "Visual Studio 17 2022" -A Win32 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
Expand All @@ -43,5 +48,44 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows-x86-${{ env.TAG_NAME }}
name: mysims-windows-x86-${{ env.TAG_NAME }}
path: ${{ github.workspace }}/artifact/
build-x64:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- name: Get Tag Name
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "TAG_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
fi

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}

- name: Prepare Artifact
run: |
mkdir -p ${{ github.workspace }}/artifact/mods/basemod
cp -r ${{ github.workspace }}/basemod/* ${{ github.workspace }}/artifact/mods/basemod/
cp ${{ github.workspace }}/build/Release/WSOCK32.dll ${{ github.workspace }}/artifact/

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: mysims-cozybundle-windows-x64-${{ env.TAG_NAME }}
path: ${{ github.workspace }}/artifact/
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
cmake
old
run
cmake-build-debug-visual-studio
cmake-build-release-visual-studio
cmake-build-debug64-msvc
cmake-build-release64-msvc
cmake-build-debug32-msvc
cmake-build-release32-msvc
src/Version.h
.idea
build/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@
[submodule "libs/pugixml"]
path = libs/pugixml
url = https://github.com/zeux/pugixml.git
[submodule "libs/googletest"]
path = libs/googletest
url = https://github.com/google/googletest.git
[submodule "libs/directxtex"]
path = libs/directxtex
url = https://github.com/microsoft/DirectXTex.git
210 changes: 181 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,111 @@ project(MySimsModLoader)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

option(BUILD_TESTS "Build tests" ON)

# Disable sigmatch tests to speed up compilation
set(SIGMATCH_BUILD_TESTS OFF CACHE BOOL "Disable sigmatch tests" FORCE)

add_subdirectory(libs/directxtex)
add_subdirectory(libs/minhook)
add_subdirectory(libs/sigmatch)
add_subdirectory(libs/pugixml)

add_library(MySimsModLoader SHARED src/Main.cpp
src/dsound.h
src/modloader/ModLoader.cpp
src/modloader/ModLoader.h
src/util/Logger.cpp
src/util/Logger.h
src/util/Console.cpp
src/util/Console.h
src/assets/Assets.cpp
src/assets/Assets.h
src/mods/Mods.cpp
src/mods/Mods.h
src/Hooks/Hooks.cpp
src/Hooks/Hooks.h
src/signatures/Signatures.cpp
src/signatures/Signatures.h
src/mods/Mod.cpp
src/mods/Mod.h
src/util/File.cpp
src/util/File.h
src/assets/Asset.cpp
src/assets/Asset.h
src/util/FNV.cpp
src/util/FNV.h
src/signatures/lua.h
src/signatures/sigdef.h
src/hooks/LuaHook.cpp
src/hooks/LuaHook.h
set(SOURCES
src/Main.cpp
src/core/modloader/ModLoader.cpp
src/core/modloader/ModLoader.h
src/core/system/Logger.cpp
src/core/system/Logger.h
src/core/system/Console.cpp
src/core/system/Console.h
src/core/assets/Assets.cpp
src/core/assets/Assets.h
src/core/modloader/Mods.cpp
src/core/modloader/Mods.h
src/core/hooks/Hooks.cpp
src/core/hooks/Hooks.h
src/core/signatures/Signatures.cpp
src/core/signatures/Signatures.h
src/core/modloader/Mod.cpp
src/core/modloader/Mod.h
src/core/assets/Asset.cpp
src/core/assets/Asset.h
src/core/hash/FNV.cpp
src/core/hash/FNV.h
src/include/lua.h
src/core/signatures/sigdef.h
src/core/hooks/LuaHook.cpp
src/core/hooks/LuaHook.h
src/include/hash_sha256.h
src/core/resource/IdResolver.cpp
src/core/resource/IdResolver.h
src/core/hooks/Config.h
src/formats/materials/Material.h
src/formats/materials/Material.cpp
src/formats/xml/CharacterDef.h
src/formats/xml/CharacterDef.cpp
src/formats/xml/ObjectDef.h
src/formats/xml/ObjectDef.cpp
src/formats/xml/World.h
src/formats/xml/World.cpp
src/core/system/CrashHandler.cpp
src/core/system/CrashHandler.h
src/core/resource/CustomDatabase.cpp
src/core/resource/CustomDatabase.h
src/EA/io/FileStream.cpp
src/EA/io/FileStream.h
src/EA/io/IStream.h
src/tweakers/Swarm/SwarmTweaker.h
src/tweakers/Swarm/SwarmTweaker.cpp
src/EA/io/MemoryStream.cpp
src/EA/io/MemoryStream.h
src/tweakers/Tweakers.h
src/EA/ResourceMan/KeyFilter.h
src/EA/ResourceMan/RecordInfo.h
src/core/resource/CustomRecord.cpp
src/core/resource/CustomRecord.h
src/EA/ResourceMan/IDatabase.h
src/EA/ResourceMan/IRecord.h
src/EA/IO/Constants.h
src/EA/IO/SubFileStream.cpp
src/EA/IO/SubFileStream.h
src/tweakers/Clothing/ClothingTweaker.cpp
src/tweakers/Clothing/ClothingTweaker.h
src/EA/ResourceMan/ResourceKey.cpp
src/formats/materials/MaterialParameter.cpp
src/include/refpack.h
src/core/hooks/ArgscriptHook.cpp
src/core/hooks/ArgscriptHook.h
src/formats/materials/MaterialSet.cpp
src/formats/materials/MaterialSet.h
src/formats/builders/MaterialBuilder.cpp
src/formats/builders/MaterialBuilder.h
src/formats/builders/MaterialSetBuilder.cpp
src/formats/builders/MaterialSetBuilder.h
src/tweakers/Material/MaterialTweaker.cpp
src/tweakers/Material/MaterialTweaker.h
src/tweakers/Tweakers.cpp
src/EA/ResourceMan/IResource.h
src/core/util/StreamUtil.cpp
src/core/util/StreamUtil.h
src/tweakers/Clothing/SkintoneVariantGenerator.cpp
src/tweakers/Clothing/SkintoneVariantGenerator.h
)

if (CMAKE_GENERATOR_PLATFORM STREQUAL "x64")
list(APPEND SOURCES
src/platform/w64/wsock.def
src/platform/w64/wsock.h)

else ()
list(APPEND SOURCES
src/platform/w32/dsound.def
src/platform/w32/dsound.h)
endif ()

add_library(MySimsModLoader SHARED ${SOURCES})

add_custom_target(version
${CMAKE_COMMAND} -D SRC=${CMAKE_SOURCE_DIR}/src/Version.h.in
-D DST=${CMAKE_SOURCE_DIR}/src/Version.h
Expand All @@ -50,11 +117,96 @@ add_custom_target(version

add_dependencies(MySimsModLoader version)

add_compile_definitions(CHAR8_T_DEFINED)

add_definitions(-D_CHAR16T)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-DEASTL_OPENSOURCE=1)

add_definitions(-DPROJECT_ROOT="${CMAKE_SOURCE_DIR}")

target_include_directories(MySimsModLoader PRIVATE
libs/eastl/include
libs/eastl/test/packages/EABase/include/Common
)

target_include_directories(MySimsModLoader PRIVATE libs/pugixml/src)
target_include_directories(MySimsModLoader PRIVATE libs/minhook/include)
target_include_directories(MySimsModLoader PRIVATE libs/sigmatch/include)
target_include_directories(MySimsModLoader PRIVATE libs/directxtex)

target_link_libraries(MySimsModLoader PRIVATE DirectXTex)
target_link_libraries(MySimsModLoader PRIVATE minhook)
target_link_libraries(MySimsModLoader PRIVATE pugixml-static)

set_target_properties(MySimsModLoader PROPERTIES OUTPUT_NAME "dsound")
set_target_properties(MySimsModLoader PROPERTIES OUTPUT_NAME "dsound")

if (CMAKE_GENERATOR_PLATFORM STREQUAL "x64")
target_compile_definitions(MySimsModLoader PRIVATE VERSION_COZY_BUNDLE)
set_target_properties(MySimsModLoader PROPERTIES OUTPUT_NAME "WSOCK32")
else ()
target_compile_definitions(MySimsModLoader PRIVATE VERSION_TACO_BELL)
endif()

if (BUILD_TESTS)
# For Windows: Prevent overriding the parent project's compiler/linker settings
# As per documentation: http://google.github.io/googletest/quickstart-cmake.html
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory(libs/googletest)

enable_testing()

add_executable(Tests
# Tests
tests/CharacterDefTest.cpp
tests/MaterialTest.cpp
tests/ObjectDefTest.cpp
tests/MaterialSetTest.cpp
# Format
src/formats/xml/CharacterDef.h
src/formats/xml/CharacterDef.cpp
src/formats/xml/ObjectDef.h
src/formats/xml/ObjectDef.cpp
src/formats/materials/Material.h
src/formats/materials/Material.cpp
src/formats/materials/MaterialParameter.h
src/formats/materials/MaterialParameter.cpp
src/formats/materials/MaterialSet.h
src/formats/materials/MaterialSet.cpp
# EA
src/EA/IO/MemoryStream.h
src/EA/IO/MemoryStream.cpp
src/EA/IO/FileStream.h
src/EA/IO/FileStream.cpp
src/EA/ResourceMan/ResourceKey.h
src/EA/ResourceMan/ResourceKey.cpp
# Utilities
src/core/system/Logger.h
src/core/system/Logger.cpp
src/core/util/StreamUtil.cpp
src/core/util/StreamUtil.h)

target_include_directories(Tests PRIVATE
libs/eastl/include
libs/eastl/test/packages/EABase/include/Common
)

# Set a define to indicate that we are running unit tests
target_compile_definitions(Tests PRIVATE -DUNIT_TESTING)

target_include_directories(Tests PRIVATE libs/pugixml/src)
target_include_directories(Tests PRIVATE src)

target_compile_definitions(Tests PRIVATE
TEST_ASSETS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/tests/assets/"
)

target_link_libraries(Tests PRIVATE
GTest::gmock
GTest::gtest_main
pugixml-static)

include(GoogleTest)
gtest_discover_tests(Tests)
endif ()
Loading