forked from Ports/goldeneye-pc-port
D211 didn't affect the in-level view (user test): the fast3d gfx_apply_fov_scale hook only recognised *pure* perspective matrix loads, but GE draws the world through g_CurrentPlayer->field_10E0 -- a projection x view matrix pre-combined on the CPU (bondview2.c:8224) -- which failed the guard. Only the pause/watch model + sky FOV changed. Fix: scale fovy game-side at the guPerspectiveF chokepoint (src/fr.c, #ifdef PORT, frFovY *= portFovScale, clamp 160deg), which lands before the CPU combine. Removed the fast3d hook + gfx_api.h decl; port/src/video.c now sets f32 portFovScale. Gated to lvlGetCurrentStageToLoad() != LEVELID_TITLE so the front end (which renders through the same path) keeps its authored FOV. User-verified: menu unaffected, in-level view widens (Dam tunnel). Caveat: currentPlayerSetCameraScale keeps nominal FOV for frustum-cull / screen<->world math (edge geometry culls slightly early at high scale). Adds src/fr.c as a #ifdef PORT game-code touch (D181 policy class). Docs (this test pass): - D214: config.c sections by the last dot, so binds live in [Input.Bind] not [Bind]. Doc-only fix (finding, index, QOL-INVENTORY); code unchanged. - D217 (OPEN): viewmodel + 3rd-person Bond model textures render garbled -- stale-palette CI-texture bug (D161 family), surfaced by D215. - D218 (LOGGED, parked): wide FOV exposes the per-level FarFog draw-distance boundary; Video.DrawDistance fix proposed.
62 lines
2.2 KiB
C
62 lines
2.2 KiB
C
#ifndef GFX_API_H
|
|
#define GFX_API_H
|
|
|
|
#ifndef __cplusplus
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#endif
|
|
|
|
#include "gfx_rendering_api.h"
|
|
#include "gfx_window_manager_api.h"
|
|
|
|
struct XYWidthHeight {
|
|
int16_t x, y;
|
|
uint32_t width, height;
|
|
};
|
|
|
|
struct GfxDimensions {
|
|
float internal_mul;
|
|
uint32_t width, height;
|
|
float aspect_ratio;
|
|
};
|
|
|
|
struct GfxInitSettings {
|
|
struct GfxWindowManagerAPI *wapi;
|
|
struct GfxRenderingAPI *rapi;
|
|
struct GfxWindowInitSettings window_settings;
|
|
};
|
|
|
|
extern struct GfxDimensions gfx_current_window_dimensions; // The dimensions of the window
|
|
extern struct GfxDimensions
|
|
gfx_current_dimensions; // The dimensions of the draw area the game draws to, before scaling (if applicable)
|
|
extern struct XYWidthHeight
|
|
gfx_current_game_window_viewport; // The area of the window the game is drawn to, (0, 0) is top-left corner
|
|
extern uint32_t gfx_msaa_level;
|
|
extern struct XYWidthHeight gfx_current_native_viewport; // The internal/native video mode of the game
|
|
extern float gfx_current_native_aspect; // The aspect ratio of the above mode
|
|
extern bool gfx_framebuffers_enabled;
|
|
extern bool gfx_detail_textures_enabled;
|
|
|
|
void gfx_init(const struct GfxInitSettings *settings);
|
|
void gfx_destroy(void);
|
|
struct GfxRenderingAPI* gfx_get_current_rendering_api(void);
|
|
void gfx_start_frame(void);
|
|
void gfx_run(Gfx* commands);
|
|
void gfx_end_frame(void);
|
|
void gfx_set_target_fps(int);
|
|
void gfx_set_texture_filter(enum FilteringMode mode);
|
|
void gfx_set_mipmap_filter(enum MipmapFilteringMode mode);
|
|
void gfx_set_fix_mip_textures(int on);
|
|
void gfx_set_wrap_fix(int on);
|
|
void gfx_set_anisotropy_level(int level); /* 1 = off; clamped to GL max */
|
|
void gfx_texture_cache_clear(void);
|
|
void gfx_texture_cache_delete(const uint8_t *orig_addr);
|
|
void gfx_texture_cache_delete_range(const uint8_t *start, const uint8_t *end);
|
|
int gfx_create_framebuffer(uint32_t width, uint32_t height, int upscale, int autoresize);
|
|
void gfx_resize_framebuffer(int fb, uint32_t width, uint32_t height, int upscale, int autoresize);
|
|
void gfx_set_framebuffer(int fb, float noise_scale) ;
|
|
void gfx_reset_framebuffer(void);
|
|
void gfx_copy_framebuffer(int fb_dst, int fb_src, int left, int top, int use_back);
|
|
|
|
#endif
|