mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
not sure why this isn't working
This commit is contained in:
parent
c023cc7d15
commit
47238c0b90
3 changed files with 17 additions and 12 deletions
|
@ -60,8 +60,7 @@ using namespace std;
|
|||
#define SCALE_3_8(VAL_) ((VAL_) * 0x24)
|
||||
#define SCALE_8_3(VAL_) ((VAL_) / 0x24)
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
// SCREEN_WIDTH and SCREEN_HEIGHT are defined in the headerfile
|
||||
#define HALF_SCREEN_WIDTH (SCREEN_WIDTH / 2)
|
||||
#define HALF_SCREEN_HEIGHT (SCREEN_HEIGHT / 2)
|
||||
|
||||
|
@ -2662,15 +2661,15 @@ void gfx_get_dimensions(uint32_t *width, uint32_t *height) {
|
|||
gfx_wapi->get_dimensions(width, height);
|
||||
}
|
||||
|
||||
void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *game_name, bool start_in_fullscreen) {
|
||||
void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, const char *game_name, bool start_in_fullscreen, uint32_t screen_width, uint32_t screen_height) {
|
||||
gfx_wapi = wapi;
|
||||
gfx_rapi = rapi;
|
||||
gfx_wapi->init(game_name, start_in_fullscreen);
|
||||
gfx_rapi->init();
|
||||
gfx_rapi->update_framebuffer_parameters(0, SCREEN_WIDTH, SCREEN_HEIGHT, 1, false, true, true, true);
|
||||
gfx_rapi->update_framebuffer_parameters(0, screen_width, screen_height, 1, false, true, true, true);
|
||||
gfx_current_dimensions.internal_mul = 1;
|
||||
gfx_current_dimensions.width = SCREEN_WIDTH;
|
||||
gfx_current_dimensions.height = SCREEN_HEIGHT;
|
||||
gfx_current_dimensions.width = screen_width;
|
||||
gfx_current_dimensions.height = screen_height;
|
||||
game_framebuffer = gfx_rapi->create_framebuffer();
|
||||
game_framebuffer_msaa_resolved = gfx_rapi->create_framebuffer();
|
||||
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
#include "U64/PR/ultra64/types.h"
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
|
||||
struct GfxRenderingAPI;
|
||||
struct GfxWindowManagerAPI;
|
||||
|
||||
|
@ -62,7 +65,7 @@ extern uint32_t gfx_msaa_level;
|
|||
|
||||
}
|
||||
|
||||
void gfx_init(struct GfxWindowManagerAPI* wapi, struct GfxRenderingAPI* rapi, const char* game_name, bool start_in_fullscreen);
|
||||
void gfx_init(struct GfxWindowManagerAPI* wapi, struct GfxRenderingAPI* rapi, const char* game_name, bool start_in_fullscreen, uint32_t screen_width = SCREEN_WIDTH, uint32_t screen_height = SCREEN_HEIGHT);
|
||||
struct GfxRenderingAPI* gfx_get_current_rendering_api(void);
|
||||
void gfx_start_frame(void);
|
||||
void gfx_run(Gfx* commands, const std::unordered_map<Mtx*, MtxF>& mtx_replacements);
|
||||
|
|
|
@ -264,15 +264,18 @@ namespace Ship {
|
|||
|
||||
SetAudioPlayer();
|
||||
bIsFullscreen = Ship::stob(Conf["WINDOW"]["FULLSCREEN"]);
|
||||
dwWidth = Ship::stoi(Conf["WINDOW"]["WINDOW WIDTH"], 320);
|
||||
dwHeight = Ship::stoi(Conf["WINDOW"]["WINDOW HEIGHT"], 240);
|
||||
dwWidth = Ship::stoi(Conf["WINDOW"]["FULLSCREEN WIDTH"], 1920);
|
||||
dwHeight = Ship::stoi(Conf["WINDOW"]["FULLSCREEN HEIGHT"], 1080);
|
||||
if (bIsFullscreen) {
|
||||
dwWidth = Ship::stoi(Conf["WINDOW"]["FULLSCREEN WIDTH"], 1920);
|
||||
dwHeight = Ship::stoi(Conf["WINDOW"]["FULLSCREEN HEIGHT"], 1080);
|
||||
} else {
|
||||
dwWidth = Ship::stoi(Conf["WINDOW"]["WINDOW WIDTH"], 320);
|
||||
dwHeight = Ship::stoi(Conf["WINDOW"]["WINDOW HEIGHT"], 240);
|
||||
}
|
||||
dwMenubar = Ship::stoi(Conf["WINDOW"]["menubar"], 0);
|
||||
const std::string& gfx_backend = Conf["WINDOW"]["GFX BACKEND"];
|
||||
SetWindowManager(&WmApi, &RenderingApi, gfx_backend);
|
||||
|
||||
gfx_init(WmApi, RenderingApi, GetContext()->GetName().c_str(), bIsFullscreen);
|
||||
gfx_init(WmApi, RenderingApi, GetContext()->GetName().c_str(), bIsFullscreen, dwWidth, dwHeight);
|
||||
WmApi->set_fullscreen_changed_callback(Window::OnFullscreenChanged);
|
||||
WmApi->set_keyboard_callbacks(Window::KeyDown, Window::KeyUp, Window::AllKeysUp);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue