changeset 657:7747161ea5b5

RenderBillboard member rename
author Nomad
date Wed, 13 Mar 2013 01:29:33 +0200
parents 431a8b0c2bf1
children cec42951eda0
files Indoor.cpp Outdoor.cpp Render.cpp Render.h mm7_5.cpp mm7_data.h
diffstat 6 files changed, 24 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Tue Mar 12 08:30:17 2013 +0200
+++ b/Indoor.cpp	Wed Mar 13 01:29:33 2013 +0200
@@ -129,7 +129,7 @@
     }
     v6 = i + 1;
   }
-  MessWithBillboards_BLV();
+  FindBillboardsLightLevels_BLV();
   pGame->PrepareBloodsplats();
 }
 
--- a/Outdoor.cpp	Tue Mar 12 08:30:17 2013 +0200
+++ b/Outdoor.cpp	Wed Mar 13 01:29:33 2013 +0200
@@ -3151,7 +3151,7 @@
         v28->world_z = z;
         HIWORD(v34) = HIWORD(X);
         LOWORD(v34) = 0;
-        v28->uPaletteSubindex = 0;
+        v28->dimming_level = 0;
         v28->sZValue = v34 + (8 * i | OBJECT_Actor);
         v28->field_14_actor_id = i;
         v35 = pMonsterList->pMonsters;
@@ -3159,7 +3159,7 @@
         v28->field_1E = v62 | 0x200;
         v28->pSpriteFrame = v15;
         v28->uTintColor = *((int *)&v35[v36] - 36);
-        if (actor->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime > 0)
+        if (actor->pActorBuffs[ACTOR_BUFF_STONED].uExpireTime)
           v28->field_1E = v62 | 0x200;
       }
 //LABEL_58:
--- a/Render.cpp	Tue Mar 12 08:30:17 2013 +0200
+++ b/Render.cpp	Wed Mar 13 01:29:33 2013 +0200
@@ -208,10 +208,10 @@
       if ( v2 != -1 )
       {
         if ( pRenderer->pRenderD3D )
-          pRenderer->DrawBillboard_Indoor(&soft_billboard, &pSprites_LOD->pHardwareSprites[v2], p->uPaletteSubindex);
+          pRenderer->DrawBillboard_Indoor(&soft_billboard, &pSprites_LOD->pHardwareSprites[v2], p->dimming_level);
         else
         {
-          soft_billboard.pPalette = PaletteManager::Get_Dark_or_Red_LUT(p->uPalette, p->uPaletteSubindex, 1);
+          soft_billboard.pPalette = PaletteManager::Get_Dark_or_Red_LUT(p->uPalette, p->dimming_level, 1);
           if (p->field_1E & 0x0100)
             soft_billboard.pPalette = pPaletteManager->field_261600[p->uPalette];
           if ( !(soft_billboard.uFlags & 0x40) && soft_billboard.uFlags & 0x80 )
@@ -3027,7 +3027,7 @@
       if (pRenderer->pRenderD3D)
         pRenderer->TransformBillboard(&billboard,
                                       &pSprites_LOD->pHardwareSprites[pBillboard->uHwSpriteID],
-                                      pBillboard->uPaletteSubindex, pBillboard);
+                                      pBillboard->dimming_level, pBillboard);
       else
       {
           assert(false);
@@ -3239,7 +3239,7 @@
                   LOWORD(v26) = 0;
                   v27 = (object->uAttributes & 0x20) == 0;
                   v3->sZValue = v26 + (8 * i | OBJECT_Item);
-                  v3->uPaletteSubindex = 0;
+                  v3->dimming_level = 0;
                   v3->uTintColor = 0;
                   if ( !v27 )
                   {
@@ -3747,7 +3747,7 @@
                     LOWORD(v30) = 0;
                     v27->uIndoorSectorID = 0;
                     v27->sZValue = v30 + v31;
-                    v27->uPaletteSubindex = 0;
+                    v27->dimming_level = 0;
                     v27->pSpriteFrame = v8;
                     v27->uTintColor = 0;
                   }
@@ -8075,7 +8075,7 @@
 
 
 //----- (004A43B1) --------------------------------------------------------
-void Render::DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *a3, int uPaletteSubindex)
+void Render::DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *a3, int dimming_level)
 {
   RenderBillboardTransform_local0 *v4; // ebx@2
   double v5; // st7@2
@@ -8116,10 +8116,10 @@
     pSoftBillboarda = v5;
     v6 = v5;
     v7 = Billboard_ProbablyAddToListAndSortByZOrder(LODWORD(v6));
-    v8 = uPaletteSubindex;
+    v8 = dimming_level;
     v9 = v7;
-    v28 = uPaletteSubindex & 0xFF000000;
-    if ( uPaletteSubindex & 0xFF000000 )
+    v28 = dimming_level & 0xFF000000;
+    if ( dimming_level & 0xFF000000 )
       pBillboardRenderListD3D[v9].uOpacity = RenderBillboardD3D::Opaque_3;
     else
       pBillboardRenderListD3D[v9].uOpacity = RenderBillboardD3D::Transparent;
@@ -8137,14 +8137,14 @@
       v31 = v31 * -1.0;
     if ( v4->uTintColor && v26->bTinting )
     {
-      v11 = ::GetActorTintColor(v8, 0, pSoftBillboarda, 0, 0);
+      v11 = ::GetActorTintColor(dimming_level, 0, pSoftBillboarda, 0, 0);
       v12 = sub_4A19D8(v4->uTintColor, v11);
       if ( v28 )
         v12 = (unsigned int)((char *)&array_77EC08[1852].pEdgeList1[17] + 3) & ((unsigned int)v12 >> 1);
     }
     else
     {
-      v12 = ::GetActorTintColor(v8, 0, pSoftBillboarda, 0, 0);
+      v12 = ::GetActorTintColor(dimming_level, 0, pSoftBillboarda, 0, 0);
     }
     v13 = (double)v25;
     pBillboardRenderListD3D[v9].pQuards[0].specular = 0;
@@ -8554,7 +8554,7 @@
 
 
 //----- (004A4023) --------------------------------------------------------
-void Render::TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int paletteSubindex, RenderBillboard *pBillboard)
+void Render::TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int dimming_level, RenderBillboard *pBillboard)
 {
   unsigned int v8; // esi@2
   double v14; // st6@14
@@ -8581,7 +8581,7 @@
   v30 = (a2->_screenspace_x_scaler_packedfloat & 0xFFFF) / 65530.0 + HIWORD(a2->_screenspace_x_scaler_packedfloat);
   v29 = (a2->_screenspace_y_scaler_packedfloat & 0xFFFF) / 65530.0 + HIWORD(a2->_screenspace_y_scaler_packedfloat);
 
-  unsigned int diffuse = ::GetActorTintColor(paletteSubindex, 0, a2->zbuffer_depth, 0, pBillboard);
+  unsigned int diffuse = ::GetActorTintColor(dimming_level, 0, a2->zbuffer_depth, 0, pBillboard);
   if (a2->uTintColor & 0x00FFFFFF && bTinting)
   {
     diffuse = sub_4A19D8(a2->uTintColor, diffuse);
--- a/Render.h	Tue Mar 12 08:30:17 2013 +0200
+++ b/Render.h	Wed Mar 13 01:29:33 2013 +0200
@@ -75,7 +75,7 @@
   __int16 world_z;
   __int16 uScreenSpaceX;
   __int16 uScreenSpaceY;
-  unsigned __int16 uPaletteSubindex;
+  unsigned __int16 dimming_level;
   unsigned int uTintColor;
   SpriteFrame *pSpriteFrame;
 
@@ -328,8 +328,8 @@
   void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, Texture *pTex, int uPackedID, unsigned int uColor, int a8);
   void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
   void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
-  void TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int paletteSubindex, RenderBillboard *pBillboard);
-  void DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *a3, int uPaletteSubindex);
+  void TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int dimming_level, RenderBillboard *pBillboard);
+  void DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *a3, int dimming_level);
   int MakeParticleBillboardAndPush_BLV_Software(int screenSpaceX, int screenSpaceY, int z, int lightColor, int a6);
   void DrawProjectile(float srcX, float srcY, float a3, float a4, float dstX, float dstY, float a7, float a8, IDirect3DTexture2 *a9);
   void _4A4CC9(struct stru6_stru1_indoor_sw_billboard *a1, int a2);
