Changeset 78375 in vbox for trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_fog.c
- Timestamp:
- May 3, 2019 9:51:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_fog.c
r69392 r78375 13 13 { 14 14 CRFogState *f = &ctx->fog; 15 CRStateBits *sb = GetCurrentBits( );15 CRStateBits *sb = GetCurrentBits(ctx->pStateTracker); 16 16 CRFogBits *fb = &(sb->fog); 17 17 GLcolorf black = {0.0f, 0.0f, 0.0f, 0.0f}; … … 43 43 } 44 44 45 void STATE_APIENTRY crStateFogf( GLenum pname, GLfloat param)45 void STATE_APIENTRY crStateFogf(PCRStateTracker pState, GLenum pname, GLfloat param) 46 46 { 47 crStateFogfv( pname, ¶m );47 crStateFogfv(pState, pname, ¶m ); 48 48 } 49 49 50 void STATE_APIENTRY crStateFogi( GLenum pname, GLint param)50 void STATE_APIENTRY crStateFogi(PCRStateTracker pState, GLenum pname, GLint param) 51 51 { 52 52 GLfloat f_param = (GLfloat) param; 53 crStateFogfv( pname, &f_param );53 crStateFogfv(pState, pname, &f_param ); 54 54 } 55 55 56 void STATE_APIENTRY crStateFogiv( GLenum pname, const GLint *param)56 void STATE_APIENTRY crStateFogiv(PCRStateTracker pState, GLenum pname, const GLint *param) 57 57 { 58 58 GLcolor f_color; … … 66 66 case GL_FOG_INDEX: 67 67 f_param = (GLfloat) (*param); 68 crStateFogfv( pname, &f_param );68 crStateFogfv(pState, pname, &f_param ); 69 69 break; 70 70 case GL_FOG_COLOR: … … 73 73 f_color.b = ((GLfloat) param[2]) / ((GLfloat) CR_MAXINT); 74 74 f_color.a = ((GLfloat) param[3]) / ((GLfloat) CR_MAXINT); 75 crStateFogfv( pname, (GLfloat *) &f_color );75 crStateFogfv(pState, pname, (GLfloat *) &f_color ); 76 76 break; 77 77 #ifdef CR_NV_fog_distance 78 78 case GL_FOG_DISTANCE_MODE_NV: 79 79 f_param = (GLfloat) (*param); 80 crStateFogfv( pname, &f_param );80 crStateFogfv(pState, pname, &f_param ); 81 81 break; 82 82 #endif … … 84 84 case GL_FOG_COORDINATE_SOURCE_EXT: 85 85 f_param = (GLfloat) (*param); 86 crStateFogfv( pname, &f_param );86 crStateFogfv(pState, pname, &f_param ); 87 87 break; 88 88 #endif 89 89 default: 90 crStateError( __LINE__, __FILE__, GL_INVALID_VALUE, "Invalid glFog Param: %d", param);90 crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE, "Invalid glFog Param: %d", param); 91 91 return; 92 92 } 93 93 } 94 94 95 void STATE_APIENTRY crStateFogfv( GLenum pname, const GLfloat *param)95 void STATE_APIENTRY crStateFogfv(PCRStateTracker pState, GLenum pname, const GLfloat *param) 96 96 { 97 CRContext *g = GetCurrentContext( );97 CRContext *g = GetCurrentContext(pState); 98 98 CRFogState *f = &(g->fog); 99 CRStateBits *sb = GetCurrentBits( );99 CRStateBits *sb = GetCurrentBits(pState); 100 100 CRFogBits *fb = &(sb->fog); 101 101 102 102 if (g->current.inBeginEnd) 103 103 { 104 crStateError( __LINE__, __FILE__, GL_INVALID_OPERATION, "glFogfv called in Begin/End");104 crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION, "glFogfv called in Begin/End"); 105 105 return; 106 106 } … … 115 115 if (e != GL_LINEAR && e != GL_EXP && e != GL_EXP2) 116 116 { 117 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM, "Invalid param for glFog: %d", e);117 crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM, "Invalid param for glFog: %d", e); 118 118 return; 119 119 } … … 157 157 param[0] != GL_EYE_PLANE_ABSOLUTE_NV ) 158 158 { 159 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM,159 crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM, 160 160 "Fogfv: GL_FOG_DISTANCE_MODE_NV called with illegal parameter: 0x%x", (GLenum) param[0]); 161 161 return; … … 166 166 else 167 167 { 168 crStateError( __LINE__, __FILE__, GL_INVALID_VALUE, "Invalid glFog Param: %d", param);168 crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE, "Invalid glFog Param: %d", param); 169 169 return; 170 170 } … … 178 178 (GLenum) param[0] != GL_FRAGMENT_DEPTH_EXT) 179 179 { 180 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM,180 crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM, 181 181 "Fogfv: GL_FOG_COORDINATE_SOURCE_EXT called with illegal parameter: 0x%x", (GLenum) param[0]); 182 182 return; … … 187 187 else 188 188 { 189 crStateError( __LINE__, __FILE__, GL_INVALID_VALUE, "Invalid glFog Param: 0x%x", (GLint) param[0]);189 crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE, "Invalid glFog Param: 0x%x", (GLint) param[0]); 190 190 return; 191 191 } … … 193 193 #endif 194 194 default: 195 crStateError( __LINE__, __FILE__, GL_INVALID_VALUE, "Invalid glFog Param: %d", param);195 crStateError(pState, __LINE__, __FILE__, GL_INVALID_VALUE, "Invalid glFog Param: %d", param); 196 196 return; 197 197 }
Note:
See TracChangeset
for help on using the changeset viewer.