Skip to content

Commit

Permalink
comfy dev update
Browse files Browse the repository at this point in the history
remove tracking patches by separate git
fix missing logic in replace_mouse_dinput_to_user32
  • Loading branch information
DiaLight committed Jul 20, 2024
1 parent 052d4d2 commit dcc65da
Show file tree
Hide file tree
Showing 28 changed files with 1,225 additions and 247 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ jobs:
with:
python-version: '3.x'
# cache: 'pip'
- uses: actions/cache@v4
id: cache-venv
with:
path: venv
key: setup-venv2-${{ runner.os }}-py-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
setup-venv2-${{ runner.os }}-py-${{ steps.setup-python.outputs.python-version }}-
- name: Setup venv
run: |
python -m venv venv
venv/Scripts/python.exe -m pip install --upgrade pip setuptools wheel
venv/Scripts/python.exe -m pip install -r requirements.txt
if: steps.cache-venv.outputs.cache-hit != 'true'
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: win32
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ venv.bak/

# Flame
/build/
/src/
/tools/obj_research/
/libs/dkii_exe/api/
/install/
Expand Down
1 change: 0 additions & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,6 @@ add_subdirectory(mapping)
add_subdirectory(tools)
add_subdirectory(libs)

if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/src/CMakeLists.txt")
# apply patches
execute_process(
COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${CMAKE_HOME_DIRECTORY}/mapping
${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/apply_patches.py
OUTPUT_VARIABLE GIT_COMMIT_SUBJECT
)
endif ()
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/src/CMakeLists.txt")
message(FATAL_ERROR "src/CMakeLists.txt is not exist.\nPlease run apply_patches.py")
endif ()

if(USE_CONFIGURE_DATE)
string(TIMESTAMP CONFIGURE_DATE "%y%m%d")
endif ()
Expand Down
72 changes: 0 additions & 72 deletions apply_patches.py

This file was deleted.

27 changes: 0 additions & 27 deletions git_notes.md

This file was deleted.

26 changes: 9 additions & 17 deletions mapping/DKII_EXE_v170.sgmap
Original file line number Diff line number Diff line change
Expand Up @@ -4783,20 +4783,11 @@ struct: id=vtbl_0066EF3C,name=CFrontEndComponent,size=201210,vtable=instance_006
type: kind=int,size=1
field: name=field_670D
type: kind=int,size=1
field: name=gap_670E
type: kind=array,count=19
type: kind=int,size=1
field: name=field_6721
type: kind=int,size=1,signed=True,winapi=char
field: name=gap_6722
type: kind=array,count=15
field: name=f670e_gap
type: kind=array,count=3
type: kind=int,size=1
field: name=field_6731
type: kind=int,size=4,signed=True
field: name=field_6735
type: kind=int,size=4,signed=True
field: name=surf63
type: kind=struct,id=constructor_005B5270
field: name=f6711_titleScreen
type: kind=struct,id=instance_0079D200
field: name=aabb16_x16x30x6
type: kind=array,count=16
type: kind=array,count=30
Expand Down Expand Up @@ -4893,8 +4884,9 @@ struct: id=vtbl_0066EF3C,name=CFrontEndComponent,size=201210,vtable=instance_006
type: kind=int,size=1,signed=True,winapi=char
field: name=field_3033C
type: kind=int,size=4,signed=True
field: name=field_30340
type: kind=int,size=4,signed=True
field: name=f30340_pMyDdSurfaceEx
type: kind=ptr
type: kind=struct,id=instance_0079D200
field: name=field_30344
type: kind=int,size=1,signed=True,winapi=char
field: name=field_30345
Expand Down Expand Up @@ -48082,7 +48074,7 @@ global: va=00553FE0,name=TbTQILoader::fun_553FE0,size=30
arg: kind=ptr
type: kind=int,size=4
arg: kind=int,size=1,signed=True,winapi=char
global: va=00554000,name=DiscFileBase_554000,size=164
global: va=00554000,name=DiscFileBase_open,size=164
type: kind=function,declspec=cdecl
ret: kind=int,size=4,signed=True
arg: kind=ptr
Expand Down Expand Up @@ -49380,7 +49372,7 @@ global: va=0055D340,name=sub_55D340,size=486
arg: kind=ptr
type: kind=ptr,winapi=HKEY
type: kind=winapi,name=HKEY__,size=4
global: va=0055D530,name=sub_55D530,size=6
global: va=0055D530,name=getResourceExtensionFlags,size=6
type: kind=function,declspec=stdcall
ret: kind=int,size=4,signed=True
global: va=0055D540,name=sub_55D540,size=16
Expand Down
6 changes: 1 addition & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ Difference from the previous implementation(https://github.com/DiaLight/Ember):

For a more detailed description of how Flame works, read `how_it_works.md`

Partially decompiled code is stored as git patches in the `patches` folder.
To build them to a local git repository, use the `apply_patches.py` script.
After changing any commit in the repository, do not forget to pack it back into patches using the `rebuild_patches.py` script.

The latest version can be taken from the automatic build
The latest build can be taken from the github actions

Requirements:
- CMake 3.25 or higher https://cmake.org/download/
Expand Down
79 changes: 0 additions & 79 deletions rebuild_patches.py

This file was deleted.

3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

56 changes: 56 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
set(TARGET dkii_flame)

add_executable(${TARGET}
main.cpp
dkii_exe_functions.cpp
dk2/MyResources.cpp
dk2/MyGame.cpp
dk2/MyDxMouse.cpp
dk2/CFrontEndComponent.cpp

patches/replace_mouse_dinput_to_user32.cpp
patches/use_wheel_to_zoom.cpp
patches/micro_patches.cpp

${DKII_RESOURCES_FILE}
)
target_include_directories(${TARGET} PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_compile_definitions(${TARGET} PRIVATE
DIRECTINPUT_VERSION=0x0500
DIRECT3D_VERSION=0x0600
)
target_link_libraries(${TARGET} PRIVATE
dkii_delinked dkii_exe_api
# gog_patch_dll

# dk2 specific libs
qmixer_genlib # generated in qmixer_dll/genlib
weanetr_genlib # generated in weanetr_dll/genlib

# the others libs dk2 depends on
winmm
dinput_genlib # generated in dinput_dll/genlib
ddraw # patch - dont link against gog's PATCH.dll because patch addresses are change after recompilation
# also i fully decompiled gog's PATCH.dll and bundled in project

imm32
# wsock32 is old link target
ws2_32 # should be better
dsound
)

target_compile_options(${TARGET} PRIVATE
/Gy # Enable Function-Level Linking
/Gw # Optimize Global Data
/GS-
/Gz # use __stdcall by default
)
target_link_options(${TARGET} PRIVATE /OPT:NOREF)
target_link_options(${TARGET} PRIVATE /MAP) # generate msvc mapping file for exe
set_property(TARGET ${TARGET} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME
"DKII-Flame${OUTPUT_SUFFIX}"
)


Loading

0 comments on commit dcc65da

Please sign in to comment.