mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 03:25:14 -04:00
Fix last commit
This commit is contained in:
parent
cf7b353572
commit
1b6bbbe6cf
@ -281,6 +281,9 @@ cc_bool Game_ValidateBitmapPow2(const cc_string* file, struct Bitmap* bmp) {
|
|||||||
void Game_UpdateDimensions(void) {
|
void Game_UpdateDimensions(void) {
|
||||||
Game.Width = max(Window_Main.Width, 1);
|
Game.Width = max(Window_Main.Width, 1);
|
||||||
Game.Height = max(Window_Main.Height, 1);
|
Game.Height = max(Window_Main.Height, 1);
|
||||||
|
|
||||||
|
Gfx.ViewportWidth = Game.Width;
|
||||||
|
Gfx.ViewportHeight = Game.Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Game_OnResize(void* obj) {
|
static void Game_OnResize(void* obj) {
|
||||||
@ -402,6 +405,7 @@ static void Game_Load(void) {
|
|||||||
Game_UpdateDimensions();
|
Game_UpdateDimensions();
|
||||||
Game_SetFpsLimit(Options_GetEnum(OPT_FPS_LIMIT, 0, FpsLimit_Names, FPS_LIMIT_COUNT));
|
Game_SetFpsLimit(Options_GetEnum(OPT_FPS_LIMIT, 0, FpsLimit_Names, FPS_LIMIT_COUNT));
|
||||||
Gfx_Create();
|
Gfx_Create();
|
||||||
|
|
||||||
Logger_WarnFunc = Game_WarnFunc;
|
Logger_WarnFunc = Game_WarnFunc;
|
||||||
LoadOptions();
|
LoadOptions();
|
||||||
GameVersion_Load();
|
GameVersion_Load();
|
||||||
|
@ -66,6 +66,7 @@ CC_VAR extern struct _GfxData {
|
|||||||
int MinTexWidth, MinTexHeight;
|
int MinTexWidth, MinTexHeight;
|
||||||
cc_bool ReducedPerfMode;
|
cc_bool ReducedPerfMode;
|
||||||
cc_uint8 ReducedPerfModeCooldown;
|
cc_uint8 ReducedPerfModeCooldown;
|
||||||
|
int ViewportX, ViewportY, ViewportWidth, ViewportHeight;
|
||||||
} Gfx;
|
} Gfx;
|
||||||
|
|
||||||
extern GfxResourceID Gfx_defaultIb;
|
extern GfxResourceID Gfx_defaultIb;
|
||||||
|
@ -648,10 +648,10 @@ static void RS_CreateRasterState(void) {
|
|||||||
|
|
||||||
static void RS_UpdateViewport(void) {
|
static void RS_UpdateViewport(void) {
|
||||||
D3D11_VIEWPORT viewport;
|
D3D11_VIEWPORT viewport;
|
||||||
viewport.TopLeftX = 0;
|
viewport.TopLeftX = Gfx.ViewportX;
|
||||||
viewport.TopLeftY = 0;
|
viewport.TopLeftY = Gfx.ViewportY;
|
||||||
viewport.Width = Window_Main.Width;
|
viewport.Width = Gfx.ViewportWidth;
|
||||||
viewport.Height = Window_Main.Height;
|
viewport.Height = Gfx.ViewportHeight;
|
||||||
viewport.MinDepth = 0.0f;
|
viewport.MinDepth = 0.0f;
|
||||||
viewport.MaxDepth = 1.0f;
|
viewport.MaxDepth = 1.0f;
|
||||||
ID3D11DeviceContext_RSSetViewports(context, 1, &viewport);
|
ID3D11DeviceContext_RSSetViewports(context, 1, &viewport);
|
||||||
|
@ -2231,10 +2231,10 @@ static struct Widget* touch_widgets[ONSCREEN_MAX_BTNS + TOUCH_EXTRA_BTNS + 2] =
|
|||||||
#define TOUCH_MAX_VERTICES (THUMBSTICKWIDGET_MAX + TOUCH_MAX_BTNS * BUTTONWIDGET_MAX)
|
#define TOUCH_MAX_VERTICES (THUMBSTICKWIDGET_MAX + TOUCH_MAX_BTNS * BUTTONWIDGET_MAX)
|
||||||
|
|
||||||
static void TouchScreen_ChatClick(void* s, void* w) { ChatScreen_OpenInput(&String_Empty); }
|
static void TouchScreen_ChatClick(void* s, void* w) { ChatScreen_OpenInput(&String_Empty); }
|
||||||
static void TouchScreen_RespawnClick(void* s, void* w) { LocalPlayer_HandleRespawn(); }
|
static void TouchScreen_RespawnClick(void* s, void* w) { LocalPlayer_HandleRespawn(&LocalPlayer_Instance); }
|
||||||
static void TouchScreen_SetSpawnClick(void* s, void* w) { LocalPlayer_HandleSetSpawn(); }
|
static void TouchScreen_SetSpawnClick(void* s, void* w) { LocalPlayer_HandleSetSpawn(&LocalPlayer_Instance); }
|
||||||
static void TouchScreen_FlyClick(void* s, void* w) { LocalPlayer_HandleFly(); }
|
static void TouchScreen_FlyClick(void* s, void* w) { LocalPlayer_HandleFly(&LocalPlayer_Instance); }
|
||||||
static void TouchScreen_NoclipClick(void* s, void* w) { LocalPlayer_HandleNoclip(); }
|
static void TouchScreen_NoclipClick(void* s, void* w) { LocalPlayer_HandleNoclip(&LocalPlayer_Instance); }
|
||||||
static void TouchScreen_CameraClick(void* s, void* w) { Camera_CycleActive(); }
|
static void TouchScreen_CameraClick(void* s, void* w) { Camera_CycleActive(); }
|
||||||
static void TouchScreen_MoreClick(void* s, void* w) { TouchMoreScreen_Show(); }
|
static void TouchScreen_MoreClick(void* s, void* w) { TouchMoreScreen_Show(); }
|
||||||
static void TouchScreen_SwitchClick(void* s, void* w) { Inventory_SwitchHotbar(); }
|
static void TouchScreen_SwitchClick(void* s, void* w) { Inventory_SwitchHotbar(); }
|
||||||
|
@ -325,7 +325,7 @@ void Gfx_EndFrame(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Gfx_OnWindowResize(void) {
|
void Gfx_OnWindowResize(void) {
|
||||||
glViewport(0, 0, Game.Width, Game.Height);
|
glViewport(Gfx.ViewportX, Gfx.ViewportY, Gfx.ViewportWidth, Gfx.ViewportHeight);
|
||||||
/* With cocoa backend, in some cases [NSOpenGLContext update] will actually */
|
/* With cocoa backend, in some cases [NSOpenGLContext update] will actually */
|
||||||
/* call glViewport with the size of the window framebuffer */
|
/* call glViewport with the size of the window framebuffer */
|
||||||
/* https://github.com/glfw/glfw/issues/80 */
|
/* https://github.com/glfw/glfw/issues/80 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user