diff Render.cpp @ 2006:30c2b575d25c

signed fixes DamagePlayerFromMonster -1 indexing
author zipi
date Wed, 06 Nov 2013 13:06:02 +0000
parents 2e6c63bdcfa9
children 7a2fc95f3b99
line wrap: on
line diff
--- a/Render.cpp	Wed Nov 06 00:09:47 2013 -0800
+++ b/Render.cpp	Wed Nov 06 13:06:02 2013 +0000
@@ -185,7 +185,7 @@
       soft_billboard._screenspace_y_scaler_packedfloat = p->_screenspace_y_scaler_packedfloat;
       soft_billboard.sZValue = p->sZValue;
       soft_billboard.uFlags = p->field_1E;
-      soft_billboard.uTintColor = p->uTintColor;
+      soft_billboard.sTintColor = p->sTintColor;
       v2 = p->uHwSpriteID;
       if ( v2 != -1 )
       {
@@ -425,7 +425,7 @@
     billboard.uScreenSpaceY = pBillboard->uScreenSpaceY;
     billboard.sParentBillboardID = i;
     billboard._screenspace_x_scaler_packedfloat = pBillboard->_screenspace_x_scaler_packedfloat;
-    billboard.uTintColor = pBillboard->uTintColor;
+    billboard.sTintColor = pBillboard->sTintColor;
     billboard._screenspace_y_scaler_packedfloat = pBillboard->_screenspace_y_scaler_packedfloat;
     billboard.sZValue = pBillboard->sZValue;
     billboard.uFlags = pBillboard->field_1E;
@@ -647,7 +647,7 @@
                   v27 = (object->uAttributes & 0x20) == 0;
                   v3->sZValue = v26 + (PID(OBJECT_Item,i));
                   v3->dimming_level = 0;
-                  v3->uTintColor = 0;
+                  v3->sTintColor = 0;
                   if ( !v27 )
                   {
                     if ( !pRenderer->pRenderD3D )
@@ -1149,7 +1149,7 @@
                   v27->sZValue = v30 + v31;
                   v27->dimming_level = 0;
                   v27->pSpriteFrame = v8;
-                  v27->uTintColor = 0;
+                  v27->sTintColor = 0;
                 }
               }
               goto LABEL_38;
@@ -1878,7 +1878,7 @@
   unsigned int v55; // [sp+5Ch] [bp-Ch]@34
   unsigned int v56; // [sp+60h] [bp-8h]@12
   int v57; // [sp+60h] [bp-8h]@34
-  unsigned int a2; // [sp+64h] [bp-4h]@4
+  signed int a2; // [sp+64h] [bp-4h]@4
 
   v5 = this;
   v6 = 0;
@@ -1888,7 +1888,7 @@
     v53 = v7;
     v54 = v7->std__vector_000004_size;
     if ( v7->std__vector_000004_size)
