-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
205 additions
and
140 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "game_api.hpp" | ||
|
||
#include "search.hpp" | ||
|
||
GameAPI* GameAPI::get() | ||
{ | ||
using GetGameAPI = GameAPI*(); | ||
static auto addr = (GetGameAPI*)get_address("get_game_api"); | ||
return addr(); | ||
} | ||
|
||
float GameAPI::get_current_zoom() | ||
{ | ||
return renderer->current_zoom + renderer->current_zoom_offset; | ||
} | ||
|
||
float GameAPI::get_target_zoom() | ||
{ | ||
return renderer->target_zoom + renderer->target_zoom_offset; | ||
} | ||
|
||
void GameAPI::set_zoom(std::optional<float> current, std::optional<float> target) | ||
{ | ||
if (current.has_value()) | ||
{ | ||
renderer->current_zoom = current.value(); // - renderer->current_zoom_offset; | ||
} | ||
if (target.has_value()) | ||
{ | ||
renderer->target_zoom = target.value(); // - renderer->target_zoom_offset; | ||
} | ||
} |
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,72 @@ | ||
#pragma once | ||
|
||
#include <cstddef> | ||
#include <cstdint> | ||
#include <optional> | ||
|
||
struct Renderer | ||
{ | ||
uint32_t render_width; // sam as window size unless resolution scale is set | ||
uint32_t render_height; | ||
|
||
uint32_t fps; // changing it doesn't seam to do anything | ||
uint32_t fps_denominator; | ||
|
||
uint32_t render_width2; // repeat | ||
uint32_t render_height2; | ||
|
||
uint8_t flags1; | ||
uint8_t flags2; | ||
uint8_t padding[6]; | ||
|
||
uint8_t skip[0x1228]; // tons of pointers | ||
|
||
uint8_t skip2[0x7F284]; // a lot of nothing | ||
|
||
float current_zoom; | ||
float target_zoom; | ||
float target_zoom_offset; | ||
float current_zoom_offset; | ||
float backlayer_light_level; // constantly overwritten by theme virtual get_backlayer_light_level | ||
uint8_t unknown2; | ||
uint8_t unknown3; | ||
uint16_t unknown4; | ||
|
||
uint8_t skip3[0xAE4]; | ||
|
||
size_t swap_chain; | ||
|
||
// somewhere there should be shareds stored | ||
|
||
// added just to have the vtable | ||
virtual ~Renderer() = 0; | ||
virtual void some_dx_stuff() = 0; // it actually has a ton of parameters | ||
}; | ||
|
||
struct GameAPI // size 0x60 | ||
{ | ||
static GameAPI* get(); | ||
|
||
float get_current_zoom(); | ||
float get_target_zoom(); | ||
|
||
void set_zoom(std::optional<float> current, std::optional<float> target); | ||
|
||
bool unknown1; | ||
size_t unknown2; // pointer | ||
Renderer* renderer; | ||
uint32_t window_width; | ||
uint32_t window_height; | ||
|
||
size_t unknown5; // garbage? | ||
size_t unknown6; // exe start | ||
size_t unknown7; // some offset | ||
size_t unknown8; // garbage? | ||
size_t SteamAPI_Callback; // just vtable? don't know much about steam stuff | ||
|
||
uint8_t unknown10a; // bool ? | ||
uint32_t unknown10b; | ||
|
||
size_t unknown11; // garbage? | ||
size_t unknown12; // garbage? | ||
}; |
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
Oops, something went wrong.