Fix plugin incompatibility

This commit is contained in:
UnknownShadow200 2024-07-25 19:45:29 +10:00
parent 47fdeb17a5
commit fcdaf165ec
2 changed files with 9 additions and 4 deletions

View File

@ -25,14 +25,14 @@ void Gfx_Create(void) {
glAlphaFunc(7);
glClearDepth(GL_MAX_DEPTH);
glViewport(0, 0, 255, 191);
Gfx_SetViewport(0, 0, 256, 192);
vramSetBankA(VRAM_A_TEXTURE);
vramSetBankB(VRAM_B_TEXTURE);
vramSetBankC(VRAM_C_TEXTURE);
vramSetBankD(VRAM_D_TEXTURE);
glPolyFmt(POLY_ALPHA(31) | POLY_CULL_NONE);
Gfx_SetFaceCulling(false);
}
cc_bool Gfx_TryRestoreContext(void) {
@ -67,7 +67,11 @@ void Gfx_SetVSync(cc_bool vsync) {
void Gfx_OnWindowResize(void) {
}
void Gfx_SetViewport(int x, int y, int w, int h) { }
void Gfx_SetViewport(int x, int y, int w, int h) {
int x2 = x + w - 1, y2 = y + h - 1;
GFX_VIEWPORT = x | (y << 8) | (x2 << 16) | (y2 << 24);
}
void Gfx_SetScissor (int x, int y, int w, int h) { }
void Gfx_BeginFrame(void) {

View File

@ -18,7 +18,7 @@ http://www.devmaster.net/articles/raytracing_series/A%20faster%20voxel%20travers
*/
struct RayTracer {
IVec3 pos; /* Coordinates of block within world */
Vec3 origin, dir, invDir;
Vec3 origin, dir;
Vec3 Min, Max; /* Min/max coords of block's bounding box. */
BlockID block;
IVec3 step;
@ -28,6 +28,7 @@ struct RayTracer {
IVec3 translatedPos; /* Coords of the neighbouring block that is closest to the player */
cc_bool valid; /* Whether the ray tracer actually intersected with a block */
Face closest; /* Face of the intersected block that is closet to the player */
Vec3 invDir;
};
/* Marks the given ray tracer as having no result. */