diff UI/Books/UIMapBook.cpp @ 2169:5b27c035a241

small cleaning
author Ritor1
date Mon, 20 Jan 2014 00:02:22 +0600
parents 00bd098f6435
children 42c8807225a2
line wrap: on
line diff
--- a/UI/Books/UIMapBook.cpp	Fri Jan 17 22:44:57 2014 +0600
+++ b/UI/Books/UIMapBook.cpp	Mon Jan 20 00:02:22 2014 +0600
@@ -433,12 +433,12 @@
             v20 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y - pCenterY;
             v95 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX;
 
-            v88 = (unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16;
-            v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)viewparams->uMapBookMapZoom) >> 16;
-            v93 = (unsigned __int16 *)((unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16);
-            screenHeight = (unsigned __int64)(v20 * (signed __int64)viewparams->uMapBookMapZoom) >> 16;
+            v88 = fixpoint_mul((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom);
+            v87 = fixpoint_mul(screenHeight, viewparams->uMapBookMapZoom);
+            v93 = (unsigned __int16 *)(fixpoint_mul((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom));
+            screenHeight = fixpoint_mul(v20, viewparams->uMapBookMapZoom);
             pRenderer->RasterLine2D(screenCenter_X + v88, screenCenterY - v87,
-              screenCenter_X + ((unsigned __int64)((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16), screenCenterY - screenHeight, black);
+              screenCenter_X + (fixpoint_mul((pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)), screenCenterY - screenHeight, black);
           }
         }
       }
@@ -452,32 +452,32 @@
         v28 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex1ID].y - pCenterY;
         v29 = pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[j]].uVertex2ID].y - pCenterY;
 
-        v87 = (unsigned __int64)((signed int)v27 * (signed __int64)viewparams->uMapBookMapZoom) >> 16;
-        v88 = (unsigned __int64)(v28 * (signed __int64)viewparams->uMapBookMapZoom) >> 16;
-        uint i = (unsigned __int64)((v26 - pCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16;
-        v95 = (unsigned __int64)(v29 * (signed __int64)viewparams->uMapBookMapZoom) >> 16;
-        pRenderer->RasterLine2D(screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)viewparams->uMapBookMapZoom) >> 16),
-          screenCenterY - v88, screenCenter_X + ((unsigned __int64)((v26 - pCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16), screenCenterY - v95, teal);
+        v87 = fixpoint_mul((signed int)v27, viewparams->uMapBookMapZoom);
+        v88 = fixpoint_mul(v28, viewparams->uMapBookMapZoom);
+        uint i = fixpoint_mul((v26 - pCenterX), viewparams->uMapBookMapZoom);
+        v95 = fixpoint_mul(v29, viewparams->uMapBookMapZoom);
+        pRenderer->RasterLine2D(screenCenter_X + (fixpoint_mul((signed int)v27, viewparams->uMapBookMapZoom)),
+          screenCenterY - v88, screenCenter_X + (fixpoint_mul((v26 - pCenterX), viewparams->uMapBookMapZoom)), screenCenterY - v95, teal);
       }
       viewparams->sViewCenterX = pCenterX;
     }
   }
-  v47 = ((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X - 3;
-  v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - pCenterY) * (signed __int64)viewparams->uMapBookMapZoom) >> 16);
+  v47 = (fixpoint_mul((pParty->vPosition.x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)) + screenCenter_X - 3;
+  v97 = (const void *)(fixpoint_mul((pParty->vPosition.y - pCenterY), viewparams->uMapBookMapZoom));
   v48 = 1;
   v49 = screenCenterY - (int)v97 - 3;
   if ( v47 >= (signed int)tl_x )
   {
     if ( v47 > (signed int)br_x )
     {
-      if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X - 6) > (signed int)br_x )
+      if ( (signed int)((fixpoint_mul((pParty->vPosition.x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)) + screenCenter_X - 6) > (signed int)br_x )
         v48 = 0;
       v47 = br_x;
     }
   }
   else
   {
-    if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - viewparams->sViewCenterX) * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X) < (signed int)tl_x )
+    if ( (signed int)((fixpoint_mul((pParty->vPosition.x - viewparams->sViewCenterX), viewparams->uMapBookMapZoom)) + screenCenter_X) < (signed int)tl_x )
       v48 = 0;
     v47 = tl_x;
   }
@@ -525,8 +525,8 @@
       {
         screenHeight = pLevelDecorations[i].vPosition.y - pCenterY;
         v93 = (unsigned __int16 *)(pLevelDecorations[i].vPosition.x - viewparams->sViewCenterX);
-        v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X;
-        v97 = (const void *)((unsigned __int64)(screenHeight * (signed __int64)viewparams->uMapBookMapZoom) >> 16);
+        v54 = (fixpoint_mul((signed int)v93, viewparams->uMapBookMapZoom)) + screenCenter_X;
+        v97 = (const void *)(fixpoint_mul(screenHeight, viewparams->uMapBookMapZoom));
         v55 = screenCenterY - (int)v97;
         //if ( v54 >= pRenderer->raster_clip_x && v54 <= pRenderer->raster_clip_z
         //  && v55 >= pRenderer->raster_clip_y && v55 <= pRenderer->raster_clip_w )
@@ -539,7 +539,7 @@
           }
           else
             pRenderer->RasterLine2D(v54, screenCenterY - (int)v97,
-                   ((unsigned __int64)((signed int)v93 * (signed __int64)viewparams->uMapBookMapZoom) >> 16) + screenCenter_X,
+                   (fixpoint_mul((signed int)v93, viewparams->uMapBookMapZoom)) + screenCenter_X,
                    screenCenterY - (int)v97, Color16(0xFFu, 0xFFu, 0xFFu));
         }
       }