Mercurial > mm7
comparison Engine/Graphics/Render.cpp @ 2544:c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
author | a.parshin |
---|---|
date | Mon, 11 May 2015 09:51:04 +0200 |
parents | b6140dfeac27 |
children | 67d837007a4c 6ab1273bc507 |
comparison
equal
deleted
inserted
replaced
2543:b6140dfeac27 | 2544:c674d547cc7c |
---|---|
7808 } | 7808 } |
7809 } | 7809 } |
7810 } | 7810 } |
7811 } | 7811 } |
7812 | 7812 |
7813 //----- (004667E9) -------------------------------------------------------- | |
7814 void Render::ChangeBetweenWinFullscreenModes() | |
7815 { | |
7816 float v0; // ST14_4@17 | |
7817 int v4; // edx@26 | |
7818 ObjectDesc *v5; // eax@26 | |
7819 RGBTexture *v6; // esi@33 | |
7820 const char *v8; // [sp-4h] [bp-28h]@33 | |
7821 // struct tagRECT Rect; // [sp+14h] [bp-10h]@15 | |
7822 | |
7823 /*if ( !pRenderer->bWindowMode && (dword_6BE364_game_settings_1 & 2) ) | |
7824 { | |
7825 ModalWindow(pGlobalTXT_LocalizationStrings[62], UIMSG_0);// "Might and Magic VII requires your desktop to be in 16bit (32k or 65k) Color mode in order to operate in a window." | |
7826 return; | |
7827 }*/ | |
7828 if ( bWindowMode || pRenderD3D->pAvailableDevices->bIsDeviceCompatible ) | |
7829 { | |
7830 if ( pEventTimer->bPaused ) | |
7831 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0800; | |
7832 else | |
7833 pEventTimer->Pause(); | |
7834 if ( pMiscTimer->bPaused ) | |
7835 dword_6BE364_game_settings_1 |= GAME_SETTINGS_1000; | |
7836 else | |
7837 pMiscTimer->Pause(); | |
7838 pMouse->bActive = 0; | |
7839 if ( pRenderD3D ) | |
7840 { | |
7841 pBitmaps_LOD->ReleaseHardwareTextures(); | |
7842 pSprites_LOD->ReleaseAll(); | |
7843 } | |
7844 if ( bWindowMode ) | |
7845 { | |
7846 //SetMenu(hWnd, 0); | |
7847 //SetWindowLongA(hWnd, -20, 0); | |
7848 //SetWindowLongA(hWnd, -16, 0x10000000u); | |
7849 window->SetFullscreenMode(); | |
7850 pRenderer->InitializeFullscreen(); | |
7851 } | |
7852 else | |
7853 { | |
7854 //ClipCursor(0); | |
7855 window->SetWindowedMode(window->GetWidth(), window->GetHeight()); | |
7856 pRenderer->SwitchToWindow(); | |
7857 } | |
7858 if ( pRenderD3D ) | |
7859 { | |
7860 pBitmaps_LOD->_410423_move_textures_to_device(); | |
7861 pSprites_LOD->MoveSpritesToVideoMemory(); | |
7862 } | |
7863 if (!( pPaletteManager->uNumTargetBBits == uTargetBBits | |
7864 && pPaletteManager->uNumTargetGBits == uTargetGBits | |
7865 && pPaletteManager->uNumTargetRBits == uTargetRBits )) | |
7866 { | |
7867 pPaletteManager->SetColorChannelInfo(uTargetRBits, uTargetGBits, uTargetBBits); | |
7868 pPaletteManager->RecalculateAll(); | |
7869 pBitmaps_LOD->SetupPalettes(uTargetRBits, uTargetGBits, uTargetBBits); | |
7870 pIcons_LOD->SetupPalettes(uTargetRBits, uTargetGBits, uTargetBBits); | |
7871 for (uint i = 0; i < pObjectList->uNumObjects; i++) | |
7872 { | |
7873 BYTE3(v4) = 0; | |
7874 v5 = &pObjectList->pObjects[i]; | |
7875 *(short *)((char *)&v4 + 1) = v5->uParticleTrailColorR; | |
7876 LOBYTE(v4) = v5->uParticleTrailColorG; | |
7877 v5->uParticleTrailColor = v5->uParticleTrailColorB | (v4 << 8); | |
7878 } | |
7879 SetUserInterface(pParty->alignment, true); | |
7880 if ( pMediaPlayer->pVideoFrame.pPixels ) | |
7881 pMediaPlayer->pVideoFrame.Load(pMediaPlayer->pVideoFrameTextureFilename, 1); | |
7882 if ( sCurrentMenuID != MENU_CREATEPARTY ) | |
7883 { | |
7884 if ( sCurrentMenuID == MENU_CREDITSPROC ) | |
7885 dword_A74C88 = 1; | |
7886 } | |
7887 else | |
7888 { | |
7889 if ( sCurrentMenuID ) | |
7890 { | |
7891 v6 = &pTexture_PCX; | |
7892 pTexture_PCX.Release(); | |
7893 v8 = "makeme.pcx"; | |
7894 } | |
7895 else | |
7896 { | |
7897 v6 = &pTexture_PCX; | |
7898 pTexture_PCX.Release(); | |
7899 v8 = "title.pcx"; | |
7900 if ( sCurrentMenuID ) | |
7901 v8 = "lsave640.pcx"; | |
7902 } | |
7903 v6->Load(v8, 0); | |
7904 } | |
7905 } | |
7906 viewparams->bRedrawGameUI = 1; | |
7907 viewparams->InitGrayPalette(); | |
7908 pMouse->SetCurrentCursorBitmap(); | |
7909 /*if ( pRenderer->bWindowMode ) | |
7910 { | |
7911 //MoveWindow(hWnd, uWindowX, uWindowY, uWindowWidth, uWindowHeight, 0); | |
7912 CenterWindowAndAdjustSize(hWnd, windowed_mode_width, windowed_mode_height); | |
7913 ShowWindow(hWnd, SW_SHOWNORMAL); | |
7914 }*/ | |
7915 pMouse->bActive = true; | |
7916 if ( pMovie_Track ) | |
7917 pMediaPlayer->SelectMovieType(); | |
7918 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0800) | |
7919 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0800; | |
7920 else | |
7921 pEventTimer->Resume(); | |
7922 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_1000) | |
7923 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_1000; | |
7924 else | |
7925 pMiscTimer->Resume(); | |
7926 } | |
7927 } | |
7928 | 7813 |
7929 | 7814 |
7930 //----- (004524D8) -------------------------------------------------------- | 7815 //----- (004524D8) -------------------------------------------------------- |
7931 HWLTexture *RenderHWLContainer::LoadTexture(const char *pName, int bMipMaps) | 7816 HWLTexture *RenderHWLContainer::LoadTexture(const char *pName, int bMipMaps) |
7932 { | 7817 { |