Remove set gfx adjust for aspect ratio function

Too much power.
This commit is contained in:
Agent X 2024-03-08 19:47:46 -05:00
parent 7d9947816c
commit edd29c0719
9 changed files with 1 additions and 106 deletions

View File

@ -8862,17 +8862,6 @@ function get_vertex_color(index)
-- ...
end
--- @param enable boolean
--- @return nil
function gfx_enable_adjust_for_aspect_ratio(enable)
-- ...
end
--- @return boolean
function gfx_get_adjust_for_aspect_ratio()
-- ...
end
--- @return integer
function hud_get_flash()
-- ...

View File

@ -1210,44 +1210,6 @@
<br />
## [gfx_enable_adjust_for_aspect_ratio](#gfx_enable_adjust_for_aspect_ratio)
### Lua Example
`gfx_enable_adjust_for_aspect_ratio(enable)`
### Parameters
| Field | Type |
| ----- | ---- |
| enable | `boolean` |
### Returns
- None
### C Prototype
`void gfx_enable_adjust_for_aspect_ratio(bool enable);`
[:arrow_up_small:](#)
<br />
## [gfx_get_adjust_for_aspect_ratio](#gfx_get_adjust_for_aspect_ratio)
### Lua Example
`local booleanValue = gfx_get_adjust_for_aspect_ratio()`
### Parameters
- None
### Returns
- `boolean`
### C Prototype
`bool gfx_get_adjust_for_aspect_ratio(void);`
[:arrow_up_small:](#)
<br />
## [hud_get_flash](#hud_get_flash)
### Lua Example

View File

@ -1663,8 +1663,6 @@
- [get_time](functions-5.md#get_time)
- [get_ttc_speed_setting](functions-5.md#get_ttc_speed_setting)
- [get_vertex_color](functions-5.md#get_vertex_color)
- [gfx_enable_adjust_for_aspect_ratio](functions-5.md#gfx_enable_adjust_for_aspect_ratio)
- [gfx_get_adjust_for_aspect_ratio](functions-5.md#gfx_get_adjust_for_aspect_ratio)
- [hud_get_flash](functions-5.md#hud_get_flash)
- [hud_get_value](functions-5.md#hud_get_value)
- [hud_hide](functions-5.md#hud_hide)

View File

@ -189,8 +189,6 @@ Color gVertexColor = { 255, 255, 255 };
Color gFogColor = { 255, 255, 255 };
f32 gFogIntensity = 1;
bool gAdjustForAspectRatio = true;
// 4x4 pink-black checkerboard texture to indicate missing textures
#define MISSING_W 4
#define MISSING_H 4
@ -753,8 +751,6 @@ static void gfx_sp_pop_matrix(uint32_t count) {
}
static float gfx_adjust_x_for_aspect_ratio(float x) {
if (!gAdjustForAspectRatio) return x * (4.0 / 3.0f) / (4.0f / 3.0f);
return x * (4.0f / 3.0f) / ((float)gfx_current_dimensions.width / (float)gfx_current_dimensions.height);
}
@ -1820,7 +1816,7 @@ void gfx_start_frame(void) {
// Avoid division by zero
gfx_current_dimensions.height = 1;
}
gfx_current_dimensions.aspect_ratio = gAdjustForAspectRatio ? ((float)gfx_current_dimensions.width / (float)gfx_current_dimensions.height) : (4.0f / 3.0f);
gfx_current_dimensions.aspect_ratio = ((float)gfx_current_dimensions.width / (float)gfx_current_dimensions.height);
}
void gfx_run(Gfx *commands) {

View File

@ -19,8 +19,6 @@ extern Color gVertexColor;
extern Color gFogColor;
extern f32 gFogIntensity;
extern bool gAdjustForAspectRatio;
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -29232,38 +29232,6 @@ int smlua_func_get_vertex_color(lua_State* L) {
return 1;
}
int smlua_func_gfx_enable_adjust_for_aspect_ratio(lua_State* L) {
if (L == NULL) { return 0; }
int top = lua_gettop(L);
if (top != 1) {
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_enable_adjust_for_aspect_ratio", 1, top);
return 0;
}
bool enable = smlua_to_boolean(L, 1);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_enable_adjust_for_aspect_ratio"); return 0; }
gfx_enable_adjust_for_aspect_ratio(enable);
return 1;
}
int smlua_func_gfx_get_adjust_for_aspect_ratio(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
int top = lua_gettop(L);
if (top != 0) {
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_get_adjust_for_aspect_ratio", 0, top);
return 0;
}
lua_pushboolean(L, gfx_get_adjust_for_aspect_ratio());
return 1;
}
int smlua_func_hud_get_flash(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
@ -33095,8 +33063,6 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "get_time", smlua_func_get_time);
smlua_bind_function(L, "get_ttc_speed_setting", smlua_func_get_ttc_speed_setting);
smlua_bind_function(L, "get_vertex_color", smlua_func_get_vertex_color);
smlua_bind_function(L, "gfx_enable_adjust_for_aspect_ratio", smlua_func_gfx_enable_adjust_for_aspect_ratio);
smlua_bind_function(L, "gfx_get_adjust_for_aspect_ratio", smlua_func_gfx_get_adjust_for_aspect_ratio);
smlua_bind_function(L, "hud_get_flash", smlua_func_hud_get_flash);
smlua_bind_function(L, "hud_get_value", smlua_func_hud_get_value);
smlua_bind_function(L, "hud_hide", smlua_func_hud_hide);

View File

@ -635,16 +635,6 @@ bool get_coop_compatibility_enabled(void) {
///
bool gfx_get_adjust_for_aspect_ratio(void) {
return gAdjustForAspectRatio;
}
void gfx_enable_adjust_for_aspect_ratio(bool enable) {
gAdjustForAspectRatio = enable;
}
///
void set_window_title(const char* title) {
WAPI.set_window_title(title);
}

View File

@ -160,9 +160,6 @@ u32 get_global_timer(void);
bool get_coop_compatibility_enabled(void);
bool gfx_get_adjust_for_aspect_ratio(void);
void gfx_enable_adjust_for_aspect_ratio(bool enable);
void set_window_title(const char* title);
void reset_window_title(void);

View File

@ -676,7 +676,6 @@ void network_shutdown(bool sendLeaving, bool exiting, bool popup, bool reconnect
gFogIntensity = 1;
gOverrideBackground = -1;
gOverrideEnvFx = -1;
gAdjustForAspectRatio = true;
gRomhackCameraAllowCentering = TRUE;
gOverrideAllowToxicGasCamera = FALSE;
gRomhackCameraAllowDpad = FALSE;