Mercurial > mm7
diff mm7_2.cpp @ 2152:d44b7775fc06
Removed DirectDraw2 compatibility.
3D Sound enabled (change 3DSoundProvider registry entry to activate it).
Moved all forward declarations to mm7_unsorted_subs.h (many cpp files do not need them anyweay).
author | Nomad |
---|---|
date | Thu, 09 Jan 2014 01:37:34 +0200 |
parents | 92511cd8fcdb |
children | d28d3c006077 |
line wrap: on
line diff
--- a/mm7_2.cpp Wed Jan 08 22:29:11 2014 +0200 +++ b/mm7_2.cpp Thu Jan 09 01:37:34 2014 +0200 @@ -9,6 +9,7 @@ #include "Texture.h" #include "mm7_data.h" +#include "mm7_unsorted_subs.h" #include "VideoPlayer.h" #include "Sprites.h" #include "BSPModel.h" @@ -2279,49 +2280,7 @@ return result; } -//----- (00452AE2) -------------------------------------------------------- -int __fastcall MakeColorMaskFromBitDepth(int a1) -{ - signed __int64 v1; // qax@1 - - v1 = 4294967296i64; - if ( a1 > 0 ) - { - do - { - LODWORD(v1) = HIDWORD(v1) + v1; - HIDWORD(v1) *= 2; - --a1; - } - while ( a1 ); - } - return v1; -} - -//----- (00452AF3) -------------------------------------------------------- -void __fastcall fill_pixels_fast(unsigned int a1, unsigned __int16 *pPixels, unsigned int uNumPixels) -{ - void *v3; // edi@1 - unsigned int v4; // eax@1 - unsigned __int16 *v5; // edi@3 - unsigned int i; // ecx@3 - - v3 = pPixels; - v4 = a1 | (a1 << 16); - if ( (unsigned __int8)pPixels & 2 ) // first 2 pixels - { - *pPixels = v4; - v3 = pPixels + 1; - --uNumPixels; - } - memset32(v3, v4, uNumPixels >> 1); // 4 pixels at once - v5 = (unsigned __int16 *)((char *)v3 + 4 * (uNumPixels >> 1)); - for ( i = uNumPixels & 1; i; --i ) // leftover pixels - { - *v5 = v4; - ++v5; - } -} + //----- (00452B2E) -------------------------------------------------------- int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides) @@ -3101,7 +3060,7 @@ pRenderer->field_1036B8 = 0; pRenderer->_gpu_memory_used = 0; } - sub_46080D(); + if (uCurrentlyLoadedLevelType == LEVEL_Indoor) pIndoor->Release(); else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) @@ -4467,18 +4426,6 @@ } pODMRenderParams = new ODMRenderParams; - outdoor_day_top_r = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.r", 81, pIniFilename); - outdoor_day_top_g = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.g", 121, pIniFilename); - outdoor_day_top_b = GetPrivateProfileIntW(L"outdoor", L"RGBDayTop.b", 236, pIniFilename); - outdoor_day_bottom_r = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.r", 153, pIniFilename); - outdoor_day_bottom_g = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.g", 193, pIniFilename); - outdoor_day_bottom_b = GetPrivateProfileIntW(L"outdoor", L"RGBDayBottom.b", 237, pIniFilename); - outdoor_night_top_r = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.r", 0, pIniFilename); - outdoor_night_top_g = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.g", 0, pIniFilename); - outdoor_night_top_b = GetPrivateProfileIntW(L"outdoor", L"RGBNightTop.b", 0, pIniFilename); - outdoor_night_bottom_r = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.r", 11, pIniFilename); - outdoor_night_bottom_g = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.g", 41, pIniFilename); - outdoor_night_bottom_b = GetPrivateProfileIntW(L"outdoor", L"RGBNightBottom.b", 129, pIniFilename); pODMRenderParams->outdoor_no_mist = GetPrivateProfileIntW(L"debug", L"noMist", 0, pIniFilename); pODMRenderParams->bNoSky = GetPrivateProfileIntW(L"outdoor", L"nosky", 0, pIniFilename); pODMRenderParams->bDoNotRenderDecorations = GetPrivateProfileIntW(L"render", L"nodecorations", 0, pIniFilename); @@ -4488,12 +4435,6 @@ outdoor_grid_band_3 = GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename); pODMRenderParams->terrain_gamma = GetPrivateProfileIntW(L"outdoor", L"ter_gamma", 0, pIniFilename); pODMRenderParams->building_gamme = GetPrivateProfileIntW(L"outdoor", L"bld_gamma", 0, pIniFilename); - mipmapping_terrain_mm1 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm1", 2048, pIniFilename); - mipmapping_terrain_mm2 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm2", 4096, pIniFilename); - mipmapping_terrain_mm3 = GetPrivateProfileIntW(L"mipmapping", L"ter_mm3", 8192, pIniFilename); - mipmapping_building_mm1 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm1", 1024, pIniFilename); - mipmapping_building_mm2 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm2", 2048, pIniFilename); - mipmapping_building_mm3 = GetPrivateProfileIntW(L"mipmapping", L"bld_mm3", 4096, pIniFilename); pODMRenderParams->shading_dist_shade = GetPrivateProfileIntW(L"shading", L"dist_shade", 2048, pIniFilename); pODMRenderParams->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename); @@ -4543,11 +4484,6 @@ while ( v4 < strlen(pDefaultGroundTexture) ); } - texmapping_terrain_subdivsize = GetPrivateProfileIntW(L"texmapping", L"terrain_subdivsize", 16, pIniFilename); - texmapping_terrain_subdivpow2 = GetPrivateProfileIntW(L"texmapping", L"terrain_subdivpow2", 4, pIniFilename); - texmapping_building_subdivsize = GetPrivateProfileIntW(L"texmapping", L"building_subdivsize", 32, pIniFilename); - texmapping_building_subdivpow2 = GetPrivateProfileIntW(L"texmapping", L"building_subdivpow2", 5, pIniFilename); - MM7Initialization(); } @@ -4565,15 +4501,9 @@ pODMRenderParams->bNoSky = false; LOBYTE(viewparams->field_20) = 0; }*/ - mipmapping_terrain_mm1 = 1024; - mipmapping_terrain_mm2 = 2048; - mipmapping_building_mm1 = 1024; - mipmapping_building_mm2 = 2048; pODMRenderParams->shading_dist_shade = 2048; pODMRenderParams->terrain_gamma = 0; pODMRenderParams->building_gamme = 0; - mipmapping_terrain_mm3 = 4096; - mipmapping_building_mm3 = 4096; pODMRenderParams->shading_dist_shademist = 4096; pODMRenderParams->outdoor_no_wavy_water = 0; //_47F4D3_initialize_terrain_bezier_stuff(outdoor_grid_band_1, outdoor_grid_band_2, outdoor_grid_band_3);