-      a2 = 0xFFFFFFFF;
+      a2 = -1;
     pGame->AlterGamma_ODM(a4, &a2);
     if ( byte_4D864C && pGame->uFlags & GAME_FLAGS_1_01)
     {
@@ -5421,18 +5421,18 @@
     //v59 = pGame->pLightmapBuilder;
     //v9 = v59->std__vector_000004_size;
 
-  uint uCorrectedColor = uColor;
+  int sCorrectedColor = uColor;
   if (pGame->pLightmapBuilder->std__vector_000004_size)
-    uCorrectedColor = 0xFFFFFFFF;
-  pGame->AlterGamma_BLV(pFace, &uCorrectedColor);
+    sCorrectedColor = -1;
+  pGame->AlterGamma_BLV(pFace, &sCorrectedColor);
 
 
   if (pFace->uAttributes & FACE_OUTLINED)
   {
     int color;
     if (GetTickCount() % 300 >= 150)
-      uColor = uCorrectedColor = 0xFF20FF20;
-    else uColor = uCorrectedColor = 0xFF109010;
+      uColor = sCorrectedColor = 0xFF20FF20;
+    else uColor = sCorrectedColor = 0xFF109010;
   }
 
   if (byte_4D864C && pGame->uFlags & GAME_FLAGS_1_01)
@@ -5446,7 +5446,7 @@
 		d3d_vertex_buffer[i].pos.y = array_507D30[i].vWorldViewProjY;
 		d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / (array_507D30[i].vWorldViewPosition.x * 0.061758894);
 		d3d_vertex_buffer[i].rhw = 1.0 / array_507D30[i].vWorldViewPosition.x;
-		d3d_vertex_buffer[i].diffuse = uCorrectedColor;
+		d3d_vertex_buffer[i].diffuse = sCorrectedColor;
 		d3d_vertex_buffer[i].specular = 0;
 		d3d_vertex_buffer[i].texcoord.x = array_507D30[i].u / (double)pTex->uTextureWidth;
 		d3d_vertex_buffer[i].texcoord.y = array_507D30[i].v / (double)pTex->uTextureHeight;
@@ -5473,7 +5473,7 @@
         d3d_vertex_buffer[i].pos.y = array_507D30[i].vWorldViewProjY;
         d3d_vertex_buffer[i].pos.z = 1.0 - 1.0 / (array_507D30[i].vWorldViewPosition.x * 0.061758894);
         d3d_vertex_buffer[i].rhw = 1.0 / array_507D30[i].vWorldViewPosition.x;
-        d3d_vertex_buffer[i].diffuse = uCorrectedColor;
+        d3d_vertex_buffer[i].diffuse = sCorrectedColor;
         d3d_vertex_buffer[i].specular = 0;
         d3d_vertex_buffer[i].texcoord.x = array_507D30[i].u / (double)pTex->uTextureWidth;
         d3d_vertex_buffer[i].texcoord.y = array_507D30[i].v / (double)pTex->uTextureHeight;
@@ -5543,7 +5543,7 @@
         pGame->pLightmapBuilder->DrawLightmaps(/*-1, 0*/);
 
         for (uint i = 0; i < uNumVertices; ++i)
-          d3d_vertex_buffer[i].diffuse = uCorrectedColor;
+          d3d_vertex_buffer[i].diffuse = sCorrectedColor;
         /*v33 = uNumVertices;
         if ( (signed int)uNumVertices > 0 )
         {
@@ -5636,10 +5636,10 @@
     v27 = (double)(pSprite->uBufferHeight - pSprite->uAreaY);
     if ( pSoftBillboard->uFlags & 4 )
       v31 = v31 * -1.0;
-    if ( pSoftBillboard->uTintColor && this->bTinting )
+    if ( pSoftBillboard->sTintColor && this->bTinting )
     {
       v11 = ::GetActorTintColor(dimming_level, 0, pSoftBillboard->zbuffer_depth, 0, 0);
-      v12 = BlendColors(pSoftBillboard->uTintColor, v11);
+      v12 = BlendColors(pSoftBillboard->sTintColor, v11);
       if ( v28 )
         v12 = (unsigned int)((char *)&array_77EC08[1852].pEdgeList1[17] + 3) & ((unsigned int)v12 >> 1);
     }
@@ -6079,10 +6079,10 @@
   v29 = (a2->_screenspace_y_scaler_packedfloat & 0xFFFF) / 65530.0 + HIWORD(a2->_screenspace_y_scaler_packedfloat);
 
   unsigned int diffuse = ::GetActorTintColor(dimming_level, 0, a2->zbuffer_depth, 0, pBillboard);
-  if (a2->uTintColor & 0x00FFFFFF && bTinting)
-  {
-    diffuse = BlendColors(a2->uTintColor, diffuse);
-    if (a2->uTintColor & 0xFF000000)
+  if (a2->sTintColor & 0x00FFFFFF && bTinting)
+  {
+    diffuse = BlendColors(a2->sTintColor, diffuse);
+    if (a2->sTintColor & 0xFF000000)
       diffuse = 0x007F7F7F & ((unsigned int)diffuse >> 1);
   }
 
@@ -6149,7 +6149,7 @@
   pBillboardRenderListD3D[v8].sZValue = a2->sZValue;
   pBillboardRenderListD3D[v8].sParentBillboardID = a2->sParentBillboardID;
 
-  if (a2->uTintColor & 0xFF000000)
+  if (a2->sTintColor & 0xFF000000)
     pBillboardRenderListD3D[v8].uOpacity = RenderBillboardD3D::Opaque_3;
   else
     pBillboardRenderListD3D[v8].uOpacity = RenderBillboardD3D::Transparent;
@@ -8334,14 +8334,14 @@
       SetUserInterface(pParty->alignment, true);
       if ( pVideoPlayer->pVideoFrame.pPixels )
         pVideoPlayer->pVideoFrame.Load(pVideoPlayer->pVideoFrameTextureFilename, 1);
-      if ( uCurrentMenuID != MENU_CREATEPARTY )
-      {
-        if ( uCurrentMenuID == MENU_CREDITSPROC )
+      if ( sCurrentMenuID != MENU_CREATEPARTY )
+      {
+        if ( sCurrentMenuID == MENU_CREDITSPROC )
           dword_A74C88 = 1; 
       }
       else
       {
-        if ( uCurrentMenuID )
+        if ( sCurrentMenuID )
         {
           v6 = &pTexture_PCX;
           pTexture_PCX.Release();
@@ -8352,7 +8352,7 @@
           v6 = &pTexture_PCX;
           pTexture_PCX.Release();
           v8 = "title.pcx";
-          if ( uCurrentMenuID )
+          if ( sCurrentMenuID )
             v8 = "lsave640.pcx";
         }
         v6->Load(v8, 0);
@@ -8632,6 +8632,7 @@
     if (p->uOpacity != RenderBillboardD3D::NoBlend)
       SetBillboardBlendOptions(p->uOpacity);
     
+	//if((int)p->pTexture!=0xcdcdcdcd)
     pRenderer->pRenderD3D->pDevice->SetTexture(0, p->pTexture);
     ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN,
                                                          D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
@@ -9054,8 +9055,8 @@
                         - (double)pGame->pIndoorCameraD3D->vPartyPos.z));
   pSkyPolygon.Create_48607B(&stru_8019C8);//заполняется ptr_38
   pSkyPolygon.ptr_38->_48694B_frustum_sky();
-  pSkyPolygon.uTileBitmapID = pOutdoor->uSky_TextureID;//179(original 166)
-  pSkyPolygon.pTexture = (Texture *)(SLOWORD(pOutdoor->uSky_TextureID) != -1 ? (int)&pBitmaps_LOD->pTextures[SLOWORD(pOutdoor->uSky_TextureID)] : 0);
+  pSkyPolygon.uTileBitmapID = pOutdoor->sSky_TextureID;//179(original 166)
+  pSkyPolygon.pTexture = (Texture *)(SLOWORD(pOutdoor->sSky_TextureID) != -1 ? (int)&pBitmaps_LOD->pTextures[SLOWORD(pOutdoor->sSky_TextureID)] : 0);
   if ( pSkyPolygon.pTexture )
   {
     pSkyPolygon.dimming_level = 0;