mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-11 16:45:48 -04:00
Fix normalfast render mode not disabling fog anymore
This commit is contained in:
parent
8987e6b3e5
commit
18fce97418
@ -7,6 +7,7 @@
|
|||||||
http://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art001
|
http://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art001
|
||||||
https://www.ietf.org/rfc/rfc1951.txt
|
https://www.ietf.org/rfc/rfc1951.txt
|
||||||
https://github.com/nothings/stb/blob/master/stb_image.h
|
https://github.com/nothings/stb/blob/master/stb_image.h
|
||||||
|
https://www.hanshq.net/zip.html
|
||||||
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
|
Copyright 2014-2019 ClassiCube | Licensed under BSD-3
|
||||||
*/
|
*/
|
||||||
struct Stream;
|
struct Stream;
|
||||||
|
@ -605,7 +605,8 @@ static void Game_RenderFrame(double delta) {
|
|||||||
Gfx_Clear();
|
Gfx_Clear();
|
||||||
Camera.CurrentPos = Camera.Active->GetPosition(t);
|
Camera.CurrentPos = Camera.Active->GetPosition(t);
|
||||||
UpdateViewMatrix();
|
UpdateViewMatrix();
|
||||||
Gfx_Mode3D();
|
Gfx_LoadMatrix(MATRIX_PROJECTION, &Gfx.Projection);
|
||||||
|
Gfx_LoadMatrix(MATRIX_VIEW, &Gfx.View);
|
||||||
|
|
||||||
if (!Gui_GetBlocksWorld()) {
|
if (!Gui_GetBlocksWorld()) {
|
||||||
Game_Render3D(delta, t);
|
Game_Render3D(delta, t);
|
||||||
@ -613,8 +614,10 @@ static void Game_RenderFrame(double delta) {
|
|||||||
RayTracer_SetInvalid(&Game_SelectedPos);
|
RayTracer_SetInvalid(&Game_SelectedPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
Gfx_Mode2D(Game.Width, Game.Height);
|
Gfx_Begin2D(Game.Width, Game.Height);
|
||||||
Gui_RenderGui(delta);
|
Gui_RenderGui(delta);
|
||||||
|
Gfx_End2D();
|
||||||
|
|
||||||
if (Game_ScreenshotRequested) Game_TakeScreenshot();
|
if (Game_ScreenshotRequested) Game_TakeScreenshot();
|
||||||
Gfx_EndFrame();
|
Gfx_EndFrame();
|
||||||
}
|
}
|
||||||
|
@ -174,10 +174,9 @@ void Gfx_Make2DQuad(const struct Texture* tex, PackedCol col, struct VertexTextu
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cc_bool gfx_hadFog;
|
static cc_bool gfx_hadFog;
|
||||||
void Gfx_Mode2D(int width, int height) {
|
void Gfx_Begin2D(int width, int height) {
|
||||||
struct Matrix ortho;
|
struct Matrix ortho;
|
||||||
Gfx_CalcOrthoMatrix((float)width, (float)height, &ortho);
|
Gfx_CalcOrthoMatrix((float)width, (float)height, &ortho);
|
||||||
|
|
||||||
Gfx_LoadMatrix(MATRIX_PROJECTION, &ortho);
|
Gfx_LoadMatrix(MATRIX_PROJECTION, &ortho);
|
||||||
Gfx_LoadIdentityMatrix(MATRIX_VIEW);
|
Gfx_LoadIdentityMatrix(MATRIX_VIEW);
|
||||||
|
|
||||||
@ -187,10 +186,7 @@ void Gfx_Mode2D(int width, int height) {
|
|||||||
if (gfx_hadFog) Gfx_SetFog(false);
|
if (gfx_hadFog) Gfx_SetFog(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx_Mode3D(void) {
|
void Gfx_End2D(void) {
|
||||||
Gfx_LoadMatrix(MATRIX_PROJECTION, &Gfx.Projection);
|
|
||||||
Gfx_LoadMatrix(MATRIX_VIEW, &Gfx.View);
|
|
||||||
|
|
||||||
Gfx_SetDepthTest(true);
|
Gfx_SetDepthTest(true);
|
||||||
Gfx_SetAlphaBlending(false);
|
Gfx_SetAlphaBlending(false);
|
||||||
if (gfx_hadFog) Gfx_SetFog(true);
|
if (gfx_hadFog) Gfx_SetFog(true);
|
||||||
|
@ -212,10 +212,10 @@ void Gfx_Make2DQuad(const struct Texture* tex, PackedCol col, struct VertexTextu
|
|||||||
|
|
||||||
/* Switches state to be suitable for drawing 2D graphics. */
|
/* Switches state to be suitable for drawing 2D graphics. */
|
||||||
/* NOTE: This means turning off fog/depth test, changing matrices, etc.*/
|
/* NOTE: This means turning off fog/depth test, changing matrices, etc.*/
|
||||||
void Gfx_Mode2D(int width, int height);
|
void Gfx_Begin2D(int width, int height);
|
||||||
/* Switches state to be suitable for drawing 3D graphics. */
|
/* Switches state to be suitable for drawing 3D graphics. */
|
||||||
/* NOTE: This means restoring fog/depth test, restoring matrices, etc. */
|
/* NOTE: This means restoring fog/depth test, restoring matrices, etc. */
|
||||||
void Gfx_Mode3D(void);
|
void Gfx_End2D(void);
|
||||||
|
|
||||||
/* Sets appropriate alpha test/blending for given block draw type. */
|
/* Sets appropriate alpha test/blending for given block draw type. */
|
||||||
void Gfx_SetupAlphaState(cc_uint8 draw);
|
void Gfx_SetupAlphaState(cc_uint8 draw);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user