mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp
synced 2026-07-08 22:45:03 -04:00
Added mechanism for getting aspect ratio from recompiled code, fixed wipe3 transition in widescreen
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "recomp_input.h"
|
||||
#include "../ultramodern/ultramodern.hpp"
|
||||
#include "../patches/input.h"
|
||||
#include "../patches/graphics.h"
|
||||
|
||||
// Arrays that hold the mappings for every input for keyboard and controller respectively.
|
||||
using input_mapping = std::array<recomp::InputField, recomp::bindings_per_input>;
|
||||
@@ -127,3 +128,11 @@ extern "C" void recomp_get_gyro_deltas(uint8_t* rdram, recomp_context* ctx) {
|
||||
|
||||
recomp::get_gyro_deltas(x_out, y_out);
|
||||
}
|
||||
|
||||
#include "recomp_ui.h"
|
||||
extern "C" void recomp_get_aspect_ratio(uint8_t* rdram, recomp_context* ctx) {
|
||||
int width, height;
|
||||
recomp::get_window_size(width, height);
|
||||
|
||||
_return(ctx, static_cast<float>(width) / height);
|
||||
}
|
||||
|
||||
@@ -877,6 +877,10 @@ struct {
|
||||
// TODO make this not be global
|
||||
extern SDL_Window* window;
|
||||
|
||||
void recomp::get_window_size(int& width, int& height) {
|
||||
SDL_GetWindowSizeInPixels(window, &width, &height);
|
||||
}
|
||||
|
||||
void init_hook(RT64::RenderInterface* interface, RT64::RenderDevice* device) {
|
||||
printf("RT64 hook init\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user