Take Zoom into account when querying ClrModMap for mesh rendering

stable-5.2
Armin Burgmeier 2009-07-27 22:29:09 -04:00
parent 6da0846c87
commit b5796d6a08
1 changed files with 10 additions and 2 deletions

View File

@ -341,7 +341,6 @@ namespace
glMaterialfv(GL_FRONT, GL_DIFFUSE, Diffuse);
glMaterialfv(GL_FRONT, GL_SPECULAR, Specular);
glTexCoord2f(vtx.u, vtx.v);
glTexCoord2f(vtx.u, vtx.v);
glNormal3f(vtx.nx, vtx.ny, vtx.nz);
glVertex3f(vtx.x, vtx.y, vtx.z);
@ -353,11 +352,14 @@ void CStdGL::PerformMesh(StdMeshInstance &instance, float tx, float ty, float tw
const StdMesh& mesh = instance.Mesh;
const StdMeshBox& box = mesh.GetBoundingBox();
glPushMatrix();
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
// Apply zoom
glTranslatef(ZoomX, ZoomY, 0.0f);
glScalef(Zoom, Zoom, 1.0f);
@ -384,6 +386,7 @@ void CStdGL::PerformMesh(StdMeshInstance &instance, float tx, float ty, float tw
// Put a light source in front of the object
const GLfloat light_position[] = { 0.0f, 0.0f, 15.0f*Zoom, 1.0f };
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glEnable(GL_LIGHT0);
// TODO: Find a working technique, we currently always use the
@ -399,6 +402,11 @@ void CStdGL::PerformMesh(StdMeshInstance &instance, float tx, float ty, float tw
Transform.SetMoveScale(dx, dy, scx, scy);
if(pTransform) Transform *= *pTransform;
// TODO: Is the following correct?
Transform.MoveScale(-ZoomX, -ZoomY, 1.0f, 1.0f);
Transform.MoveScale(0.0f, 0.0f, Zoom, Zoom);
Transform.MoveScale(ZoomX, ZoomY, 1.0f, 1.0f);
CClrModAddMap* ClrModMap = fUseClrModMap ? pClrModMap : NULL;
DWORD dwModClr = BlitModulated ? BlitModulateClr : 0xffffff;