Fixed crash in release build.

This commit is contained in:
Justin Marshall
2026-05-02 17:59:15 -07:00
parent c3497cd444
commit fc84c3cd6c
6 changed files with 36 additions and 9 deletions
+1
View File
@@ -248,6 +248,7 @@
<AdditionalLibraryDirectories>openal\lib;sys\win32\dongle;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<OutputFile>../Doom3.exe</OutputFile>
<AdditionalDependencies>d3d12.lib;nafxcw.lib;libcmt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
+1
View File
@@ -42,5 +42,6 @@
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>+set r_fullscreen 0 +set r_mode 6</LocalDebuggerCommandArguments>
<LocalDebuggerWorkingDirectory>D:\projects\Doom3</LocalDebuggerWorkingDirectory>
<LocalDebuggerCommandArgumentsHistory>+set r_fullscreen 0 +set r_mode 6|</LocalDebuggerCommandArgumentsHistory>
</PropertyGroup>
</Project>
+1
View File
@@ -253,6 +253,7 @@
</PreBuildEvent>
<Link>
<OutputFile>../gamex64.dll</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
+23 -2
View File
@@ -9567,8 +9567,29 @@ static std::unordered_map<HPBUFFERARB, QD3D12Pbuffer*> g_qd3d12Pbuffers;
static void QD3D12_RegisterWindowDC(QD3D12Window* w)
{
if (w && w->hdc)
g_qd3d12DcToWindow[w->hdc] = w;
if (w == NULL) {
return;
}
const HDC hdc = w->hdc;
if (hdc == NULL) {
return;
}
// If the HDC is already registered, only update the pointer.
// This avoids insert/rehash for the common case.
std::unordered_map<HDC, QD3D12Window*>::iterator it = g_qd3d12DcToWindow.find(hdc);
if (it != g_qd3d12DcToWindow.end()) {
it->second = w;
return;
}
// Avoid tiny-map rehash behavior in release builds.
if (g_qd3d12DcToWindow.bucket_count() < 256) {
g_qd3d12DcToWindow.reserve(256);
}
g_qd3d12DcToWindow.emplace(hdc, w);
}
static void QD3D12_UnregisterWindowDC(HDC dc)
+1 -1
View File
@@ -232,7 +232,7 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>streamline/include</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions102</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>
+9 -6
View File
@@ -1618,13 +1618,16 @@ idImage *idImageManager::ImageFromFile( const char *_name, textureFilter_t filte
}
if (depth == TD_BUMP)
if (image->texnum != idImage::TEXTURE_NOT_LOADED)
{
glTextureNormalMap(image->texnum, true);
}
else
{
glTextureNormalMap(image->texnum, false);
if (depth == TD_BUMP)
{
glTextureNormalMap(image->texnum, true);
}
else
{
glTextureNormalMap(image->texnum, false);
}
}
return image;