diff Render.cpp @ 2428:c99c99439f6c

Merge
author a.parshin
date Wed, 23 Jul 2014 13:32:09 +0300
parents 22ac062b40f7
children 6d5877899730
line wrap: on
line diff
--- a/Render.cpp	Wed Jul 23 13:28:30 2014 +0300
+++ b/Render.cpp	Wed Jul 23 13:32:09 2014 +0300
@@ -272,7 +272,7 @@
     }
   }
 //-------(Отсечение невидимой части карты)------------------------------------------------------------------------------------------
-  float direction = pGame->pIndoorCameraD3D->sRotationY / 256;//direction of the camera(напрвление камеры)
+  float direction = (float)(pGame->pIndoorCameraD3D->sRotationY / 256);//direction of the camera(напрвление камеры)
   //0-East(B)
   //1-NorthEast(CB)
   //2-North(C)
@@ -281,7 +281,7 @@
   //5-SouthWest(ЮЗ)
   //6-South(Ю)
   //7-SouthEast(ЮВ)
-  int Start_X, End_X, Start_Z, End_Z;
+  unsigned int Start_X, End_X, Start_Z, End_Z;
   if ( direction >= 0 && direction < 1.0 )//East(B) - NorthEast(CB)
   {
     Start_X = pODMRenderParams->uMapGridCellX - 2, End_X = 127;
@@ -507,7 +507,7 @@
   billboard.uViewportW = pViewport->uViewportBR_Y;
   pODMRenderParams->uNumBillboards = uNumBillboardsToDraw;
 
-  for (int i = 0; i < ::uNumBillboardsToDraw; ++i)
+  for (unsigned int i = 0; i < ::uNumBillboardsToDraw; ++i)
   {
     billboard.uScreenSpaceX = pBillboardRenderList[i].uScreenSpaceX;
     billboard.uScreenSpaceY = pBillboardRenderList[i].uScreenSpaceY;
@@ -574,7 +574,7 @@
   signed __int16 v46; // [sp+3Ch] [bp-4h]@12
 
   //v41 = 0;
-  for (int i = 0; i < uNumSpriteObjects; ++i)
+  for (unsigned int i = 0; i < uNumSpriteObjects; ++i)
   {
     SpriteObject* object = &pSpriteObjects[i];
     //auto v0 = (char *)&pSpriteObjects[i].uSectorID;
@@ -945,7 +945,7 @@
   int v42; // [sp+98h] [bp-Ch]@9
   int b; // [sp+A0h] [bp-4h]@22
 
-  for (int i = 0; i < uNumLevelDecorations; ++i)
+  for (unsigned int i = 0; i < uNumLevelDecorations; ++i)
   {
     //LevelDecoration* decor = &pLevelDecorations[i];
     if ((!(pLevelDecorations[i].uFlags & LEVEL_DECORATION_OBELISK_CHEST)
@@ -2187,9 +2187,6 @@
 //----- (0049EB79) --------------------------------------------------------
 Render::~Render()
 {
-  Render *v1; // esi@1
-
-  //v1 = this;
   free(this->pDefaultZBuffer);
   this->pD3DBitmaps.Release();
   this->pD3DSprites.Release();
@@ -2337,7 +2334,7 @@
   PCXHeader_2 header2; // [sp+140h] [bp-24h]@10
   char *lineRGB; // [sp+148h] [bp-1Ch]@10
   void *surface; // [sp+14Ch] [bp-18h]@8
-  int image_width; // [sp+150h] [bp-14h]@4
+  unsigned int image_width; // [sp+150h] [bp-14h]@4
   int pitch; // [sp+154h] [bp-10h]@4
   char v31; // [sp+15Ah] [bp-Ah]@25
   unsigned char pict_byte; // [sp+15Bh] [bp-9h]@17
@@ -2415,7 +2412,7 @@
         image_width = 3 * pitch;
         //v24 = 2 * v5;
         v8 = (unsigned short *)surface;
-        for ( int y = 0; y < this->GetRenderHeight(); y++ )
+        for ( unsigned int y = 0; y < this->GetRenderHeight(); y++ )
         {
           line_picture_data = v8;
           if ( GetRenderWidth() > 0 )
@@ -4970,7 +4967,7 @@
       v5 = 31 - (pSkyPolygon->dimming_level & 0x1F);
       if ( v5 < pOutdoor->max_terrain_dimming_level )
         v5 = pOutdoor->max_terrain_dimming_level;
-      for (uint i = 0; i < uNumVertices; ++i)
+      for (uint i = 0; i < (unsigned int)uNumVertices; ++i)
       {
         d3d_vertex_buffer[i].pos.x = array_507D30[i].vWorldViewProjX;
         d3d_vertex_buffer[i].pos.y = array_507D30[i].vWorldViewProjY;
@@ -4996,7 +4993,6 @@
   signed __int64 v6; // qax@3
   int v12; // edx@7
   int v13; // eax@7
-//  void *v15; // ecx@9
   int v17; // edi@9
   double v18; // st7@9
   signed int v19; // ebx@9
@@ -5004,16 +5000,8 @@
   int v21; // ebx@11
   int v22; // eax@14
   signed __int64 v23; // qtt@16
-//  double v24; // st7@16
-//  unsigned __int8 v25; // sf@16
-//  unsigned __int8 v26; // of@16
   double v28; // st7@20
-//  char *v29; // ebx@20
-//  char *v30; // edx@20
-//  unsigned __int8 v31; // c0@21
-//  unsigned __int8 v32; // c3@21
   double v33; // st6@23
-//  char *v34; // esi@30
   const void *v35; // ecx@31
   int v36; // eax@31
   const void *v37; // edi@31
@@ -5023,24 +5011,12 @@
   int v41; // eax@36
   signed __int64 v42; // qtt@39
   int v43; // eax@39
-//  char v44; // zf@39
-//  double v45; // st7@39
-//  double v46; // st7@39
-//  unsigned int v47; // edx@40
   double v48; // st7@41
-//  RenderVertexSoft *v49; // ebx@41
-//  void *v50; // edi@43
   double v51; // st7@46
-//  RenderVertexSoft *v52; // edx@46
-//  void *v53; // edi@48
-//  signed int v59; // [sp-4h] [bp-178h]@17
-//  struct Polygon *v60; // [sp+0h] [bp-174h]@17
-//  IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17
   struct Polygon pSkyPolygon; // [sp+14h] [bp-160h]@6
   unsigned int v63; // [sp+120h] [bp-54h]@7
   unsigned int v65; // [sp+128h] [bp-4Ch]@1
   unsigned int v66; // [sp+12Ch] [bp-48h]@7
-  //float v67; // [sp+130h] [bp-44h]@7
   __int64 v69; // [sp+13Ch] [bp-38h]@3
   int v70; // [sp+144h] [bp-30h]@3
   int X; // [sp+148h] [bp-2Ch]@9
@@ -6225,7 +6201,6 @@
 void Render::_4A4CC9_AddSomeBillboard(stru6_stru1_indoor_sw_billboard *a1, int diffuse)
 {
   unsigned int v5; // eax@7
-//  char *v7; // edx@8
   double v10; // st6@9
   double v11; // st6@10
   int v12; // ebx@13
@@ -6234,7 +6209,7 @@
     return;
 
   float depth = 1000000.0;
-  for (uint i = 0; i < a1->uNumVertices; ++i)
+  for (uint i = 0; i < (unsigned int)a1->uNumVertices; ++i)
   {
     if (a1->field_104[i].z < depth)
       depth = a1->field_104[i * 4].z;
@@ -6248,7 +6223,7 @@
   pBillboardRenderListD3D[v5].uNumVertices = a1->uNumVertices;
   pBillboardRenderListD3D[v5].z_order = depth;
 
-  for (uint i = 0; i < a1->uNumVertices; ++i)
+  for (uint i = 0; i < (unsigned int)a1->uNumVertices; ++i)
   {
     pBillboardRenderListD3D[v5].pQuads[i].pos.x = a1->field_104[i].x;
     pBillboardRenderListD3D[v5].pQuads[i].pos.y = a1->field_104[i].y;
@@ -6332,7 +6307,7 @@
         bMipMaps = 0;
         v13 = pHWLTexture->pPixels;
         v14 = (unsigned __int16 *)desc.lpSurface;
-        for(int bMipMaps = 0; bMipMaps < desc.dwHeight; bMipMaps++)
+        for(uint bMipMaps = 0; bMipMaps < desc.dwHeight; bMipMaps++)
         {
           for (v15 = 0; v15 < desc.dwWidth; v15++)
           {
@@ -6377,9 +6352,9 @@
     {
       v9 = sprite_texture->pPixels;
       v10 = Dst.lpSurface;
-      for (int i=0; i<sprite_texture->uHeight; ++i)
-      {
-        for (int j=0; j<sprite_texture->uWidth/2; ++j)
+      for (uint i=0; i<sprite_texture->uHeight; ++i)
+      {
+        for (uint j=0; j<sprite_texture->uWidth/2; ++j)
         {
           *(int *)v10 = *(int *)v9;
           v9 += 2;
@@ -6930,7 +6905,7 @@
       }
     }
 
-    for (int y = 0; y < v6; ++y)
+    for (uint y = 0; y < v6; ++y)
     {
       for (int x = 0; x < v5; ++x)
       {
@@ -7117,9 +7092,9 @@
       }
     }
 
-    for (int y = 0; y < v10; ++y)
-    {
-      for (int x = 0; x < v9; ++x)
+    for (uint y = 0; y < v10; ++y)
+    {
+      for (uint x = 0; x < v9; ++x)
       {
         if (*v24)
         {
@@ -7234,7 +7209,7 @@
     if ( a8 )
     {
       v28 = 0x7FF; // 16bit pRenderer->uTargetGMask | pRenderer->uTargetBMask;
-      for (int dy = 0; dy < v9; ++dy)
+      for (uint dy = 0; dy < v9; ++dy)
       {
         for (int dx = 0; dx < v8; ++dx)
         {
@@ -7282,7 +7257,7 @@
     }
     else
     {
-      for (int dy = 0; dy < v9; ++dy)
+      for (uint dy = 0; dy < v9; ++dy)
       {
         for (int dx = 0; dx < v8; ++dx)
         {
@@ -7509,7 +7484,7 @@
         }
         
           v16 = v19;
-        for (int y = 0; y < v5; ++y)
+        for (uint y = 0; y < v5; ++y)
         {
           for (int x = 0; x < v20; ++x)
           {
@@ -7608,7 +7583,7 @@
       }
     }
 
-    for (int dy = 0; dy < uHeight; ++dy)
+    for (uint dy = 0; dy < uHeight; ++dy)
     {
       for (int dx = 0; dx < Width; ++dx)
       {
@@ -8255,7 +8230,7 @@
       pPaletteManager->RecalculateAll();
       pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
       pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits);
-      for (int i = 0; i < pObjectList->uNumObjects; i++)
+      for (uint i = 0; i < pObjectList->uNumObjects; i++)
       {
         BYTE3(v4) = 0;
         v5 = &pObjectList->pObjects[i];
@@ -8442,7 +8417,7 @@
     v5 = this->pFile;
     this->uDataOffset = v4;
     fwrite(&this->uNumItems, 4u, 1u, v5);
-    for (int i = 0; i < this->uNumItems; i++)
+    for (uint i = 0; i < this->uNumItems; i++)
     {
       fwrite(this->pSpriteNames[i], 1u, 0x14u, this->pFile);
       fprintf(File, "D3D texture name:  %s\t\toffset: %x\n", this->pSpriteNames[i], *(unsigned int *)(&(this->pSpriteNames[i]) + 200000/sizeof(char*)));
@@ -8456,7 +8431,7 @@
   else
   {
     fclose(this->pFile);
-    for (int i = 0; i < this->uNumItems; i++)
+    for (uint i = 0; i < this->uNumItems; i++)
     {
       free(this->pSpriteNames[i]);
     }
@@ -8660,7 +8635,7 @@
   //  v2                     v1
 
   int out_num_vertices = 0;
-  for (int i = 0; i < num_vertices; ++i)
+  for (uint i = 0; i < num_vertices; ++i)
   {
     next_vertices_flag = array_50AC10[i + 1].vWorldViewPosition.x <= 8.0;//
     if ( current_vertices_flag ^ next_vertices_flag )
@@ -8808,7 +8783,7 @@
   unused = 0;
   if ( (signed int)pOutdoor->uNumBModels > 0 )
   {
-    for ( uint model_id = 0; model_id < pOutdoor->uNumBModels; model_id++ )
+    for ( uint model_id = 0; model_id < (unsigned int)pOutdoor->uNumBModels; model_id++ )
     {
       if ( IsBModelVisible(model_id, &unused) )
       {
@@ -9186,9 +9161,9 @@
 
   if ( LockSurface_DDraw4(pBackBuffer4, &Dst, DDLOCK_WAIT) )
   {
-    for (uint y = 0; y < height; ++y)
-    {
-      for (uint x = 0; x < width; ++x)
+    for (uint y = 0; y < (unsigned int)height; ++y)
+    {
+      for (uint x = 0; x < (unsigned int)width; ++x)
       {
         //*v3 = pRenderer->ReadPixel16((int)(x* interval_x + 8.0), (int)(y * interval_y + 8.0));//screen_data[screen_y + (int)(x* interval_x + 8.0)];
 		  /*
@@ -9543,7 +9518,7 @@
   else
     color_mult = pDecal->field_C18->_43B570_get_color_mult_by_time();
 
-  for (uint i = 0; i < pDecal->uNumVertices; ++i)
+  for (uint i = 0; i < (unsigned int)pDecal->uNumVertices; ++i)
   {
     uint uTint = Render::GetActorTintColor(pDecal->pVertices[i].vWorldViewPosition.x, pDecal->field_C14, 0, 0, nullptr);