Changeset 63942 in vbox for trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_lighting.c
- Timestamp:
- Sep 22, 2016 11:01:17 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_lighting.c
r29930 r63942 13 13 void crStateLightingInitBits (CRLightingBits *l) 14 14 { 15 l->light = (CRLightBits *) crCalloc (sizeof(*(l->light)) * CR_MAX_LIGHTS 15 l->light = (CRLightBits *) crCalloc (sizeof(*(l->light)) * CR_MAX_LIGHTS); 16 16 } 17 17 … … 23 23 void crStateLightingDestroy (CRContext *ctx) 24 24 { 25 crFree( ctx->lighting.light);25 crFree(ctx->lighting.light); 26 26 } 27 27 … … 217 217 else 218 218 { 219 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM, "LightModel: Invalid param for LIGHT_MODEL_COLOR_CONTROL: 0x%x", param[0]);219 crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "LightModel: Invalid param for LIGHT_MODEL_COLOR_CONTROL: 0x%x", param[0]); 220 220 return; 221 221 } … … 224 224 #if defined(CR_EXT_separate_specular_color) 225 225 case GL_LIGHT_MODEL_COLOR_CONTROL_EXT: 226 if( g->extensions.EXT_separate_specular_color)227 { 228 if ( param[0] == GL_SEPARATE_SPECULAR_COLOR_EXT || param[0] == GL_SINGLE_COLOR_EXT)226 if(g->extensions.EXT_separate_specular_color) 227 { 228 if (param[0] == GL_SEPARATE_SPECULAR_COLOR_EXT || param[0] == GL_SINGLE_COLOR_EXT) 229 229 { 230 230 l->lightModelColorControlEXT = (GLenum) param[0]; … … 232 232 else 233 233 { 234 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM, "LightModel: Invalid param for LIGHT_MODEL_COLOR_CONTROL: 0x%x", param[0]);234 crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "LightModel: Invalid param for LIGHT_MODEL_COLOR_CONTROL: 0x%x", param[0]); 235 235 return; 236 236 } … … 238 238 else 239 239 { 240 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM, "LightModel( LIGHT_MODEL_COLOR_CONTROL, ...) - EXT_separate_specular_color is unavailable.");240 crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "LightModel( LIGHT_MODEL_COLOR_CONTROL, ...) - EXT_separate_specular_color is unavailable."); 241 241 return; 242 242 } … … 265 265 case GL_LIGHT_MODEL_TWO_SIDE: 266 266 f_param = (GLfloat) (*param); 267 crStateLightModelfv( pname, &f_param);267 crStateLightModelfv(pname, &f_param); 268 268 break; 269 269 case GL_LIGHT_MODEL_AMBIENT: … … 272 272 f_color.b = ((GLfloat)param[2])/CR_MAXINT; 273 273 f_color.a = ((GLfloat)param[3])/CR_MAXINT; 274 crStateLightModelfv( pname, (GLfloat *) &f_color);274 crStateLightModelfv(pname, (GLfloat *) &f_color); 275 275 break; 276 276 #if defined(CR_OPENGL_VERSION_1_2) 277 277 case GL_LIGHT_MODEL_COLOR_CONTROL: 278 278 f_param = (GLfloat) (*param); 279 crStateLightModelfv( pname, &f_param);279 crStateLightModelfv(pname, &f_param); 280 280 break; 281 281 #else 282 282 #ifdef CR_EXT_separate_specular_color 283 283 case GL_LIGHT_MODEL_COLOR_CONTROL_EXT: 284 if ( g->extensions.EXT_separate_specular_color) {284 if (g->extensions.EXT_separate_specular_color) { 285 285 f_param = (GLfloat) (*param); 286 crStateLightModelfv( pname, &f_param);286 crStateLightModelfv(pname, &f_param); 287 287 } else { 288 crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "LightModeliv(GL_LIGHT_MODEL_COLOR_CONTROL_EXT, ...) - EXT_separate_specular_color not enabled!" 288 crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "LightModeliv(GL_LIGHT_MODEL_COLOR_CONTROL_EXT, ...) - EXT_separate_specular_color not enabled!"); 289 289 return; 290 290 } … … 300 300 void STATE_APIENTRY crStateLightModelf (GLenum pname, GLfloat param) 301 301 { 302 crStateLightModelfv( pname, ¶m);302 crStateLightModelfv(pname, ¶m); 303 303 } 304 304 … … 306 306 { 307 307 GLfloat f_param = (GLfloat) param; 308 crStateLightModelfv( pname, &f_param);308 crStateLightModelfv(pname, &f_param); 309 309 } 310 310 … … 470 470 f_color.b = ((GLfloat)param[2])/CR_MAXINT; 471 471 f_color.a = ((GLfloat)param[3])/CR_MAXINT; 472 crStateLightfv( light, pname, (GLfloat *) &f_color);472 crStateLightfv(light, pname, (GLfloat *) &f_color); 473 473 break; 474 474 case GL_POSITION: … … 478 478 f_vector.z = (GLfloat) param[2]; 479 479 f_vector.w = (GLfloat) param[3]; 480 crStateLightfv( light, pname, (GLfloat *) &f_vector);480 crStateLightfv(light, pname, (GLfloat *) &f_vector); 481 481 break; 482 482 case GL_SPOT_EXPONENT: … … 486 486 case GL_QUADRATIC_ATTENUATION: 487 487 f_param = (GLfloat) (*param); 488 crStateLightfv( light, pname, &f_param);488 crStateLightfv(light, pname, &f_param); 489 489 break; 490 490 default: … … 496 496 void STATE_APIENTRY crStateLightf (GLenum light, GLenum pname, GLfloat param) 497 497 { 498 crStateLightfv( light, pname, ¶m);498 crStateLightfv(light, pname, ¶m); 499 499 } 500 500 … … 502 502 { 503 503 GLfloat f_param = (GLfloat) param; 504 crStateLightfv( light, pname, &f_param);504 crStateLightfv(light, pname, &f_param); 505 505 } 506 506 … … 719 719 f_color.b = ((GLfloat) param[2]) / ((GLfloat) CR_MAXINT); 720 720 f_color.a = ((GLfloat) param[3]) / ((GLfloat) CR_MAXINT); 721 crStateMaterialfv( face, pname, (GLfloat *) &f_color);721 crStateMaterialfv(face, pname, (GLfloat *) &f_color); 722 722 break; 723 723 case GL_SHININESS: 724 724 f_param = (GLfloat) (*param); 725 crStateMaterialfv( face, pname, (GLfloat *) &f_param);725 crStateMaterialfv(face, pname, (GLfloat *) &f_param); 726 726 break; 727 727 case GL_COLOR_INDEXES : 728 728 f_param = (GLfloat) (*param); 729 crStateMaterialfv( face, pname, (GLfloat *) &f_param);729 crStateMaterialfv(face, pname, (GLfloat *) &f_param); 730 730 break; 731 731 default: … … 737 737 void STATE_APIENTRY crStateMaterialf (GLenum face, GLenum pname, GLfloat param) 738 738 { 739 crStateMaterialfv( face, pname, ¶m);739 crStateMaterialfv(face, pname, ¶m); 740 740 } 741 741 … … 743 743 { 744 744 GLfloat f_param = (GLfloat) param; 745 crStateMaterialfv( face, pname, &f_param);745 crStateMaterialfv(face, pname, &f_param); 746 746 } 747 747 … … 1208 1208 crStateFlushFunc(NULL); 1209 1209 1210 crStateMaterialfv( l->colorMaterialFace, l->colorMaterialMode, &(c->vertexAttrib[VERT_ATTRIB_COLOR0][0]));1211 } 1212 } 1210 crStateMaterialfv(l->colorMaterialFace, l->colorMaterialMode, &(c->vertexAttrib[VERT_ATTRIB_COLOR0][0])); 1211 } 1212 }
Note:
See TracChangeset
for help on using the changeset viewer.