Mercurial > mm7
comparison Render.cpp @ 1655:a7eebb6ee7a2
Window Resize (change arguments to MM7_Initialize)
author | Nomad |
---|---|
date | Wed, 18 Sep 2013 11:13:38 +0200 |
parents | dbd6f940f26c |
children | 5dd790bb52bf |
comparison
equal
deleted
inserted
replaced
1654:d11b5669f089 | 1655:a7eebb6ee7a2 |
---|---|
2092 | 2092 |
2093 hd_water_tile_id = -1; | 2093 hd_water_tile_id = -1; |
2094 hd_water_current_frame = 0; | 2094 hd_water_current_frame = 0; |
2095 } | 2095 } |
2096 | 2096 |
2097 bool Render::Initialize(bool bWindowed, uint32_t uDefaultDevice, bool bColoredLights, uint32_t uDetailLevel, bool bTinting) | 2097 bool Render::Initialize(bool bWindowed, int windowed_width, int windowed_height, uint32_t uDefaultDevice, |
2098 bool bColoredLights, uint32_t uDetailLevel, bool bTinting) | |
2098 { | 2099 { |
2099 bUserDirect3D = true;//ReadWindowsRegistryInt("Use D3D", 0); | 2100 bUserDirect3D = true;//ReadWindowsRegistryInt("Use D3D", 0); |
2101 | |
2100 bStartInWindow = bWindowed; | 2102 bStartInWindow = bWindowed; |
2103 windowed_mode_width = windowed_width; | |
2104 windowed_mode_height = windowed_height; | |
2101 | 2105 |
2102 uDesiredDirect3DDevice = uDefaultDevice;//ReadWindowsRegistryInt("D3D Device", 1); | 2106 uDesiredDirect3DDevice = uDefaultDevice;//ReadWindowsRegistryInt("D3D Device", 1); |
2103 | 2107 |
2104 bUseColoredLights = bColoredLights;//ReadWindowsRegistryInt("Colored Lights", 0); | 2108 bUseColoredLights = bColoredLights;//ReadWindowsRegistryInt("Colored Lights", 0); |
2105 uLevelOfDetail = uDetailLevel;//ReadWindowsRegistryInt("Detail Level", 1); | 2109 uLevelOfDetail = uDetailLevel;//ReadWindowsRegistryInt("Detail Level", 1); |
2175 } | 2179 } |
2176 | 2180 |
2177 //----- (0049ED18) -------------------------------------------------------- | 2181 //----- (0049ED18) -------------------------------------------------------- |
2178 void Render::PresentBlackScreen() | 2182 void Render::PresentBlackScreen() |
2179 { | 2183 { |
2180 LONG w; // edx@3 | |
2181 IDirectDrawSurface *v2; // eax@3 | 2184 IDirectDrawSurface *v2; // eax@3 |
2182 DDBLTFX v3; // [sp+4h] [bp-74h]@5 | 2185 DDBLTFX v3; // [sp+4h] [bp-74h]@5 |
2183 RECT x; // [sp+68h] [bp-10h]@3 | 2186 RECT x; // [sp+68h] [bp-10h]@3 |
2184 | 2187 |
2185 memset(&v3, 0, sizeof(DDBLTFX)); | 2188 memset(&v3, 0, sizeof(DDBLTFX)); |
2189 GetWindowRect(hWnd, &x); | |
2186 if (pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || | 2190 if (pVersion->pVersionInfo.dwPlatformId != VER_PLATFORM_WIN32_NT || |
2187 pVersion->pVersionInfo.dwMajorVersion >= 5) | 2191 pVersion->pVersionInfo.dwMajorVersion >= 5) |
2188 { | 2192 { |
2189 x.left = uWindowX; | |
2190 x.right = uWindowX + uWindowHeight; | |
2191 x.top = uWindowY; | |
2192 w = uWindowY + uWindowWidth; | |
2193 v2 = (IDirectDrawSurface *)this->pBackBuffer4; | 2193 v2 = (IDirectDrawSurface *)this->pBackBuffer4; |
2194 } | 2194 } |
2195 else | 2195 else |
2196 { | 2196 { |
2197 x.left = uWindowX; | |
2198 x.right = uWindowX + uWindowHeight; | |
2199 x.top = uWindowY; | |
2200 w = uWindowY + uWindowWidth; | |
2201 v2 = (IDirectDrawSurface *)this->pBackBuffer2; | 2197 v2 = (IDirectDrawSurface *)this->pBackBuffer2; |
2202 } | 2198 } |
2203 x.bottom = w; | |
2204 v3.dwFillColor = 0; | 2199 v3.dwFillColor = 0; |
2205 v3.dwSize = 100; | 2200 v3.dwSize = 100; |
2206 v2->Blt(&x, 0, 0, DDBLT_COLORFILL, &v3); | 2201 v2->Blt(&x, 0, 0, DDBLT_COLORFILL, &v3); |
2207 pRenderer->Present(); | 2202 pRenderer->Present(); |
2208 } | 2203 } |
8359 pBitmaps_LOD->ReleaseHardwareTextures(); | 8354 pBitmaps_LOD->ReleaseHardwareTextures(); |
8360 pSprites_LOD->ReleaseAll(); | 8355 pSprites_LOD->ReleaseAll(); |
8361 } | 8356 } |
8362 if ( pRenderer->bWindowMode ) | 8357 if ( pRenderer->bWindowMode ) |
8363 { | 8358 { |
8364 if ( GetWindowRect(hWnd, &Rect) ) | |
8365 { | |
8366 WriteWindowsRegistryInt("window X", Rect.left); | |
8367 WriteWindowsRegistryInt("window Y", Rect.top); | |
8368 uWindowX = Rect.left; | |
8369 uWindowY = Rect.top; | |
8370 } | |
8371 SetMenu(hWnd, 0); | 8359 SetMenu(hWnd, 0); |
8372 SetWindowLongA(hWnd, -20, 0); | 8360 SetWindowLongA(hWnd, -20, 0); |
8373 SetWindowLongA(hWnd, -16, 0x10000000u); | 8361 SetWindowLongA(hWnd, -16, 0x10000000u); |
8374 pRenderer->InitializeFullscreen(hWnd); | 8362 pRenderer->InitializeFullscreen(hWnd); |
8375 v0 = (double)(signed int)uGammaPos * 0.1 + 0.6; | 8363 v0 = (double)(signed int)uGammaPos * 0.1 + 0.6; |
8377 } | 8365 } |
8378 else | 8366 else |
8379 { | 8367 { |
8380 ClipCursor(0); | 8368 ClipCursor(0); |
8381 pRenderer->SwitchToWindow(hWnd); | 8369 pRenderer->SwitchToWindow(hWnd); |
8382 SetWindowLongA(hWnd, -16, uWindowStyle); | |
8383 } | 8370 } |
8384 if ( pRenderer->pRenderD3D ) | 8371 if ( pRenderer->pRenderD3D ) |
8385 { | 8372 { |
8386 pBitmaps_LOD->_410423_move_textures_to_device(); | 8373 pBitmaps_LOD->_410423_move_textures_to_device(); |
8387 pSprites_LOD->MoveSpritesToVideoMemory(); | 8374 pSprites_LOD->MoveSpritesToVideoMemory(); |
8432 viewparams->bRedrawGameUI = 1; | 8419 viewparams->bRedrawGameUI = 1; |
8433 viewparams->InitGrayPalette(); | 8420 viewparams->InitGrayPalette(); |
8434 pMouse->SetCurrentCursorBitmap(); | 8421 pMouse->SetCurrentCursorBitmap(); |
8435 if ( pRenderer->bWindowMode ) | 8422 if ( pRenderer->bWindowMode ) |
8436 { | 8423 { |
8437 InvalidateRect(0, 0, 0); | 8424 //MoveWindow(hWnd, uWindowX, uWindowY, uWindowWidth, uWindowHeight, 0); |
8438 MoveWindow(hWnd, uWindowX, uWindowY, uWindowWidth, uWindowHeight, 0); | 8425 CenterWindowAndAdjustSize(hWnd, windowed_mode_width, windowed_mode_height); |
8439 ShowWindow(hWnd, SW_SHOWNORMAL); | 8426 ShowWindow(hWnd, SW_SHOWNORMAL); |
8440 } | 8427 } |
8441 pMouse->bActive = 1; | 8428 pMouse->bActive = 1; |
8442 if ( pVideoPlayer->AnyMovieLoaded() ) | 8429 if ( pVideoPlayer->AnyMovieLoaded() ) |
8443 pVideoPlayer->SelectMovieType(); | 8430 pVideoPlayer->SelectMovieType(); |
8444 if ( BYTE1(dword_6BE364_game_settings_1) & 8 ) | 8431 if (dword_6BE364_game_settings_1 & 0x0800 ) |
8445 BYTE1(dword_6BE364_game_settings_1) &= 0xF7u; | 8432 BYTE1(dword_6BE364_game_settings_1) &= 0xF7u; |
8446 else | 8433 else |
8447 pEventTimer->Resume(); | 8434 pEventTimer->Resume(); |
8448 if ( BYTE1(dword_6BE364_game_settings_1) & 0x10 ) | 8435 if ( BYTE1(dword_6BE364_game_settings_1) & 0x10 ) |
8449 BYTE1(dword_6BE364_game_settings_1) &= 0xEFu; | 8436 BYTE1(dword_6BE364_game_settings_1) &= 0xEFu; |