-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Bearborg/photo-mode
Add Photo Mode
- Loading branch information
Showing
12 changed files
with
313 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#include "prime/Math.hpp" | ||
|
||
class CActorMP1 { | ||
public: | ||
CTransform4f& GetTransform() const; | ||
CTransform4f SetTransform(const CTransform4f& transform); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma once | ||
|
||
#include "program/GetField.hpp" | ||
#include "prime/CActorMP1.hpp" | ||
|
||
class CStateManager; | ||
|
||
class CGameCamera : public CActorMP1 {}; | ||
|
||
class CGameCameraMP1: public CGameCamera { | ||
public: | ||
inline float* GetCurrentFOV() { | ||
return GetField<float>(this, 0x25c); | ||
}; | ||
void UpdateFOV(float dt); | ||
}; | ||
|
||
class CFirstPersonCameraMP1 : public CGameCameraMP1 { | ||
public: | ||
void Think(float, CStateManager&); | ||
}; | ||
|
||
class CCameraManagerMP1 { | ||
public: | ||
static float GetDefaultFirstPersonVerticalFOV(); | ||
}; | ||
|
||
class STonemapParams { | ||
public: | ||
inline float* inverseExposure() { return GetField<float>(this, 0x0); }; | ||
}; | ||
|
||
namespace NTonemap { | ||
void build_tonemap_eval_params(STonemapParams const&); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
#pragma once | ||
|
||
namespace rstl { | ||
template <class T, typename storage, T val> | ||
struct enum_bit_field; | ||
}; | ||
|
||
class CStateManager; | ||
|
||
class CGuiCamera; | ||
|
||
class CAutoMapperMP1 { | ||
public: | ||
void Update(float f1, const CStateManager &csm, const CGuiCamera& cgc, float f2, bool b1); | ||
}; | ||
|
||
|
||
class CSamusHudMP1 { | ||
public: | ||
enum class EHudDrawFilter : uint32_t; | ||
|
||
void Draw(const CStateManager &stateManager, float alpha, uint32_t param_3, const rstl::enum_bit_field<CSamusHudMP1::EHudDrawFilter, unsigned int, (CSamusHudMP1::EHudDrawFilter)3> &hudDrawFilterFlags) const; | ||
void DrawHelmet(const CStateManager& stateManager, float camYOffset) const; | ||
void DrawTargetingReticle(const CStateManager&) const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#include "PhotoModeMenu.hpp" | ||
#include "patches.hpp" | ||
#include "imgui.h" | ||
|
||
#define REQ_CONFIG_IF(cond, ...) \ | ||
{ \ | ||
if (cond) { \ | ||
PATCH_CONFIG.RequestConfigSave(); \ | ||
__VA_ARGS__ \ | ||
} \ | ||
} | ||
|
||
namespace GUI { | ||
bool is_time_stopped = false; | ||
const float defaultFirstPersonFov = CCameraManagerMP1::GetDefaultFirstPersonVerticalFOV(); | ||
float verticalFov = defaultFirstPersonFov; | ||
bool shouldUpdateVerticalFov = false; | ||
float viewRoll = 0.f; | ||
CGameCameraMP1* fpCamera = nullptr; | ||
float exposure; | ||
|
||
const bool shouldHideAll() { | ||
return PATCH_CONFIG.hide_hud_when_time_stopped && is_time_stopped; | ||
} | ||
|
||
void drawPhotoModeMenu() { | ||
if (ImGui::TreeNode("Photo Mode")) { | ||
REQ_CONFIG_IF(ImGui::Checkbox("Stop time (left stick + L)", &PATCH_CONFIG.enable_stop_time)); | ||
REQ_CONFIG_IF(ImGui::Checkbox("Hide arm cannon", &PATCH_CONFIG.hide_cannon)); | ||
REQ_CONFIG_IF(ImGui::Checkbox("Hide HUD", &PATCH_CONFIG.hide_hud)); | ||
REQ_CONFIG_IF(ImGui::Checkbox("Auto-hide HUD & cannon when time stopped", &PATCH_CONFIG.hide_hud_when_time_stopped)); | ||
|
||
// NOT SAVED | ||
// Vertical FOV | ||
ImGui::PushID("VerticalFOV"); | ||
if (ImGui::DragFloat("", &verticalFov, 1.0, 1.0, 170.f, "%.2f")) { | ||
shouldUpdateVerticalFov = true; | ||
} | ||
ImGui::SameLine(); | ||
if (ImGui::Button("Reset")) { | ||
verticalFov = defaultFirstPersonFov; | ||
shouldUpdateVerticalFov = true; | ||
} | ||
ImGui::SameLine(); | ||
ImGui::Text("Vertical FOV"); | ||
ImGui::PopID(); | ||
|
||
// View Roll | ||
ImGui::PushID("ViewRoll"); | ||
ImGui::DragFloat("", &viewRoll, 1.0, -90.f, 90.f, "%.2f"); | ||
ImGui::SameLine(); | ||
if (ImGui::Button("Reset")) { | ||
viewRoll = 0.f; | ||
} | ||
ImGui::SameLine(); | ||
ImGui::Text("View Roll"); | ||
ImGui::PopID(); | ||
|
||
// Exposure | ||
ImGui::PushID("Exposure"); | ||
ImGui::DragFloat("", &exposure, 0.1, -2.5, 2.5, "%.2f"); | ||
ImGui::SameLine(); | ||
if (ImGui::Button("Reset")) { | ||
exposure = 0.f; | ||
} | ||
ImGui::SameLine(); | ||
ImGui::Text("Exposure"); | ||
ImGui::PopID(); | ||
|
||
ImGui::TreePop(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include "prime/Math.hpp" | ||
#include "prime/CFirstPersonCamera.hpp" | ||
|
||
namespace GUI { | ||
extern bool is_time_stopped; | ||
extern float verticalFov; | ||
extern bool shouldUpdateVerticalFov; | ||
extern float viewRoll; | ||
extern CGameCameraMP1* fpCamera; | ||
extern float exposure; | ||
|
||
const bool shouldHideAll(); | ||
void drawPhotoModeMenu(); | ||
} // namespace GUI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.