X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FLights.cpp;h=b8332c34fdab27e95fd5f30e86feb684ec70dffa;hb=25e3d5e35a7fd7efdffc420efe3c41a91cefe43f;hp=ab93c865dde655c5fa8df63ac8f5b087aead4480;hpb=87ff660bf58766ab705a749e72e04154ccf5a737;p=lugaru.git diff --git a/Source/Lights.cpp b/Source/Lights.cpp index ab93c86..b8332c3 100644 --- a/Source/Lights.cpp +++ b/Source/Lights.cpp @@ -31,9 +31,9 @@ void SetUpLight(Light* whichsource, int whichlight) //Initialize lights if (whichlight == 0) { - GLfloat LightAmbient[] = { whichsource->ambient[0], whichsource->ambient[1], whichsource->ambient[2], 1.0f}; - GLfloat LightDiffuse[] = { whichsource->color[0], whichsource->color[1], whichsource->color[2], 1.0f }; - GLfloat LightPosition[] = { whichsource->location.x, whichsource->location.y, whichsource->location.z, 0.0f }; + GLfloat LightAmbient[] = { whichsource->ambient[0], whichsource->ambient[1], whichsource->ambient[2], 1.0f}; + GLfloat LightDiffuse[] = { whichsource->color[0], whichsource->color[1], whichsource->color[2], 1.0f }; + GLfloat LightPosition[] = { whichsource->location.x, whichsource->location.y, whichsource->location.z, 0.0f }; //glLightfv(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, qattenuation); glLightfv(GL_LIGHT0, GL_POSITION, LightPosition); @@ -63,9 +63,9 @@ void SetUpLight(Light* whichsource, int whichlight) break; } - GLfloat LightAmbient[] = { 0, 0, 0, 1.0f}; - GLfloat LightDiffuse[] = { whichsource->color[0], whichsource->color[1], whichsource->color[2], 1.0f }; - GLfloat LightPosition[] = { whichsource->location.x, whichsource->location.y, whichsource->location.z, 1.0f }; + GLfloat LightAmbient[] = { 0, 0, 0, 1.0f}; + GLfloat LightDiffuse[] = { whichsource->color[0], whichsource->color[1], whichsource->color[2], 1.0f }; + GLfloat LightPosition[] = { whichsource->location.x, whichsource->location.y, whichsource->location.z, 1.0f }; glLightfv(lightselect, GL_QUADRATIC_ATTENUATION, qattenuation); glLightfv(lightselect, GL_POSITION, LightPosition); @@ -83,9 +83,9 @@ void SetUpMainLight(Light* whichsource, int whichlight, float ambientr, float am //Initialize lights if (whichlight == 0) { - GLfloat LightAmbient[] = { ambientr, ambientg, ambientb, 1.0f}; - GLfloat LightDiffuse[] = { whichsource->color[0], whichsource->color[1], whichsource->color[2], 1.0f }; - GLfloat LightPosition[] = { whichsource->location.x, whichsource->location.y, whichsource->location.z, 1.0f }; + GLfloat LightAmbient[] = { ambientr, ambientg, ambientb, 1.0f}; + GLfloat LightDiffuse[] = { whichsource->color[0], whichsource->color[1], whichsource->color[2], 1.0f }; + GLfloat LightPosition[] = { whichsource->location.x, whichsource->location.y, whichsource->location.z, 1.0f }; glLightfv(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, qattenuation); glLightfv(GL_LIGHT0, GL_POSITION, LightPosition);