Mercurial > mm7
diff Render.cpp @ 1545:c4ab816fcc5e
assert, Abortf, AbortWithError -> Assert, Error
refactors here and there
author | Nomad |
---|---|
date | Sat, 07 Sep 2013 20:05:20 +0200 |
parents | 499761153844 |
children | 2d9c8f609a3c |
line wrap: on
line diff
--- a/Render.cpp Sat Sep 07 15:20:57 2013 +0200 +++ b/Render.cpp Sat Sep 07 20:05:20 2013 +0200 @@ -2,8 +2,6 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include <assert.h> - #include "Outdoor_stuff.h" #include "VideoPlayer.h" #include "Sprites.h" @@ -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(); @@ -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;