--- a/mm7_5.cpp	Tue Mar 12 08:30:17 2013 +0200
+++ b/mm7_5.cpp	Wed Mar 13 01:29:33 2013 +0200
@@ -9276,16 +9276,16 @@
 
 
 //----- (0043F515) --------------------------------------------------------
-void MessWithBillboards_BLV()
+void FindBillboardsLightLevels_BLV()
 {
   for (uint i = 0; i < uNumBillboardsToDraw; ++i)
   {
     auto p = pBillboardRenderList + i;
 
     if (p->field_1E & 2 || uCurrentlyLoadedLevelType == LEVEL_Indoor && !p->uIndoorSectorID)
-      p->uPaletteSubindex = 0;
+      p->dimming_level = 0;
     else
-      p->uPaletteSubindex = _43F55F_get_billboard_light_level(p, -1);
+      p->dimming_level = _43F55F_get_billboard_light_level(p, -1);
   }
 }
 
@@ -9301,7 +9301,7 @@
   else
   {
     if ( uBaseLightLevel == -1 )
-      v3 = a1->uPaletteSubindex;
+      v3 = a1->dimming_level;
     else
       v3 = uBaseLightLevel;
   }
--- a/mm7_data.h	Tue Mar 12 08:30:17 2013 +0200
+++ b/mm7_data.h	Wed Mar 13 01:29:33 2013 +0200
@@ -1981,7 +1981,7 @@
 void __fastcall PrepareDrawLists_BLV(struct IndoorLocation_drawstru *_this);
 int /*__usercall*/ sr_sub_4D6FB0/*<eax>*/(struct stru315 *a1/*<ebp>*/);
 int /*__usercall*/ sr_sub_4D705A/*<eax>*/(struct stru315 *a1/*<ebp>*/);
-void __cdecl MessWithBillboards_BLV();
+void __cdecl FindBillboardsLightLevels_BLV();
 int __fastcall _43F55F_get_billboard_light_level(struct RenderBillboard *a1, int uBaseLightLevel);
 int __fastcall _43F5C8_get_point_light_level_with_respect_to_lights(unsigned int uBaseLightLevel, int uSectorID, float x, float y, float z);
 void PrepareBspRenderList_BLV();