From e59a0408cf5bed04473a23fb44f7e3913f5688d6 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 26 Jul 2016 21:19:32 -0700 Subject: [PATCH 1/2] WIP Tweak RE --- DataSpec/DNAMP1/Tweaks/CTweakGame.hpp | 50 +++---- Runtime/CMakeLists.txt | 1 + Runtime/ITweak.hpp | 13 ++ Runtime/MP1/CMakeLists.txt | 1 + Runtime/MP1/Tweaks/CTweakPlayer.cpp | 182 +++++++++++++++++++++++ Runtime/MP1/Tweaks/CTweakPlayer.hpp | 202 ++++++++++++++++++++++++++ 6 files changed, 424 insertions(+), 25 deletions(-) create mode 100644 Runtime/ITweak.hpp create mode 100644 Runtime/MP1/Tweaks/CTweakPlayer.cpp create mode 100644 Runtime/MP1/Tweaks/CTweakPlayer.hpp diff --git a/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp b/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp index ea5f4318e..8abca5fba 100644 --- a/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp +++ b/DataSpec/DNAMP1/Tweaks/CTweakGame.hpp @@ -11,32 +11,32 @@ namespace DNAMP1 struct CTweakGame : ITweakGame { DECL_YAML - String<-1> m_worldPrefix; - String<-1> m_ruinsArea; // ???? - Value m_fov; - Value unknown1; - Value unknown2; - Value unknown3; - Value unknown4; - Value unknown5; - Value unknown6; - Value unknown7; - Value unknown8; - Value unknown9; - Value unknown10; - Value unknown11; - Value unknown12; - Value unknown13; - Value unknown14; - Value unknown15; - Value unknown16; - Value unknown17; - Value unknown18; - Value hardmodeDamageMult; - Value hardmodeWeaponMult; + String<-1> x4_worldPrefix; + String<-1> x14_ruinsArea; // ???? + Value x24_fov; + Value x28_unknown1; + Value x29_unknown2; + Value x2a_unknown3; + Value x2b_unknown4; + Value x2c_cunknown5; + Value x30_unknown6; + Value x34_unknown7; + Value x38_unknown8; + Value x3c_unknown9; + Value x40_unknown10; + Value x44_unknown11; + Value x48_unknown12; + Value x4c_unknown13; + Value x50_unknown14; + Value x54_unknown15; + Value x58_unknown16; + Value x5c_unknown17; + Value x60_unknown18; + Value x64_hardmodeDamageMult; + Value x68_hardmodeWeaponMult; - virtual const std::string& GetWorldPrefix() const { return m_worldPrefix; } - CTweakGame(athena::io::IStreamReader& in) { this->read(in); } + virtual const std::string& GetWorldPrefix() const { return x4_worldPrefix; } + CTweakGame(athena::io::IStreamReader& in) { this->read(in); x2b_unknown4 = false; } }; } } diff --git a/Runtime/CMakeLists.txt b/Runtime/CMakeLists.txt index cdbb3b03a..91a5f7748 100644 --- a/Runtime/CMakeLists.txt +++ b/Runtime/CMakeLists.txt @@ -46,6 +46,7 @@ add_library(RuntimeCommon ${PARTICLE_SOURCES} ${WORLD_SOURCES} #CMemory.hpp CMemory.cpp + ITweak.hpp CMemoryCardSys.hpp CSaveWorld.hpp CSaveWorld.cpp IAllocator.hpp IAllocator.cpp diff --git a/Runtime/ITweak.hpp b/Runtime/ITweak.hpp new file mode 100644 index 000000000..ffb8bade8 --- /dev/null +++ b/Runtime/ITweak.hpp @@ -0,0 +1,13 @@ +#ifndef __URDE_ITWEAK_HPP__ +#define __URDE_ITWEAK_HPP__ + +namespace urde +{ +class ITweak +{ +public: + virtual ~ITweak() {} +}; +} + +#endif // __URDE_ITWEAK_HPP__ diff --git a/Runtime/MP1/CMakeLists.txt b/Runtime/MP1/CMakeLists.txt index 52c4bde4a..f61730c3a 100644 --- a/Runtime/MP1/CMakeLists.txt +++ b/Runtime/MP1/CMakeLists.txt @@ -2,6 +2,7 @@ include_directories(. ..) set(MP1_SOURCES CTweaks.hpp CTweaks.cpp CInGameTweakManager.hpp CInGameTweakManager.cpp + Tweaks/CTweakPlayer.hpp Tweaks/CTweakPlayer.cpp CMainFlow.hpp CMainFlow.cpp CMFGame.hpp CMFGame.cpp CPlayMovie.hpp CPlayMovie.cpp diff --git a/Runtime/MP1/Tweaks/CTweakPlayer.cpp b/Runtime/MP1/Tweaks/CTweakPlayer.cpp new file mode 100644 index 000000000..147db90fd --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakPlayer.cpp @@ -0,0 +1,182 @@ +#include "CTweakPlayer.hpp" +#include "zeus/Math.hpp" + +namespace urde +{ +namespace MP1 +{ +CTweakPlayer::CTweakPlayer(urde::CInputStream& in) +{ + for (u32 i = 0 ; i<8 ; ++i) + x4_[i] = in.readFloatBig(); + for (u32 i = 0 ; i<8 ; ++i) + x24_[i] = in.readFloatBig(); + for (u32 i = 0 ; i<8 ; ++i) + x44_[i] = in.readFloatBig(); + for (u32 i = 0 ; i<8 ; ++i) + x64_[i] = in.readFloatBig(); + for (u32 i = 0 ; i<8 ; ++i) + x84_[i] = in.readFloatBig(); + for (u32 i = 0 ; i<8 ; ++i) + xa4_[i] = in.readFloatBig(); + xc4_ = in.readFloatBig(); + xc8_ = in.readFloatBig(); + xcc_ = in.readFloatBig(); + xd0_ = in.readFloatBig(); + xd4_ = in.readFloatBig(); + xd8_ = in.readFloatBig(); + xdc_ = in.readFloatBig(); + xe0_ = in.readFloatBig(); + xe4_ = in.readFloatBig(); + xe8_ = in.readFloatBig(); + xec_ = in.readFloatBig(); + xf0_ = in.readFloatBig(); + xf4_ = in.readFloatBig(); + xf8_ = in.readFloatBig(); + xfc_ = in.readFloatBig(); + x100_ = in.readFloatBig(); + x104_ = in.readFloatBig(); + x108_ = in.readFloatBig(); + x10c_ = in.readFloatBig(); + x11c_ = in.readFloatBig(); + x120_ = in.readFloatBig(); + x124_ = in.readFloatBig(); + x128_ = in.readFloatBig(); + x12c_ = in.readFloatBig(); + x130_ = zeus::degToRad(in.readFloatBig()); + x134_ = zeus::degToRad(in.readFloatBig()); + x138_ = zeus::degToRad(in.readFloatBig()); + x13c_ = zeus::degToRad(in.readFloatBig()); + x140_ = zeus::degToRad(in.readFloatBig()); + x144_ = zeus::degToRad(in.readFloatBig()); + x148_ = in.readFloatBig(); + x14c_ = in.readFloatBig(); + x150_ = in.readFloatBig(); + x228_24_ = in.readBool(); + x228_25_ = in.readBool(); + x228_26_ = in.readBool(); + x228_27_ = in.readBool(); + x228_28_ = in.readBool(); + x228_29_ = in.readBool(); + x228_30_ = in.readBool(); + x228_31_ = in.readBool(); + x229_24_ = in.readBool(); + x229_25_ = in.readBool(); + x229_26_ = in.readBool(); + x229_27_ = in.readBool(); + x229_28_ = in.readBool(); + x229_29_ = in.readBool(); + x229_30_ = in.readBool(); + x229_31_ = in.readBool(); + x22a_24_ = in.readBool(); + x22a_25_ = in.readBool(); + x22a_26_ = in.readBool(); + x22a_27_ = in.readBool(); + x22a_28_ = in.readBool(); + x22c_ = in.readFloatBig(); + x230_ = in.readFloatBig(); + x234_ = in.readFloatBig(); + x238_ = zeus::degToRad(in.readFloatBig()); + x23c_ = zeus::degToRad(in.readFloatBig()); + x240_ = zeus::degToRad(in.readFloatBig()); + x244_ = zeus::degToRad(in.readFloatBig()); + x248_ = zeus::degToRad(in.readFloatBig()); + x24c_ = in.readFloatBig(); + x250_ = zeus::degToRad(in.readFloatBig()); + x254_ = in.readFloatBig(); + x258_ = in.readFloatBig(); + x25c_ = in.readFloatBig(); + x260_ = in.readFloatBig(); + x264_ = zeus::degToRad(in.readFloatBig()); + for (u32 i = 0 ; i<3 ; ++i) + { + x158_[i] = in.readFloatBig(); + x164_[i] = in.readFloatBig(); + x170_[i] = in.readFloatBig(); + } + x17c_ = zeus::degToRad(in.readFloatBig()); + x180_ = in.readFloatBig(); + x184_ = zeus::degToRad(in.readFloatBig()); + x188_ = zeus::degToRad(in.readFloatBig()); + x18c_ = zeus::degToRad(in.readFloatBig()); + x190_ = zeus::degToRad(in.readFloatBig()); + x194_ = zeus::degToRad(in.readFloatBig()); + x198_ = zeus::degToRad(in.readFloatBig()); + x19c_ = in.readFloatBig(); + x1a0_ = in.readFloatBig(); + x1a4_ = in.readFloatBig(); + for (u32 i = 0 ; i<2 ; ++i) + { + x1a8_[i] = in.readUint32Big(); + x1b0_[i] = in.readUint32Big(); + x1b8_[i] = in.readUint32Big(); + x1c0_[i] = in.readUint32Big(); + x1c8_[i] = in.readUint32Big(); + } + + x1d8_ = in.readFloatBig(); + x1dc_ = in.readFloatBig(); + x1e0_ = in.readFloatBig(); + x1e4_ = in.readFloatBig(); + x1e8_ = in.readFloatBig(); + x1ec_ = in.readFloatBig(); + x1f0_ = zeus::degToRad(in.readFloatBig()); + x1f4_ = zeus::degToRad(in.readFloatBig()); + x1f8_ = in.readFloatBig(); + x1fc_ = in.readFloatBig(); + x200_24_ = in.readBool(); + x200_25_ = in.readBool(); + x204_ = in.readFloatBig(); + x208_ = in.readFloatBig(); + x20c_ = in.readFloatBig(); + x210_ = in.readFloatBig(); + x214_ = in.readFloatBig(); + x218_ = in.readFloatBig(); + x21c_24_ = in.readBool(); + x21c_25_ = in.readBool(); + x220_ = in.readFloatBig(); + x224_ = in.readFloatBig(); + x2a0_ = in.readFloatBig(); + x2a4_ = in.readFloatBig(); + x2a8_ = in.readFloatBig(); + x2ac_ = in.readFloatBig(); + x2b0_ = zeus::degToRad(in.readFloatBig()); + x2b4_ = in.readFloatBig(); + x2b8_ = in.readFloatBig(); + x2bc_ = in.readFloatBig(); + x2c0_ = zeus::degToRad(in.readFloatBig()); + x2c4_ = in.readFloatBig(); + x2c8_ = in.readFloatBig(); + x2cc_ = in.readFloatBig(); + x2d0_ = in.readUint32Big(); + x2d4_ = in.readBool(); + x2d5_ = in.readBool(); + x2d8_ = in.readFloatBig(); + x2dc_ = in.readFloatBig(); + x2e0_ = in.readFloatBig(); + x2e4_ = in.readFloatBig(); + x26c_ = in.readFloatBig(); + x270_ = in.readFloatBig(); + x274_ = in.readFloatBig(); + x278_ = in.readFloatBig(); + x27c_ = in.readFloatBig(); + x280_ = zeus::degToRad(in.readFloatBig()); + x284_ = zeus::degToRad(in.readFloatBig()); + x288_ = in.readFloatBig(); + x28c_ = in.readFloatBig(); + x290_ = zeus::degToRad(in.readFloatBig()); + x294_ = in.readFloatBig(); + x298_ = in.readFloatBig(); + x29c_ = zeus::degToRad(in.readFloatBig()); + x2e8_ = in.readFloatBig(); + x2ec_ = in.readFloatBig(); + x2f0_ = in.readFloatBig(); + x2f4_ = in.readBool(); + x2f8_ = in.readFloatBig(); + x2fc_ = in.readFloatBig(); + x300_ = in.readFloatBig(); + x304_ = in.readFloatBig(); + x308_ = in.readFloatBig(); +} +} +} diff --git a/Runtime/MP1/Tweaks/CTweakPlayer.hpp b/Runtime/MP1/Tweaks/CTweakPlayer.hpp new file mode 100644 index 000000000..10dba65c2 --- /dev/null +++ b/Runtime/MP1/Tweaks/CTweakPlayer.hpp @@ -0,0 +1,202 @@ +#ifndef __URDE_MP1_CTWEAKPLAYER_HPP__ +#define __URDE_MP1_CTWEAKPLAYER_HPP__ + +#include "RetroTypes.hpp" +#include "ITweak.hpp" +namespace urde +{ +namespace MP1 +{ +class CTweakPlayer : public ITweak +{ + float x4_[8]; + float x24_[8]; + float x44_[8]; + float x64_[8]; + float x84_[8]; + float xa4_[8]; + float xc4_; + float xc8_; + float xcc_; + float xd0_; + float xd4_; + float xd8_; + float xdc_; + float xe0_; + float xe4_; + float xe8_; + float xec_; + float xf0_; + float xf4_; + float xf8_; + float xfc_; + float x100_; + float x104_; + float x108_; + float x10c_; + float x110_; + float x114_; + float x118_; + float x11c_; + float x120_; + float x124_; + float x128_; + float x12c_; + float x130_; + float x134_; + float x138_; + float x13c_; + float x140_; + float x144_; + float x148_; + float x14c_; + float x150_; + float x154_; + float x158_[3]; + float x164_[3]; + float x170_[3]; + float x17c_; + float x180_; + float x184_; + float x188_; + float x18c_; + float x190_; + float x194_; + float x198_; + float x19c_; + float x1a0_; + float x1a4_; + u32 x1a8_[2]; + u32 x1b0_[2]; + u32 x1b8_[2]; + u32 x1c0_[2]; + u32 x1c8_[2]; + u32 x1d0_[2]; + float x1d8_; + float x1dc_; + float x1e0_; + float x1e4_; + float x1e8_; + float x1ec_; + float x1f0_; + float x1f4_; + float x1f8_; + float x1fc_; + union + { + struct + { + bool x200_24_ : 1; + bool x200_25_ : 1; + }; + u8 _dummy1 = 0; + }; + float x204_; + float x208_; + float x20c_; + float x210_; + float x214_; + float x218_; + union + { + struct + { + bool x21c_24_ : 1; + bool x21c_25_ : 1; + }; + u8 _dummy2 = 0; + }; + float x220_; + float x224_; + union + { + struct + { + bool x228_24_ : 1; + bool x228_25_ : 1; + bool x228_26_ : 1; + bool x228_27_ : 1; + bool x228_28_ : 1; + bool x228_29_ : 1; + bool x228_30_ : 1; + bool x228_31_ : 1; + bool x229_24_ : 1; + bool x229_25_ : 1; + bool x229_26_ : 1; + bool x229_27_ : 1; + bool x229_28_ : 1; + bool x229_29_ : 1; + bool x229_30_ : 1; + bool x229_31_ : 1; + bool x22a_24_ : 1; + bool x22a_25_ : 1; + bool x22a_26_ : 1; + bool x22a_27_ : 1; + bool x22a_28_ : 1; + }; + u32 _dummy3 = 0; + }; + float x22c_; + float x230_; + float x234_; + float x238_; + float x23c_; + float x240_; + float x244_; + float x248_; + float x24c_; + float x250_; + float x254_; + float x258_; + float x25c_; + float x260_; + float x264_; + float x268_; + float x26c_; + float x270_; + float x274_; + float x278_; + float x27c_; + float x280_; + float x284_; + float x288_; + float x28c_; + float x290_; + float x294_; + float x298_; + float x29c_; + float x2a0_; + float x2a4_; + float x2a8_; + float x2ac_; + float x2b0_; + float x2b4_; + float x2b8_; + float x2bc_; + float x2c0_; + float x2c4_; + float x2c8_; + float x2cc_; + u32 x2d0_; + bool x2d4_; + bool x2d5_; + float x2d8_; + float x2dc_; + float x2e0_; + float x2e4_; + float x2e8_; + float x2ec_; + float x2f0_; + bool x2f4_; + float x2f8_; + u32 x2fc_; + float x300_; + float x304_; + float x308_; +public: + CTweakPlayer(CInputStream&); + virtual ~CTweakPlayer() {} +}; +} +} +#endif // __URDE_MP1_CTWEAKPLAYER_HPP__ From bf7b8fcec93df5e22c5487742e1a00a71632b53c Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 26 Jul 2016 20:11:02 -1000 Subject: [PATCH 2/2] Graphics bug fixes --- Editor/ViewManager.cpp | 1 + Runtime/Graphics/Shaders/CLineRendererShadersMetal.cpp | 2 +- Runtime/Graphics/Shaders/CThermalColdFilterGLSL.cpp | 2 +- hecl | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index 6884317a4..e64aeb337 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -377,6 +377,7 @@ void ViewManager::stop() { m_videoVoice.reset(); m_projManager.shutdown(); + TShader::Shutdown(); CElementGen::Shutdown(); CMoviePlayer::Shutdown(); CLineRenderer::Shutdown(); diff --git a/Runtime/Graphics/Shaders/CLineRendererShadersMetal.cpp b/Runtime/Graphics/Shaders/CLineRendererShadersMetal.cpp index 7994777a3..8031536d9 100644 --- a/Runtime/Graphics/Shaders/CLineRendererShadersMetal.cpp +++ b/Runtime/Graphics/Shaders/CLineRendererShadersMetal.cpp @@ -1,5 +1,5 @@ #include "CLineRendererShaders.hpp" -#include "CLineRenderer.hpp" +#include "Graphics/CLineRenderer.hpp" #if BOO_HAS_METAL namespace urde diff --git a/Runtime/Graphics/Shaders/CThermalColdFilterGLSL.cpp b/Runtime/Graphics/Shaders/CThermalColdFilterGLSL.cpp index 3bffbcc0f..05988b307 100644 --- a/Runtime/Graphics/Shaders/CThermalColdFilterGLSL.cpp +++ b/Runtime/Graphics/Shaders/CThermalColdFilterGLSL.cpp @@ -90,7 +90,7 @@ struct CThermalColdFilterGLDataBindingFactory : TShader::IDa boo::PipelineStage stages[] = {boo::PipelineStage::Vertex}; boo::ITexture* texs[] = {CGraphics::g_SpareTexture, filter.m_shiftTex}; return cctx.newShaderDataBinding(TShader::m_pipeline, - ctx.newVertexFormat(3, VtxVmt), filter.m_vbo, nullptr, nullptr, + ctx.newVertexFormat(2, VtxVmt), filter.m_vbo, nullptr, nullptr, 1, bufs, stages, nullptr, nullptr, 2, texs); } }; diff --git a/hecl b/hecl index ba0684b91..3e5c8a799 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit ba0684b9153beb9d098a87b048ec642f289b0ed5 +Subproject commit 3e5c8a7992c4ada055034194687f6f7b7c6b5d72