Mercurial > mm7
comparison Engine/Graphics/PaletteManager.cpp @ 2541:a902abdfc7f2
1. Renamed class Game to class Engine.
2. Separated game logic as state of FSM from game logic as engine.
3. Found out that many UI screen initializers were optimized away, intially
they all returned newly created window as separate object like it is done
in CharacterUI_Initialize.
author | a.parshin |
---|---|
date | Sun, 10 May 2015 01:29:11 +0200 |
parents | 68cdef6879a0 |
children | dd36326a9994 |
comparison
equal
deleted
inserted
replaced
2540:abc6a9d079b9 | 2541:a902abdfc7f2 |
---|---|
1 #define _CRTDBG_MAP_ALLOC | 1 #define _CRTDBG_MAP_ALLOC |
2 #include <stdlib.h> | 2 #include <stdlib.h> |
3 #include <crtdbg.h> | 3 #include <crtdbg.h> |
4 | 4 |
5 #define _CRT_SECURE_NO_WARNINGS | 5 #define _CRT_SECURE_NO_WARNINGS |
6 #include "../ErrorHandling.h" | 6 #include "Engine/Engine.h" |
7 #include "PaletteManager.h" | 7 #include "PaletteManager.h" |
8 #include "../Game.h" | 8 #include "Engine/LOD.h" |
9 #include "../LOD.h" | 9 #include "Engine/OurMath.h" |
10 #include "../Log.h" | 10 |
11 #include "../OurMath.h" | |
12 | |
13 #include "../mm7_data.h" | |
14 | 11 |
15 | 12 |
16 | 13 |
17 | 14 |
18 PaletteManager *pPaletteManager = new PaletteManager; | 15 PaletteManager *pPaletteManager = new PaletteManager; |
910 //----- (0047BE72) -------------------------------------------------------- | 907 //----- (0047BE72) -------------------------------------------------------- |
911 unsigned __int16 *PaletteManager::Get_Mist_or_Red_LUT(int a1, int a2, char a3) | 908 unsigned __int16 *PaletteManager::Get_Mist_or_Red_LUT(int a1, int a2, char a3) |
912 { | 909 { |
913 int v3; // eax@4 | 910 int v3; // eax@4 |
914 | 911 |
915 if ( a3 & 2 || byte_4D864C && BYTE2(pGame->uFlags) & 4 ) | 912 if ( a3 & 2 || byte_4D864C && BYTE2(pEngine->uFlags) & 4 ) |
916 v3 = 32 * a1 + a2 + 3275; | 913 v3 = 32 * a1 + a2 + 3275; |
917 else | 914 else |
918 v3 = 32 * a1 + a2 + 1675; | 915 v3 = 32 * a1 + a2 + 1675; |
919 return (unsigned __int16 *)((char *)&pPaletteManager + 512 * v3); | 916 return (unsigned __int16 *)((char *)&pPaletteManager + 512 * v3); |
920 } | 917 } |
924 //----- (0041F50D) -------------------------------------------------------- | 921 //----- (0041F50D) -------------------------------------------------------- |
925 unsigned __int16 *PaletteManager::Get_Dark_or_Red_LUT(int a1, int a2, char a3) | 922 unsigned __int16 *PaletteManager::Get_Dark_or_Red_LUT(int a1, int a2, char a3) |
926 { | 923 { |
927 int v3; // eax@4 | 924 int v3; // eax@4 |
928 | 925 |
929 if ( a3 & 2 || byte_4D864C && BYTE2(pGame->uFlags) & 4 ) | 926 if ( a3 & 2 || byte_4D864C && BYTE2(pEngine->uFlags) & 4 ) |
930 v3 = 32 * a1 + a2 + 3275; | 927 v3 = 32 * a1 + a2 + 3275; |
931 else | 928 else |
932 v3 = 32 * a1 + a2 + 75; | 929 v3 = 32 * a1 + a2 + 75; |
933 return (unsigned __int16 *)((char *)&pPaletteManager + 512 * v3); | 930 return (unsigned __int16 *)((char *)&pPaletteManager + 512 * v3); |
934 } | 931 } |
938 //----- (0047C30E) -------------------------------------------------------- | 935 //----- (0047C30E) -------------------------------------------------------- |
939 unsigned __int16 *PaletteManager::_47C30E_get_palette(int a1, char a2) | 936 unsigned __int16 *PaletteManager::_47C30E_get_palette(int a1, char a2) |
940 { | 937 { |
941 char *result; // eax@4 | 938 char *result; // eax@4 |
942 | 939 |
943 if ( a2 & 2 || byte_4D864C && BYTE2(pGame->uFlags) & 4 ) | 940 if ( a2 & 2 || byte_4D864C && BYTE2(pEngine->uFlags) & 4 ) |
944 result = (char *)pPaletteManager->field_199600_palettes[a1]; | 941 result = (char *)pPaletteManager->field_199600_palettes[a1]; |
945 else | 942 else |
946 result = (char *)pPaletteManager->field_D1600[a1]; | 943 result = (char *)pPaletteManager->field_D1600[a1]; |
947 return (unsigned __int16 *)result; | 944 return (unsigned __int16 *)result; |
948 } | 945 } |
951 //----- (0047C33F) -------------------------------------------------------- | 948 //----- (0047C33F) -------------------------------------------------------- |
952 unsigned __int16 *PaletteManager::_47C33F_get_palette(int a1, char a2) | 949 unsigned __int16 *PaletteManager::_47C33F_get_palette(int a1, char a2) |
953 { | 950 { |
954 unsigned __int16 *result; // eax@4 | 951 unsigned __int16 *result; // eax@4 |
955 | 952 |
956 if ( a2 & 2 || byte_4D864C && BYTE2(pGame->uFlags) & 4 ) | 953 if ( a2 & 2 || byte_4D864C && BYTE2(pEngine->uFlags) & 4 ) |
957 result = (unsigned __int16 *)pPaletteManager->field_199600_palettes[a1]; | 954 result = (unsigned __int16 *)pPaletteManager->field_199600_palettes[a1]; |
958 else | 955 else |
959 result = (unsigned __int16 *)pPaletteManager->pPalette1[a1]; | 956 result = (unsigned __int16 *)pPaletteManager->pPalette1[a1]; |
960 return result; | 957 return result; |
961 } | 958 } |