comparison mm7_5.cpp @ 1026:6afa77761a00

Слияние
author Ritor1
date Tue, 21 May 2013 12:43:08 +0600
parents 8b492d4722d4 3413ad40cc88
children c94d6a37d298
comparison
equal deleted inserted replaced
1025:8b492d4722d4 1026:6afa77761a00
1 #include <assert.h> 1 #include <assert.h>
2 2
3 #include "VideoPlayer.h"
4 #include "Sprites.h"
5 #include "MapInfo.h"
6 #include "BSPModel.h"
7 #include "OutdoorCamera.h"
8 #include "LightmapBuilder.h"
9 #include "DecalBuilder.h"
10 #include "Mouse.h"
11 #include "Keyboard.h"
12 #include "GammaControl.h"
13 #include "stru11.h"
14
15 #include "Vis.h"
3 #include "mm7.h" 16 #include "mm7.h"
4 #include "MapInfo.h"
5 #include "Game.h" 17 #include "Game.h"
6 #include "GUIWindow.h" 18 #include "GUIWindow.h"
7 #include "GUIFont.h" 19 #include "GUIFont.h"
8 #include "GUIProgressBar.h" 20 #include "GUIProgressBar.h"
9 #include "Party.h" 21 #include "Party.h"
10 #include "AudioPlayer.h" 22 #include "AudioPlayer.h"
11 #include "Outdoor.h" 23 #include "Outdoor.h"
12 #include "IndoorCamera.h"
13 #include "Overlays.h"
14 #include "Monsters.h"
15 #include "Arcomage.h" 24 #include "Arcomage.h"
16 #include "LOD.h" 25 #include "LOD.h"
17 #include "Actor.h" 26 #include "Actor.h"
18 #include "Allocator.h"
19 #include "Events.h" 27 #include "Events.h"
20 #include "Viewport.h" 28 #include "Viewport.h"
21 #include "FrameTableInc.h" 29 #include "FrameTableInc.h"
22 #include "Math.h" 30 #include "Math.h"
23 #include "SpriteObject.h" 31 #include "SpriteObject.h"
24 #include "ObjectList.h" 32 #include "ObjectList.h"
25 #include "Chest.h" 33 #include "Chest.h"
26 #include "PaletteManager.h" 34 #include "PaletteManager.h"
27 #include "DecorationList.h"
28 #include "SaveLoad.h" 35 #include "SaveLoad.h"
29 #include "stru123.h"
30 #include "Time.h" 36 #include "Time.h"
31 #include "IconFrameTable.h"
32 #include "Awards.h"
33 #include "Autonotes.h"
34 #include "stru160.h"
35 #include "TurnEngine.h" 37 #include "TurnEngine.h"
36 #include "CastSpellInfo.h" 38 #include "CastSpellInfo.h"
37 #include "Weather.h"
38 #include "stru298.h" 39 #include "stru298.h"
39 #include "StorylineTextTable.h"
40 #include "Events2D.h" 40 #include "Events2D.h"
41 #include "texts.h" 41 #include "texts.h"
42 #include "Log.h" 42 #include "Log.h"
43 #include "UIHouses.h" 43 #include "UIHouses.h"
44 #include "mm7_data.h" 44 #include "mm7_data.h"
380 _4B4224_UpdateNPCTopics(uMessageParam); 380 _4B4224_UpdateNPCTopics(uMessageParam);
381 continue; 381 continue;
382 case UIMSG_StartNewGame: 382 case UIMSG_StartNewGame:
383 if ( dword_6BE138 == 124 || uMessageParam ) 383 if ( dword_6BE138 == 124 || uMessageParam )
384 { 384 {
385 pIcons_LOD->_40F9C5(); 385 pIcons_LOD->SyncLoadedFilesCount();
386 pIcons_LOD->_4114F2(); 386 pIcons_LOD->_4114F2();
387 if ( pMessageQueue_50CBD0->uNumMessages ) 387 if ( pMessageQueue_50CBD0->uNumMessages )
388 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 388 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
389 pGUIWindow_CurrentMenu->Release(); 389 pGUIWindow_CurrentMenu->Release();
390 uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU; 390 uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU;
398 dword_6BE138 = 124; 398 dword_6BE138 = 124;
399 } 399 }
400 stru_506E40.Release(); 400 stru_506E40.Release();
401 continue; 401 continue;
402 case UIMSG_Game_OpenLoadGameDialog: 402 case UIMSG_Game_OpenLoadGameDialog:
403 pIcons_LOD->_40F9C5(); 403 pIcons_LOD->SyncLoadedFilesCount();
404 pIcons_LOD->_4114F2(); 404 pIcons_LOD->_4114F2();
405 if ( pMessageQueue_50CBD0->uNumMessages ) 405 if ( pMessageQueue_50CBD0->uNumMessages )
406 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 406 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
407 pGUIWindow_CurrentMenu->Release(); 407 pGUIWindow_CurrentMenu->Release();
408 pCurrentScreen = SCREEN_LOADGAME; 408 pCurrentScreen = SCREEN_LOADGAME;
409 GameUI_DrawLoadMenu(1); 409 GameUI_DrawLoadMenu(1);
410 continue; 410 continue;
411 case UIMSG_Quit: 411 case UIMSG_Quit:
412 if ( dword_6BE138 == 132 || uMessageParam ) 412 if ( dword_6BE138 == 132 || uMessageParam )
413 { 413 {
414 pIcons_LOD->_40F9C5(); 414 pIcons_LOD->SyncLoadedFilesCount();
415 pIcons_LOD->_4114F2(); 415 pIcons_LOD->_4114F2();
416 if ( pMessageQueue_50CBD0->uNumMessages ) 416 if ( pMessageQueue_50CBD0->uNumMessages )
417 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 417 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
418 pGUIWindow_CurrentMenu->Release(); 418 pGUIWindow_CurrentMenu->Release();
419 pCurrentScreen = SCREEN_GAME; 419 pCurrentScreen = SCREEN_GAME;
430 } 430 }
431 stru_506E40.Release(); 431 stru_506E40.Release();
432 continue; 432 continue;
433 case UIMSG_80: 433 case UIMSG_80:
434 __debugbreak(); 434 __debugbreak();
435 pIcons_LOD->_40F9C5(); 435 pIcons_LOD->SyncLoadedFilesCount();
436 pIcons_LOD->_4114F2(); 436 pIcons_LOD->_4114F2();
437 pGUIWindow_CurrentMenu->Release(); 437 pGUIWindow_CurrentMenu->Release();
438 pCurrentScreen = SCREEN_OPTIONS; 438 pCurrentScreen = SCREEN_OPTIONS;
439 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_8, 0, 0); 439 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_8, 0, 0);
440 continue; 440 continue;
1144 viewparams->bRedrawGameUI = 1; 1144 viewparams->bRedrawGameUI = 1;
1145 pEventTimer->Resume(); 1145 pEventTimer->Resume();
1146 continue; 1146 continue;
1147 case SCREEN_OPTIONS://Close 1147 case SCREEN_OPTIONS://Close
1148 options_menu_skin.Relaease(); 1148 options_menu_skin.Relaease();
1149 pIcons_LOD->_40F9C5(); 1149 pIcons_LOD->SyncLoadedFilesCount();
1150 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier); 1150 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier);
1151 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier); 1151 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier);
1152 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier); 1152 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier);
1153 WriteWindowsRegistryInt("WalkSound", bWalkSound); 1153 WriteWindowsRegistryInt("WalkSound", bWalkSound);
1154 WriteWindowsRegistryInt("ShowDamage", bShowDamage); 1154 WriteWindowsRegistryInt("ShowDamage", bShowDamage);
1174 } 1174 }
1175 WriteWindowsRegistryInt("TurnDelta", 1); 1175 WriteWindowsRegistryInt("TurnDelta", 1);
1176 stru_506E40.Release(); 1176 stru_506E40.Release();
1177 break; 1177 break;
1178 case SCREEN_MENU: 1178 case SCREEN_MENU:
1179 pIcons_LOD->_40F9C5(); 1179 pIcons_LOD->SyncLoadedFilesCount();
1180 pIcons_LOD->_4114F2(); 1180 pIcons_LOD->_4114F2();
1181 pIcons_LOD->_40F9C5(); 1181 pIcons_LOD->SyncLoadedFilesCount();
1182 pIcons_LOD->_4114F2(); 1182 pIcons_LOD->_4114F2();
1183 stru_506E40.Release(); 1183 stru_506E40.Release();
1184 break; 1184 break;
1185 case SCREEN_VIDEO_OPTIONS: 1185 case SCREEN_VIDEO_OPTIONS:
1186 if ( pRenderer->pRenderD3D ) 1186 if ( pRenderer->pRenderD3D )
1214 pIcons_LOD->pTextures[*(int *)thisb].Release(); 1214 pIcons_LOD->pTextures[*(int *)thisb].Release();
1215 thisb += 4; 1215 thisb += 4;
1216 } 1216 }
1217 while ( thisb < (signed int)&dword_507C08 ); 1217 while ( thisb < (signed int)&dword_507C08 );
1218 memset(&uTextureID_Optkb, 0, 0x14u); 1218 memset(&uTextureID_Optkb, 0, 0x14u);
1219 pIcons_LOD->_40F9C5(); 1219 pIcons_LOD->SyncLoadedFilesCount();
1220 uAction = 0; 1220 uAction = 0;
1221 do 1221 do
1222 { 1222 {
1223 v33 = pKeyActionMap->GetActionVKey((enum InputAction)uAction); 1223 v33 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
1224 if ( v33 != pPrevVirtualCidesMapping[uAction] ) 1224 if ( v33 != pPrevVirtualCidesMapping[uAction] )
1260 } 1260 }
1261 pTexture_RestUI_CurrentSkyFrame->Release(); 1261 pTexture_RestUI_CurrentSkyFrame->Release();
1262 pTexture_RestUI_CurrentHourglassFrame->Release(); 1262 pTexture_RestUI_CurrentHourglassFrame->Release();
1263 pTexture_RestUI_CurrentHourglassFrame = 0; 1263 pTexture_RestUI_CurrentHourglassFrame = 0;
1264 pTexture_RestUI_CurrentSkyFrame = 0; 1264 pTexture_RestUI_CurrentSkyFrame = 0;
1265 pIcons_LOD->_40F9C5(); 1265 pIcons_LOD->SyncLoadedFilesCount();
1266 pIcons_LOD->_4114F2(); 1266 pIcons_LOD->_4114F2();
1267 _506F18_num_hours_to_sleep = 0; 1267 _506F18_num_hours_to_sleep = 0;
1268 dword_506F14 = 0; 1268 dword_506F14 = 0;
1269 dword_507B94 = 1; 1269 dword_507B94 = 1;
1270 if ( pGUIWindow_Settings ) 1270 if ( pGUIWindow_Settings )
2763 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook; 2763 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook;
2764 dword_50C9EC[3 * dword_50C9E8 + 1] = v103; 2764 dword_50C9EC[3 * dword_50C9E8 + 1] = v103;
2765 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1; 2765 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1;
2766 ++dword_50C9E8; 2766 ++dword_50C9E8;
2767 }*/ 2767 }*/
2768 pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1); 2768 pMessageQueue_50C9E8->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
2769 // pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
2769 } 2770 }
2770 else 2771 else
2771 { 2772 {
2772 byte_506550 = 1; 2773 byte_506550 = 1;
2773 quick_spell_at_page = uMessageParam + 1; 2774 quick_spell_at_page = uMessageParam + 1;
2779 case UIMSG_CastSpellFromBook: 2780 case UIMSG_CastSpellFromBook:
2780 if ( pTurnEngine->field_4 != 3 ) 2781 if ( pTurnEngine->field_4 != 3 )
2781 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0); 2782 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0);
2782 continue; 2783 continue;
2783 2784
2784 case UIMSG_92: 2785 case UIMSG_SpellScrollUse:
2785 __debugbreak(); 2786 __debugbreak();
2786 if ( pTurnEngine->field_4 != 3 ) 2787 if ( pTurnEngine->field_4 != 3 )
2787 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0); 2788 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0);
2788 continue; 2789 continue;
2789 case UIMSG_SpellBookWindow: 2790 case UIMSG_SpellBookWindow:
3221 default: 3222 default:
3222 continue; 3223 continue;
3223 } 3224 }
3224 } 3225 }
3225 } 3226 }
3226 pMessageQueue_50CBD0->uNumMessages = dword_50C9E8; 3227 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8;
3227 memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8); 3228 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages);
3228 dword_50C9E8 = 0; 3229 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8);
3230 //dword_50C9E8 = 0;
3231
3232
3233 pMessageQueue_50C9E8->uNumMessages=0;
3229 if ( dword_50C9DC ) 3234 if ( dword_50C9DC )
3230 { 3235 {
3231 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 3236 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
3232 { 3237 {
3233 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC; 3238 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC;
3355 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); 3360 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
3356 player->PlaySound(SPEECH_PickMe, 0); 3361 player->PlaySound(SPEECH_PickMe, 0);
3357 break; 3362 break;
3358 case UIMSG_PlayerCreation_FacePrev: 3363 case UIMSG_PlayerCreation_FacePrev:
3359 pPlayer = &pParty->pPlayers[pParam]; 3364 pPlayer = &pParty->pPlayers[pParam];
3360 if (!pPlayer->uFace) 3365 if (!pPlayer->uCurrentFace)
3361 pPlayer->uFace = 19; 3366 pPlayer->uCurrentFace = 19;
3362 else 3367 else
3363 pPlayer->uFace -= 1; 3368 pPlayer->uCurrentFace -= 1;
3364 pPlayer->uVoiceID = pPlayer->uFace; 3369 pPlayer->uVoiceID = pPlayer->uCurrentFace;
3365 pPlayer->SetInitialStats(); 3370 pPlayer->SetInitialStats();
3366 pPlayer->SetSexByVoice(); 3371 pPlayer->SetSexByVoice();
3367 pPlayer->RandomizeName(); 3372 pPlayer->RandomizeName();
3368 v25 = pParam; 3373 v25 = pParam;
3369 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) 3374 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
3373 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); 3378 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0);
3374 pPlayer->PlaySound(SPEECH_PickMe, 0); 3379 pPlayer->PlaySound(SPEECH_PickMe, 0);
3375 break; 3380 break;
3376 case UIMSG_PlayerCreation_FaceNext: 3381 case UIMSG_PlayerCreation_FaceNext:
3377 pPlayer = &pParty->pPlayers[pParam]; 3382 pPlayer = &pParty->pPlayers[pParam];
3378 v20 = (char)((int)pPlayer->uFace + 1) % 20; 3383 v20 = (char)((int)pPlayer->uCurrentFace + 1) % 20;
3379 pPlayer->uFace = v20; 3384 pPlayer->uCurrentFace = v20;
3380 pPlayer->uVoiceID = v20; 3385 pPlayer->uVoiceID = v20;
3381 pPlayer->SetInitialStats(); 3386 pPlayer->SetInitialStats();
3382 pPlayer->SetSexByVoice(); 3387 pPlayer->SetSexByVoice();
3383 pPlayer->RandomizeName(); 3388 pPlayer->RandomizeName();
3384 v21 = pParam; 3389 v21 = pParam;
6000 papredoll_drhs[v1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6005 papredoll_drhs[v1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6001 wsprintfA(pContainer, "pc23v%dlh", v9); 6006 wsprintfA(pContainer, "pc23v%dlh", v9);
6002 papredoll_dlhs[v1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6007 papredoll_dlhs[v1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6003 wsprintfA(pContainer, "pc23v%dlhu", v9); 6008 wsprintfA(pContainer, "pc23v%dlhu", v9);
6004 papredoll_dlhus[v1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6009 papredoll_dlhus[v1] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6005 v6 = pPlayers[v1 + 1]->uFace; 6010 v6 = pPlayers[v1 + 1]->uCurrentFace;
6006 if ( v6 == 12 || v6 == 13 ) 6011 if ( v6 == 12 || v6 == 13 )
6007 papredoll_dbrds[pPlayers[v8]->uFace] = 0; 6012 papredoll_dbrds[pPlayers[v8]->uCurrentFace] = 0;
6008 papredoll_flying_feet[pPlayers[v8]->uFace] = 0; 6013 papredoll_flying_feet[pPlayers[v8]->uCurrentFace] = 0;
6009 IsPlayerWearingWatersuit[v8] = 1; 6014 IsPlayerWearingWatersuit[v8] = 1;
6010 } 6015 }
6011 } 6016 }
6012 6017
6013 //----- (0043F0BD) -------------------------------------------------------- 6018 //----- (0043F0BD) --------------------------------------------------------
6025 v7 = uPlayerID; 6030 v7 = uPlayerID;
6026 if ( ((uPlayerID - 1) & 0x80000000u) == 0 ) 6031 if ( ((uPlayerID - 1) & 0x80000000u) == 0 )
6027 { 6032 {
6028 v2 = &pPlayers[uPlayerID]; 6033 v2 = &pPlayers[uPlayerID];
6029 v3 = uPlayerID - 1; 6034 v3 = uPlayerID - 1;
6030 papredoll_dbods[v3] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[(*v2)->uFace], TEXTURE_16BIT_PALETTE); 6035 papredoll_dbods[v3] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[(*v2)->uCurrentFace], TEXTURE_16BIT_PALETTE);
6031 papredoll_dlads[v3] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[(*v2)->uFace], TEXTURE_16BIT_PALETTE); 6036 papredoll_dlads[v3] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[(*v2)->uCurrentFace], TEXTURE_16BIT_PALETTE);
6032 papredoll_dlaus[v3] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[(*v2)->uFace], TEXTURE_16BIT_PALETTE); 6037 papredoll_dlaus[v3] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[(*v2)->uCurrentFace], TEXTURE_16BIT_PALETTE);
6033 papredoll_drhs[v3] = pIcons_LOD->LoadTexture(drh_texnames_by_face[(*v2)->uFace], TEXTURE_16BIT_PALETTE); 6038 papredoll_drhs[v3] = pIcons_LOD->LoadTexture(drh_texnames_by_face[(*v2)->uCurrentFace], TEXTURE_16BIT_PALETTE);
6034 papredoll_dlhs[v3] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[(*v2)->uFace], TEXTURE_16BIT_PALETTE); 6039 papredoll_dlhs[v3] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[(*v2)->uCurrentFace], TEXTURE_16BIT_PALETTE);
6035 papredoll_dlhus[v3] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[(*v2)->uFace], TEXTURE_16BIT_PALETTE); 6040 papredoll_dlhus[v3] = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[(*v2)->uCurrentFace], TEXTURE_16BIT_PALETTE);
6036 v4 = (int)&(*v2)->uFace; 6041 v4 = (int)&(*v2)->uCurrentFace;
6037 v5 = *(char *)v4; 6042 v5 = *(char *)v4;
6038 if ( *(char *)v4 == 12 || v5 == 13 ) 6043 if ( *(char *)v4 == 12 || v5 == 13 )
6039 { 6044 {
6040 wsprintfA(pContainer, "pc%02dbrd", v5 + 1); 6045 wsprintfA(pContainer, "pc%02dbrd", v5 + 1);
6041 v4 = (int)&(*v2)->uFace; 6046 v4 = (int)&(*v2)->uCurrentFace;
6042 papredoll_dbrds[*(char *)v4] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6047 papredoll_dbrds[*(char *)v4] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6043 } 6048 }
6044 wsprintfA(pContainer, "item281pc%02d", *(char *)v4 + 1); 6049 wsprintfA(pContainer, "item281pc%02d", *(char *)v4 + 1);
6045 papredoll_flying_feet[(*v2)->uFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 6050 papredoll_flying_feet[(*v2)->uCurrentFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
6046 result = v7; 6051 result = v7;
6047 IsPlayerWearingWatersuit[v7] = 0; 6052 IsPlayerWearingWatersuit[v7] = 0;
6048 } 6053 }
6049 return result; 6054 return result;
6050 } 6055 }
9110 return v5; 9115 return v5;
9111 } 9116 }
9112 9117
9113 9118
9114 //----- (0040D75D) -------------------------------------------------------- 9119 //----- (0040D75D) --------------------------------------------------------
9115 char __fastcall pPrimaryWindow_draws_text(int a1, const char *pText, int *pXY) 9120 void pPrimaryWindow_draws_text( int a1, const char *pText, int *pXY )
9116 { 9121 {
9117 const char *v3; // ST0C_4@1 9122 const char *v3; // ST0C_4@1
9118 __int64 v4; // qax@1 9123 __int64 v4; // qax@1
9119 9124
9120 v3 = pText; 9125 v3 = pText;
9121 v4 = LOBYTE(pFontComic->uFontHeight) - 3; 9126 v4 = LOBYTE(pFontComic->uFontHeight) - 3;
9122 return pPrimaryWindow->DrawText( 9127 pPrimaryWindow->DrawText(
9123 pFontComic, 9128 pFontComic,
9124 *pXY, 9129 *pXY,
9125 pXY[1] - (((signed int)v4 - HIDWORD(v4)) >> 1) + 3, 9130 pXY[1] - (((signed int)v4 - HIDWORD(v4)) >> 1) + 3,
9126 0, 9131 0,
9127 v3, 9132 v3,
9901 v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);*/ 9906 v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u);*/
9902 } 9907 }
9903 // 4E1D3A: using guessed type __int16 word_4E1D3A[]; 9908 // 4E1D3A: using guessed type __int16 word_4E1D3A[];
9904 9909
9905 9910
9906 //----- (00413D3C) --------------------------------------------------------
9907 char *__cdecl GetDayPart()
9908 {
9909 if ( pParty->uCurrentHour > 4 )
9910 {
9911 if ( pParty->uCurrentHour == 5 )
9912 return pGlobalTXT_LocalizationStrings[55];
9913 if ( pParty->uCurrentHour == 20 )
9914 return pGlobalTXT_LocalizationStrings[566];
9915 if ( pParty->uCurrentHour <= 0x14 || pParty->uCurrentHour > 0x17 )
9916 return pGlobalTXT_LocalizationStrings[56];
9917 }
9918 return pGlobalTXT_LocalizationStrings[567];
9919 }
9920
9921 //----- (00413FF1) -------------------------------------------------------- 9911 //----- (00413FF1) --------------------------------------------------------
9922 void SetMonthNames() 9912 void SetMonthNames()
9923 { 9913 {
9924 aMonthNames[0] = pGlobalTXT_LocalizationStrings[415]; 9914 aMonthNames[0] = pGlobalTXT_LocalizationStrings[415];
9925 aMonthNames[1] = pGlobalTXT_LocalizationStrings[416]; 9915 aMonthNames[1] = pGlobalTXT_LocalizationStrings[416];
10058 + 2 * LOBYTE(pFontSmallnum->uFontHeight) 10048 + 2 * LOBYTE(pFontSmallnum->uFontHeight)
10059 + 24; 10049 + 24;
10060 Dst.uFrameY = 470 - Dst.uFrameHeight; 10050 Dst.uFrameY = 470 - Dst.uFrameHeight;
10061 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; 10051 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
10062 Dst.uFrameW = 469; 10052 Dst.uFrameW = 469;
10053 //Dst.Hint = "abcagfdsgsg ljsrengvlkjesnfkjwnef";
10063 Dst.DrawMessageBox(0); 10054 Dst.DrawMessageBox(0);
10055
10064 Dst.uFrameWidth -= 24; 10056 Dst.uFrameWidth -= 24;
10065 Dst.uFrameX += 12; 10057 Dst.uFrameX += 12;
10066 Dst.uFrameY += 12; 10058 Dst.uFrameY += 12;
10067 Dst.uFrameHeight -= 12; 10059 Dst.uFrameHeight -= 12;
10068 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; 10060 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
10069 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; 10061 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
10070 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, 0, pGlobalTXT_LocalizationStrings[157], 3u); 10062 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3);
10071 } 10063 }
10072 10064
10073 10065
10074 10066
10075 //----- (004156F0) -------------------------------------------------------- 10067 //----- (004156F0) --------------------------------------------------------
10149 TravelUI_Draw(); 10141 TravelUI_Draw();
10150 continue; 10142 continue;
10151 } 10143 }
10152 case WINDOW_SpellBook: 10144 case WINDOW_SpellBook:
10153 { 10145 {
10154 DrawSpellBookContent(); 10146 DrawSpellBookContent(pPlayers[uActiveCharacter]);
10155 continue; 10147 continue;
10156 } 10148 }
10157 case WINDOW_GreetingNPC: 10149 case WINDOW_GreetingNPC:
10158 { 10150 {
10159 DrawBranchlessDialogueUI(); 10151 DrawBranchlessDialogueUI();
10813 { 10805 {
10814 if ( v51 != 4 ) 10806 if ( v51 != 4 )
10815 { 10807 {
10816 if ( v51 != 5 ) 10808 if ( v51 != 5 )
10817 { 10809 {
10818 v19 = v0->AddItem(0xFFFFFFFFu, 0xDCu); 10810 v19 = v0->AddItem(-1, 0xDCu);
10819 if ( v19 ) 10811 if ( v19 )
10820 *(int *)&v0->field_1F5[36 * v19 + 15] = 1; 10812 // *(int *)&v0->field_1F5[36 * v19 + 15] = 1;
10813 v0->pOwnItems[v19-1].uAttributes=ITEM_IDENTIFIED;
10821 v20 = v47 + 50 * v15; 10814 v20 = v47 + 50 * v15;
10822 v0->pInventoryItems[pOut.z].uItemID = v51; 10815 v0->pInventoryItems[pOut.z].uItemID = v51;
10823 v0->pInventoryItems[pOut.z].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType 10816 v0->pInventoryItems[pOut.z].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType
10824 + v0->pInventoryItems[pOut.z].uEnchantmentType) 10817 + v0->pInventoryItems[pOut.z].uEnchantmentType)
10825 / 2; 10818 / 2;
10837 { 10830 {
10838 if ( *(int *)(a2.y + 532) == 221 ) 10831 if ( *(int *)(a2.y + 532) == 221 )
10839 *(int *)(a2.y + 532) = pParty->pPickedItem.uItemID; 10832 *(int *)(a2.y + 532) = pParty->pPickedItem.uItemID;
10840 else 10833 else
10841 *(int *)(a2.y + 536) = pParty->pPickedItem.uEnchantmentType; 10834 *(int *)(a2.y + 536) = pParty->pPickedItem.uEnchantmentType;
10842 v21 = v0->AddItem(0xFFFFFFFFu, 0xDCu); 10835 v21 = v0->AddItem(-1, 0xDCu);
10843 if ( v21 ) 10836 if ( v21 )
10844 *(int *)&v0->field_1F5[36 * v21 + 15] = 1; 10837 //*(int *)&v0->field_1F5[36 * v21 + 15] = 1;
10838 v0->pOwnItems[v21-1].uAttributes=ITEM_IDENTIFIED;
10845 goto LABEL_74; 10839 goto LABEL_74;
10846 } 10840 }
10847 goto LABEL_115; 10841 goto LABEL_115;
10848 } 10842 }
10849 v0->RemoveItemAtInventoryIndex(v18); 10843 v0->RemoveItemAtInventoryIndex(v18);
10850 v0->SetCondition(0x10u, 0); 10844 v0->SetCondition(0x10u, 0);
10851 v23 = 0; 10845 v23 = 0;
10852 } 10846 }
10853 } 10847 }
10854 v0->_4160CA(v23); 10848 v0->ItemsEnchant(v23);
10855 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); 10849 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
10856 10850
10857 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); 10851 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
10858 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 10852 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
10859 { 10853 {
11312 } 11306 }
11313 return v2; 11307 return v2;
11314 } 11308 }
11315 11309
11316 //----- (004179BC) -------------------------------------------------------- 11310 //----- (004179BC) --------------------------------------------------------
11317 char __fastcall sub_4179BC_draw_tooltip(const char *a1, const char *a2) 11311 void __fastcall sub_4179BC_draw_tooltip( const char *a1, const char *a2 )
11318 { 11312 {
11319 const char *v2; // ebx@1 11313 const char *v2; // ebx@1
11320 const char *v3; // edi@1 11314 const char *v3; // edi@1
11321 unsigned int v4; // eax@1 11315 unsigned int v4; // eax@1
11322 GUIWindow Dst; // [sp+Ch] [bp-5Ch]@1 11316 GUIWindow Dst; // [sp+Ch] [bp-5Ch]@1
11323 POINT v6; // [sp+60h] [bp-8h]@1 11317 POINT v6; // [sp+60h] [bp-8h]@1
11340 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; 11334 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
11341 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; 11335 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
11342 v4 = TargetColor(0xFFu, 0xFFu, 0x9Bu); 11336 v4 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
11343 sprintf(pTmpBuf, format_4E2D80, v4, v3); 11337 sprintf(pTmpBuf, format_4E2D80, v4, v3);
11344 Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u); 11338 Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3u);
11345 return Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v2, 0, 0, 0); 11339 Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v2, 0, 0, 0);
11346 } 11340 }
11347 11341
11348 //----- (00417AD4) -------------------------------------------------------- 11342 //----- (00417AD4) --------------------------------------------------------
11349 unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level) 11343 unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level)
11350 { 11344 {