diff Arcomage.cpp @ 2216:3f375342de12

window->GetWidth() continue
author Ritor1
date Sat, 15 Feb 2014 16:00:19 +0600
parents e9625ad08541
children aff7a7b072b7
line wrap: on
line diff
--- a/Arcomage.cpp	Fri Feb 14 18:08:30 2014 +0600
+++ b/Arcomage.cpp	Sat Feb 15 16:00:19 2014 +0600
@@ -651,7 +651,8 @@
       {
         if ( *src_surf_pos != v10 )
         {
-          if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= 639 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= 479)
+          if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= window->GetWidth() - 1 
+            && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= window->GetHeight() - 1)
             WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, *src_surf_pos);
         }
         ++src_surf_pos;
@@ -668,7 +669,8 @@
       {
         if ( *src_surf_pos != v10 )
         {
-          if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= 639 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= 479)
+          if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= window->GetWidth() - 1
+            && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= window->GetHeight() - 1)
           //WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (v21 & (ReadPixel16(pTargetPoint->x + j, pTargetPoint->y + i) >> 1)) + (v21 & (*src_surf_pos >> 1)));
             WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (0x7BEF & (*src_surf_pos / 2)));
         }
@@ -724,7 +726,8 @@
       { 
         if ( *src_surf_pos != v21 )
         {
-          if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= 639 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= 479)
+          if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= window->GetWidth() - 1 
+            && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= window->GetHeight() - 1)
             WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, *src_surf_pos);
         }
         ++src_surf_pos;
@@ -741,7 +744,8 @@
       {
         if ( *src_surf_pos != v21 )
         {
-          if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= 639 && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= 479)
+          if ( pTargetPoint->x + j >= 0 && pTargetPoint->x + j <= window->GetWidth() - 1
+            && pTargetPoint->y + i >= 0 && pTargetPoint->y + i <= window->GetHeight() - 1)
           //WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (v21 & (ReadPixel16(pTargetPoint->x + j, pTargetPoint->y + i) / 2)) + (v21 & (*src_surf_pos / 2)));
             WritePixel16(pTargetPoint->x + j, pTargetPoint->y + i, (0x7BEF & (*src_surf_pos / 2)));
         }
@@ -3662,22 +3666,19 @@
 //----- (0040DB27) --------------------------------------------------------
 void DrawRect( RECT *pXYZW, unsigned __int16 uColor, char bSolidFill )
 {
-  RECT *v3; // esi@1
-
-  v3 = pXYZW;
   pRenderer->BeginScene();
-  pRenderer->SetRasterClipRect(0, 0, 639, 479);
+  pRenderer->SetRasterClipRect(0, 0, window->GetWidth() - 1, window->GetHeight() - 1);
   if ( bSolidFill )
   {
-    for ( int i = v3->top; i <= v3->bottom;  ++i )
-      pRenderer->RasterLine2D(v3->left, i, v3->right, i, uColor);
+    for ( int i = pXYZW->top; i <= pXYZW->bottom;  ++i )
+      pRenderer->RasterLine2D(pXYZW->left, i, pXYZW->right, i, uColor);
   }
   else
   {
-    pRenderer->RasterLine2D(v3->left, v3->top, v3->right, v3->top, uColor);
-    pRenderer->RasterLine2D(v3->right, v3->top, v3->right, v3->bottom, uColor);
-    pRenderer->RasterLine2D(v3->right, v3->bottom, v3->left, v3->bottom, uColor);
-    pRenderer->RasterLine2D(v3->left, v3->bottom, v3->left, v3->top, uColor);
+    pRenderer->RasterLine2D(pXYZW->left, pXYZW->top, pXYZW->right, pXYZW->top, uColor);
+    pRenderer->RasterLine2D(pXYZW->right, pXYZW->top, pXYZW->right, pXYZW->bottom, uColor);
+    pRenderer->RasterLine2D(pXYZW->right, pXYZW->bottom, pXYZW->left, pXYZW->bottom, uColor);
+    pRenderer->RasterLine2D(pXYZW->left, pXYZW->bottom, pXYZW->left, pXYZW->top, uColor);
   }
   pRenderer->EndScene();
 }
@@ -3687,7 +3688,8 @@
   pRenderer->BeginScene();
   //if ( uNumSceneBegins )
   {
-    if ( pTargetXY->x >= 0 && pTargetXY->x <= 639 && pTargetXY->y >= 0 && pTargetXY->y <= 479)
+    if ( pTargetXY->x >= 0 && pTargetXY->x <= window->GetWidth() - 1
+      && pTargetXY->y >= 0 && pTargetXY->y <= window->GetHeight() - 1)
     {
       pRenderer->WritePixel16(pTargetXY->x,     pTargetXY->y, uColor);
       pRenderer->WritePixel16(pTargetXY->x + 1, pTargetXY->y, uColor);
@@ -3704,7 +3706,8 @@
   pRenderer->BeginScene();
   //if ( pRenderer->uNumSceneBegins )
   {
-    if ( pTargetXY->x >= 0 && pTargetXY->x <= 639 && pTargetXY->y >= 0 && pTargetXY->y <= 479)
+    if ( pTargetXY->x >= 0 && pTargetXY->x <= window->GetWidth() - 1
+      && pTargetXY->y >= 0 && pTargetXY->y <= window->GetHeight() - 1)
     {
       pRenderer->WritePixel16(pTargetXY->x, pTargetXY->y, uColor);
     /*int xVal = pTargetXY->x;