Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 21 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ find_package(Python3 COMPONENTS Interpreter)
add_custom_target(
ExtractAssets
COMMAND ${CMAKE_COMMAND} -E rm -f oot.otr oot-mq.otr soh.otr

# copy LUS default shaders into assets/custom
COMMAND ${CMAKE_COMMAND} -E rm -r -f ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/graphic/Fast3D/shaders/ ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/

COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive --xml-root ../soh/assets/xml --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}"
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
Expand All @@ -220,6 +225,11 @@ add_custom_target(
add_custom_target(
GenerateSohOtr
COMMAND ${CMAKE_COMMAND} -E rm -f soh.otr

# copy LUS default shaders into assets/custom
COMMAND ${CMAKE_COMMAND} -E rm -r -f ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/graphic/Fast3D/shaders/ ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom/shaders/

COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --norom --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}"
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DONLYSOHOTR=On -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
Expand All @@ -231,7 +241,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(ImageMagick COMPONENTS convert)
if (ImageMagick_FOUND)
execute_process (
COMMAND ${ImageMagick_convert_EXECUTABLE} soh/macosx/sohIcon.png -resize 512x512 ${CMAKE_BINARY_DIR}/sohIcon.png
COMMAND ${ImageMagick_convert_EXECUTABLE} ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png -resize 512x512 ${CMAKE_BINARY_DIR}/sohIcon.png
OUTPUT_VARIABLE outVar
)
endif()
Expand All @@ -240,16 +250,16 @@ endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
add_custom_target(CreateOSXIcons
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/macosx/soh.iconset
COMMAND sips -z 16 16 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16.png
COMMAND sips -z 32 32 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16@2x.png
COMMAND sips -z 32 32 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32.png
COMMAND sips -z 64 64 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32@2x.png
COMMAND sips -z 128 128 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128.png
COMMAND sips -z 256 256 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128@2x.png
COMMAND sips -z 256 256 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256.png
COMMAND sips -z 512 512 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256@2x.png
COMMAND sips -z 512 512 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512.png
COMMAND cp soh/macosx/sohIcon.png ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512@2x.png
COMMAND sips -z 16 16 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16.png
COMMAND sips -z 32 32 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16@2x.png
COMMAND sips -z 32 32 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32.png
COMMAND sips -z 64 64 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32@2x.png
COMMAND sips -z 128 128 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128.png
COMMAND sips -z 256 256 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128@2x.png
COMMAND sips -z 256 256 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256.png
COMMAND sips -z 512 512 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256@2x.png
COMMAND sips -z 512 512 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512.png
COMMAND cp ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512@2x.png
COMMAND iconutil -c icns -o ${CMAKE_BINARY_DIR}/macosx/soh.icns ${CMAKE_BINARY_DIR}/macosx/soh.iconset
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Creating OSX icons ..."
Expand Down
2 changes: 1 addition & 1 deletion libultraship
Submodule libultraship updated 89 files
+4 −0 CMakeLists.txt
+2 −0 cmake/cvars.cmake
+13 −13 cmake/dependencies/common.cmake
+61 −0 cmake/dependencies/git-patch.cmake
+14 −0 cmake/dependencies/windows-vcpkg.cmake
+0 −15 cmake/dependencies/windows.cmake
+0 −1 include/libultraship/libultra.h
+21 −0 include/libultraship/libultra/gbi.h
+1 −0 include/libultraship/libultra/os.h
+226 −54 include/libultraship/libultra/rcp.h
+0 −50 include/libultraship/libultra/rsp.h
+12 −0 src/CMakeLists.txt
+8 −0 src/audio/AudioPlayer.cpp
+6 −0 src/audio/AudioPlayer.h
+3 −3 src/audio/SDLAudioPlayer.cpp
+1 −0 src/audio/SDLAudioPlayer.h
+36 −15 src/audio/WasapiAudioPlayer.cpp
+1 −0 src/audio/WasapiAudioPlayer.h
+13 −0 src/config/Config.cpp
+1 −0 src/config/Config.h
+4 −0 src/graphic/Fast3D/gfx_cc.cpp
+3 −1 src/graphic/Fast3D/gfx_cc.h
+6 −3 src/graphic/Fast3D/gfx_direct3d11.cpp
+6 −2 src/graphic/Fast3D/gfx_direct3d12.cpp
+132 −403 src/graphic/Fast3D/gfx_direct3d_common.cpp
+7 −8 src/graphic/Fast3D/gfx_direct3d_common.h
+55 −15 src/graphic/Fast3D/gfx_dxgi.cpp
+1 −0 src/graphic/Fast3D/gfx_dxgi.h
+3 −4 src/graphic/Fast3D/gfx_metal.cpp
+160 −380 src/graphic/Fast3D/gfx_metal_shader.cpp
+5 −6 src/graphic/Fast3D/gfx_metal_shader.h
+199 −399 src/graphic/Fast3D/gfx_opengl.cpp
+126 −31 src/graphic/Fast3D/gfx_pc.cpp
+14 −4 src/graphic/Fast3D/gfx_pc.h
+33 −7 src/graphic/Fast3D/gfx_sdl2.cpp
+4 −0 src/graphic/Fast3D/lus_gbi.h
+332 −0 src/graphic/Fast3D/shaders/directx/default.shader.hlsl
+284 −0 src/graphic/Fast3D/shaders/metal/default.shader.metal
+210 −0 src/graphic/Fast3D/shaders/opengl/default.shader.fs
+79 −0 src/graphic/Fast3D/shaders/opengl/default.shader.vs
+19 −0 src/public/bridge/audiobridge.cpp
+4 −0 src/public/bridge/audiobridge.h
+6 −6 src/public/bridge/resourcebridge.cpp
+3 −2 src/public/bridge/resourcebridge.h
+9 −2 src/public/libultra/os.cpp
+0 −1 src/resource/File.h
+4 −2 src/resource/ResourceFactory.h
+4 −3 src/resource/ResourceFactoryBinary.cpp
+2 −1 src/resource/ResourceFactoryBinary.h
+4 −4 src/resource/ResourceFactoryXML.cpp
+2 −1 src/resource/ResourceFactoryXML.h
+199 −7 src/resource/ResourceLoader.cpp
+17 −1 src/resource/ResourceLoader.h
+9 −11 src/resource/ResourceManager.cpp
+3 −4 src/resource/ResourceManager.h
+3 −2 src/resource/ResourceType.h
+4 −209 src/resource/archive/Archive.cpp
+2 −17 src/resource/archive/Archive.h
+4 −5 src/resource/archive/ArchiveManager.cpp
+2 −2 src/resource/archive/ArchiveManager.h
+3 −3 src/resource/archive/O2rArchive.cpp
+2 −3 src/resource/archive/O2rArchive.h
+4 −4 src/resource/archive/OtrArchive.cpp
+2 −3 src/resource/archive/OtrArchive.h
+5 −3 src/resource/factory/BlobFactory.cpp
+2 −1 src/resource/factory/BlobFactory.h
+28 −8 src/resource/factory/DisplayListFactory.cpp
+4 −2 src/resource/factory/DisplayListFactory.h
+4 −3 src/resource/factory/JsonFactory.cpp
+2 −1 src/resource/factory/JsonFactory.h
+5 −3 src/resource/factory/LightFactory.cpp
+2 −1 src/resource/factory/LightFactory.h
+5 −3 src/resource/factory/MatrixFactory.cpp
+2 −1 src/resource/factory/MatrixFactory.h
+18 −0 src/resource/factory/ShaderFactory.cpp
+13 −0 src/resource/factory/ShaderFactory.h
+10 −6 src/resource/factory/TextureFactory.cpp
+4 −2 src/resource/factory/TextureFactory.h
+10 −6 src/resource/factory/VertexFactory.cpp
+4 −2 src/resource/factory/VertexFactory.h
+14 −0 src/resource/type/Shader.cpp
+17 −0 src/resource/type/Shader.h
+1 −0 src/resource/type/Texture.h
+12 −0 src/utils/macUtils.h
+28 −0 src/utils/macUtils.mm
+4 −3 src/window/gui/resource/FontFactory.cpp
+2 −1 src/window/gui/resource/FontFactory.h
+5 −3 src/window/gui/resource/GuiTextureFactory.cpp
+2 −1 src/window/gui/resource/GuiTextureFactory.h
1 change: 1 addition & 0 deletions soh/assets/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.vtx.inc
*.dlist.inc
!*.png
custom/shaders
4 changes: 4 additions & 0 deletions soh/include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
// #define __attribute__(x)
// #endif

// this was removed from the LUS rcp.h in https://github.com/Kenix3/libultraship/pull/833/
// it is still used in graph.c and fault.c
#define HW_REG(reg, type) *(volatile type*)((reg) | 0xA0000000)

// SoH [Port] Always use the AVOID_UB version (we don't set AVOID_UB while building yet)
/*
#ifndef AVOID_UB
Expand Down
22 changes: 22 additions & 0 deletions soh/soh/Enhancements/AssignableTunicsAndBoots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,28 @@ void RegisterAssignableTunicsBoots() {
}
});

// don't throw items when the pressed button is a tunic or boots
COND_VB_SHOULD(VB_THROW_OR_PUT_DOWN_HELD_ITEM, CVAR_TUNICBOOTS_VALUE != CVAR_TUNICBOOTS_DEFAULT, {
// if the vanilla condition doesn't want us to throw/put down the item, early return
if (!*should) {
return;
}

Input* input = va_arg(args, Input*);

s32 item = ITEM_NONE;
for (s32 i = 0; i < ARRAY_COUNT(sItemButtons); i++) {
if (CHECK_BTN_ALL(input->press.button, sItemButtons[i])) {
item = Player_GetItemOnButton(gPlayState, i);
break;
}
}

if (item >= ITEM_TUNIC_KOKIRI && item <= ITEM_BOOTS_HOVER) {
*should = false;
}
});

// do something when the player presses a button to use the tunics/boots
COND_VB_SHOULD(VB_EXECUTE_PLAYER_ACTION_FUNC, CVAR_TUNICBOOTS_VALUE != CVAR_TUNICBOOTS_DEFAULT, {
// if the vanilla condition doesn't want us to run the actionFunc, don't do any of this
Expand Down
Loading