[Scummvm-git-logs] scummvm master -> adb6d340a30da5b8b9a95d6a2f0b5374885ce034

aquadran noreply at scummvm.org
Tue Feb 14 19:08:56 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
adb6d340a3 TINYGL: Cleanup variable types for context states


Commit: adb6d340a30da5b8b9a95d6a2f0b5374885ce034
    https://github.com/scummvm/scummvm/commit/adb6d340a30da5b8b9a95d6a2f0b5374885ce034
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2023-02-14T20:08:51+01:00

Commit Message:
TINYGL: Cleanup variable types for context states

Changed paths:
    graphics/tinygl/misc.cpp
    graphics/tinygl/zgl.h


diff --git a/graphics/tinygl/misc.cpp b/graphics/tinygl/misc.cpp
index 511f473fb60..12c365e4497 100644
--- a/graphics/tinygl/misc.cpp
+++ b/graphics/tinygl/misc.cpp
@@ -70,34 +70,34 @@ void GLContext::glopEnableDisable(GLParam *p) {
 
 	switch (code) {
 	case TGL_CULL_FACE:
-		cull_face_enabled = v;
+		cull_face_enabled = v != 0;
 		break;
 	case TGL_LIGHTING:
-		lighting_enabled = v;
+		lighting_enabled = v != 0;
 		break;
 	case TGL_COLOR_MATERIAL:
-		color_material_enabled = v;
+		color_material_enabled = v != 0;
 		break;
 	case TGL_FOG:
-		fog_enabled = v;
+		fog_enabled = v != 0;
 		break;
 	case TGL_TEXTURE_2D:
-		texture_2d_enabled = v;
+		texture_2d_enabled = v != 0;
 		break;
 	case TGL_NORMALIZE:
-		normalize_enabled = v;
+		normalize_enabled = v != 0;
 		break;
 	case TGL_DEPTH_TEST:
-		depth_test_enabled = v;
+		depth_test_enabled = v != 0;
 		break;
 	case TGL_ALPHA_TEST:
-		alpha_test_enabled = v;
+		alpha_test_enabled = v != 0;
 		break;
 	case TGL_STENCIL_TEST:
-		stencil_test_enabled = v;
+		stencil_test_enabled = v != 0;
 		break;
 	case TGL_BLEND:
-		blending_enabled = v;
+		blending_enabled = v != 0;
 		break;
 	case TGL_POLYGON_OFFSET_FILL:
 		if (v)
diff --git a/graphics/tinygl/zgl.h b/graphics/tinygl/zgl.h
index 972f00d0b12..6fbcf2e87fd 100644
--- a/graphics/tinygl/zgl.h
+++ b/graphics/tinygl/zgl.h
@@ -284,12 +284,12 @@ struct GLContext {
 	GLLight *first_light;
 	Vector4 ambient_light_model;
 	int local_light_model;
-	int lighting_enabled;
+	bool lighting_enabled;
 	int light_model_two_side;
 
 	// materials
 	GLMaterial materials[2];
-	int color_material_enabled;
+	bool color_material_enabled;
 	int current_color_material_mode;
 	int current_color_material_type;
 
@@ -333,8 +333,8 @@ struct GLContext {
 	int current_front_face;
 	int current_shade_model;
 	int current_cull_face;
-	int cull_face_enabled;
-	int normalize_enabled;
+	bool cull_face_enabled;
+	bool normalize_enabled;
 	gl_draw_triangle_func draw_triangle_front, draw_triangle_back;
 
 	// selection




More information about the Scummvm-git-logs mailing list