diff Render.cpp @ 1572:19f1735fca80

Слияние
author Ritor1
date Sun, 08 Sep 2013 17:07:58 +0600
parents c4ab816fcc5e
children 2d9c8f609a3c
line wrap: on
line diff
--- a/Render.cpp	Sun Sep 08 17:07:47 2013 +0600
+++ b/Render.cpp	Sun Sep 08 17:07:58 2013 +0600
@@ -2,8 +2,6 @@
 #define _CRT_SECURE_NO_WARNINGS
 #endif
 
-#include <assert.h>
-
 #include "Outdoor_stuff.h"
 #include "VideoPlayer.h"
 #include "Sprites.h"
@@ -2103,7 +2101,7 @@
   hd_water_current_frame = 0;
 }
 
-bool Render::Initialize(bool bWindowed, uint uDefaultDevice, bool bColoredLights, uint uDetailLevel, uint bTinting)
+bool Render::Initialize(bool bWindowed, uint32_t uDefaultDevice, bool bColoredLights, uint32_t uDetailLevel, bool bTinting)
 {
   bUserDirect3D = true;//ReadWindowsRegistryInt("Use D3D", 0);
   bStartInWindow = bWindowed;
@@ -3185,13 +3183,15 @@
       else
       {
         if ( !v7->bIsDeviceCompatible )
-          Abortf("There aren't any D3D devices to create.");
+          Error("There aren't any D3D devices to create.");
+
         v8 = pRenderD3D->CreateDevice(0, 0, hWnd);
         uAcquiredDirect3DDevice = 0;
       }
     }
     if ( !v8 )
-      Abortf("D3Drend->Init failed.");
+      Error("D3Drend->Init failed.");
+
     v9 = pRenderD3D;
     pBackBuffer4 = v9->pBackBuffer;
     pFrontBuffer4 = v9->pFrontBuffer;
@@ -3208,7 +3208,7 @@
       pBackBuffer4 = 0;
       pFrontBuffer4 = 0;
       pDirectDraw4 = 0;
-      Abortf("Direct3D renderer:  The device failed to return capabilities.");
+      Error("Direct3D renderer:  The device failed to return capabilities.");
     }
     if ( v10 & 0x3E )
     {
@@ -3222,7 +3222,7 @@
       pBackBuffer4 = 0;
       pFrontBuffer4 = 0;
       pDirectDraw4 = 0;
-      Abortf("Direct3D renderer:  The device doesn't support the necessary alpha blending modes.");
+      Error("Direct3D renderer:  The device doesn't support the necessary alpha blending modes.");
     }
     if ( (v10 & 0x80u) != 0 )
     {
@@ -3235,7 +3235,7 @@
       pBackBuffer4 = 0;
       pFrontBuffer4 = 0;
       pDirectDraw4 = 0;
-      Abortf("Direct3D renderer:  The device doesn't support non-square textures.");
+      Error("Direct3D renderer:  The device doesn't support non-square textures.");
     }
     LOBYTE(field_10365C) = ~(unsigned __int8)(v10 >> 6) & 1;
     bRequiredTextureStagesAvailable = CheckTextureStages();
@@ -3407,12 +3407,13 @@
     else
     {
       if ( !pRenderD3D->pAvailableDevices[0].bIsDeviceCompatible )
-        Abortf("There aren't any D3D devices to init.");
+        Error("There aren't any D3D devices to init.");
+
       v7 = pRenderD3D->CreateDevice(0, 1, hWnd);
       uAcquiredDirect3DDevice = 0;
     }
     if ( !v7 )
-      Abortf("D3Drend->Init failed.");
+      Error("D3Drend->Init failed.");
 
     //v8 = pRenderD3D;
     pColorKeySurface4 = 0;
@@ -3431,7 +3432,7 @@
       pBackBuffer4 = 0;
       pFrontBuffer4 = 0;
       pDirectDraw4 = 0;
-      Abortf("Direct3D renderer:  The device failed to return capabilities.");
+      Error("Direct3D renderer:  The device failed to return capabilities.");
     }
     if ( v9 & 0x3E )
     {
@@ -3445,7 +3446,7 @@
       pBackBuffer4 = 0;
       pFrontBuffer4 = 0;
       pDirectDraw4 = 0;
-      Abortf("Direct3D renderer:  The device doesn't support the necessary alpha blending modes.");
+      Error("Direct3D renderer:  The device doesn't support the necessary alpha blending modes.");
     }
     if ( (v9 & 0x80u) != 0 )
     {
@@ -3458,7 +3459,7 @@
       pBackBuffer4 = 0;
       pFrontBuffer4 = 0;
       pDirectDraw4 = 0;
-      Abortf("Direct3D renderer:  The device doesn't support non-square textures.");
+      Error("Direct3D renderer:  The device doesn't support non-square textures.");
     }
     LOBYTE(field_10365C) = ~(unsigned __int8)(v9 >> 6) & 1;
     bRequiredTextureStagesAvailable = CheckTextureStages();
@@ -5145,7 +5146,7 @@
   v7 = pFace->uPolygonType;
   if ( v7 == 4 || v7 == 3 )
     v70 = v6;
-  stru_8019C8._48653D(65536, 0, 0, 0, 65536, 0);
+  stru_8019C8._48653D_frustum_blv(65536, 0, 0, 0, 65536, 0);
   v62.Create_48607B(&stru_8019C8);
   v62.uTileBitmapID = pFace->uBitmapID;
   v62.pTexture = (Texture *)((signed __int16)v62.uTileBitmapID != -1 ? &pBitmaps_LOD->pTextures[(signed __int16)v62.uTileBitmapID] : 0);
@@ -6449,7 +6450,7 @@
             true,
             bMipMaps,
             uMinDeviceTextureDim) )
-      Abortf("HiScreen16::LoadTexture - D3Drend->CreateTexture() failed: %x", 0);
+      Error("HiScreen16::LoadTexture - D3Drend->CreateTexture() failed: %x", 0);
     //v10 = *pOutSurface;
     //v11 = 0;
     if ( bMipMaps )
@@ -6550,7 +6551,7 @@
     //v6 = v3->uMinDeviceTextureDim;
     //v7 = v3->pRenderD3D;
     if (!pRenderD3D->CreateTexture(sprite_texture->uWidth, sprite_texture->uHeight, &pSprite->pTextureSurface, &pSprite->pTexture, 1u, 0, uMinDeviceTextureDim))
-      Abortf("HiScreen16::LoadTexture - D3Drend->CreateTexture() failed: %x", 0);
+      Error("HiScreen16::LoadTexture - D3Drend->CreateTexture() failed: %x", 0);
     //pSprite = v2->pTextureSurface;
     //pSprite = (Sprite *)pSprite->pName;
     //v8 = pSprite;
@@ -8411,7 +8412,6 @@
       ClipCursor(0);
       pRenderer->SwitchToWindow(hWnd);
       SetWindowLongA(hWnd, -16, uWindowStyle);
-      SetMenu(hWnd, hOSMenu);
     }
     if ( pRenderer->pRenderD3D )
     {