comparison UI/UiGame.cpp @ 2076:0d535449c04f

Слияние
author Ritor1
date Wed, 04 Dec 2013 15:40:38 +0600
parents 38bf1c70fc70
children a869b0376b48
comparison
equal deleted inserted replaced
2075:24033aa2e1f8 2076:0d535449c04f
29 #include "..\IconFrameTable.h" 29 #include "..\IconFrameTable.h"
30 #include "..\TurnEngine.h" 30 #include "..\TurnEngine.h"
31 #include "..\texts.h" 31 #include "..\texts.h"
32 #include "UIHouses.h" 32 #include "UIHouses.h"
33 #include "..\BSPModel.h" 33 #include "..\BSPModel.h"
34 #include "OurMath.h" 34 #include "..\OurMath.h"
35 #include "..\Level/Decoration.h" 35 #include "..\Level/Decoration.h"
36 36
37 37
38 int uTextureID_GameUI_CharSelectionFrame; // 50C98C 38 int uTextureID_GameUI_CharSelectionFrame; // 50C98C
39 39
228 else 228 else
229 { 229 {
230 v11 = pTmpBuf.data(); 230 v11 = pTmpBuf.data();
231 strcpy(pTmpBuf.data(), pNPC->pName); 231 strcpy(pTmpBuf.data(), pNPC->pName);
232 } 232 }
233 popup_window.DrawTitleText(pFontArrus, 0, 12, TargetColor(0xFFu, 0xFFu, 0x9Bu), v11, 3); 233 popup_window.DrawTitleText(pFontArrus, 0, 12, Color16(0xFFu, 0xFFu, 0x9Bu), v11, 3);
234 popup_window.uFrameWidth -= 24; 234 popup_window.uFrameWidth -= 24;
235 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; 235 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
236 popup_window.DrawText(pFontArrus, 100, 36, 0, BuildDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0), 0, 0, 0); 236 popup_window.DrawText(pFontArrus, 100, 36, 0, BuildDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0), 0, 0, 0);
237 } 237 }
238 } 238 }
1820 int uHeight; // ebx@6 1820 int uHeight; // ebx@6
1821 unsigned int pW; // ebx@23 1821 unsigned int pW; // ebx@23
1822 int v15; // eax@23 1822 int v15; // eax@23
1823 double v20; // st7@30 1823 double v20; // st7@30
1824 signed int v27; // eax@37 1824 signed int v27; // eax@37
1825 unsigned __int16 *v28; // ecx@37 1825 //unsigned __int16 *v28; // ecx@37
1826 signed int v29; // edi@40 1826 signed int v29; // edi@40
1827 int pPoint_X; // edi@72 1827 int pPoint_X; // edi@72
1828 int pPoint_Y; // ebx@72 1828 int pPoint_Y; // ebx@72
1829 unsigned int lPitch; // [sp+20h] [bp-34h]@1 1829 unsigned int lPitch; // [sp+20h] [bp-34h]@1
1830 unsigned int pY; // [sp+20h] [bp-34h]@23 1830 unsigned int pY; // [sp+20h] [bp-34h]@23
1886 uWb = uWb - (double)(uHeight / 8); 1886 uWb = uWb - (double)(uHeight / 8);
1887 } 1887 }
1888 break; 1888 break;
1889 default: assert(false); 1889 default: assert(false);
1890 } 1890 }
1891
1892 static unsigned __int16 pOdmMinimap[117][137];
1891 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); 1893 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short));
1892 1894
1893 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); 1895 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24);
1894 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); 1896 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25);
1895 v27 = uBluea >> 16; 1897 v27 = uBluea >> 16;
1896 v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; 1898 //v28 = &pRenderer->pTargetSurface[uX + uY * lPitch];
1899
1897 if (pMapLod0 && bRedrawOdmMinimap) 1900 if (pMapLod0 && bRedrawOdmMinimap)
1898 { 1901 {
1899 assert(uWidth == 137 && uHeight == 117); 1902 assert(uWidth == 137 && uHeight == 117);
1900 //auto pMinimap = (unsigned __int16 *)pOdmMinimap; 1903 //auto pMinimap = (unsigned __int16 *)pOdmMinimap;
1901 1904
1902 ushort mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; 1905 ushort mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
1903 1906
1904 v29 = v70 >> 16; 1907 v29 = v70 >> 16;
1908 for (int y = 0; y < uHeight; ++y)
1909 {
1910 uchar* pMapLod0Line = &pMapLod0[v27 * mapWidth];
1911 for (int x = 0; x < uWidth; ++x)
1912 {
1913 //*pMinimap++ = pPal[pMapLod0Line[v29]];
1914 pRenderer->WritePixel16(uX + x, uY + y, pPal[pMapLod0Line[v29]]);
1915 v29 = (v70 + x * v73) >> 16;
1916 }
1917 uBluea += v73;
1918 v27 = uBluea >> 16;
1919 }
1920
1921 /*v29 = v70 >> 16;
1905 for (int y = 0; y < uHeight; ++y) 1922 for (int y = 0; y < uHeight; ++y)
1906 { 1923 {
1907 uchar* pMapLod0Line = &pMapLod0[v27 * mapWidth]; 1924 uchar* pMapLod0Line = &pMapLod0[v27 * mapWidth];
1908 for (int x = 0; x < uWidth; ++x) 1925 for (int x = 0; x < uWidth; ++x)
1909 { 1926 {
1913 } 1930 }
1914 v29 = v70 >> 16; 1931 v29 = v70 >> 16;
1915 v28 += 137 - uWidth; 1932 v28 += 137 - uWidth;
1916 uBluea += v73; 1933 uBluea += v73;
1917 v27 = uBluea >> 16; 1934 v27 = uBluea >> 16;
1918 } 1935 }*/
1919 } 1936 }
1920 1937
1921 for (int y = 0; y < 117; ++y) 1938 /*for (int y = 0; y < 117; ++y)
1922 { 1939 {
1923 for (int x = 0; x < 137; ++x) 1940 for (int x = 0; x < 137; ++x)
1924 { 1941 {
1925 *v28++ = pOdmMinimap[y][x]; 1942 *v28++ = pOdmMinimap[y][x];
1926 } 1943 }
1927 v28 += lPitch - 137; 1944 v28 += lPitch - 137;
1928 } 1945 }*/
1929 uNumBlueFacesInBLVMinimap = 0; 1946 uNumBlueFacesInBLVMinimap = 0;
1930 } 1947 }
1931 else// uCurrentlyLoadedLevelType == LEVEL_Indoor 1948 else// uCurrentlyLoadedLevelType == LEVEL_Indoor
1932 { 1949 {
1933 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); 1950 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF);
2212 else//Red( current_pos < 1/4 ) 2229 else//Red( current_pos < 1/4 )
2213 R = 255, G = 0, B = 0; 2230 R = 255, G = 0, B = 0;
2214 } 2231 }
2215 else//Green 2232 else//Green
2216 R = 0, G = 255, B = 0; 2233 R = 0, G = 255, B = 0;
2217 return TargetColor(R, G, B); 2234 return Color16(R, G, B);
2218 } 2235 }
2219 2236
2220 //----- (00417939) -------------------------------------------------------- 2237 //----- (00417939) --------------------------------------------------------
2221 int GetConditionDrawColor(unsigned int uConditionIdx) 2238 int GetConditionDrawColor(unsigned int uConditionIdx)
2222 { 2239 {