Skip to content

Commit

Permalink
Reduce differences between files.
Browse files Browse the repository at this point in the history
  • Loading branch information
intorr committed Jan 25, 2018
1 parent 6177b7e commit 62bb2af
Show file tree
Hide file tree
Showing 6 changed files with 456 additions and 53 deletions.
9 changes: 7 additions & 2 deletions src/utils/xrAI/compiler_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ void xrLoad(LPCSTR name, bool draft_mode)
IReader* THM = FS.r_open("$game_textures$", N);
R_ASSERT2(THM, N);

// version
//u32 version = 0;
//R_ASSERT2(THM->r_chunk(THM_CHUNK_VERSION, &version), N);
//if (version != THM_CURRENT_VERSION) FATAL("Unsupported version of THM file.");

// analyze thumbnail information
BT.THM.Load(*THM);
BOOL bLOD = FALSE;
Expand All @@ -169,8 +174,8 @@ void xrLoad(LPCSTR name, bool draft_mode)
if ((w != BT.dwWidth) || (h != BT.dwHeight))
{
Msg("! THM doesn't correspond to the texture: %dx%d -> %dx%d", BT.dwWidth, BT.dwHeight, w, h);
BT.dwWidth = w;
BT.dwHeight = h;
BT.dwWidth = BT.THM.width = w;
BT.dwHeight = BT.THM.height = h;
}
BT.Vflip();
}
Expand Down
22 changes: 6 additions & 16 deletions src/utils/xrLC/Build_Load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,20 +323,12 @@ void CBuild::Load(const b_params& Params, const IReader& _in_FS)
R_ASSERT2(THM, th_name);

// version
u32 version = 0;
R_ASSERT2(THM->r_chunk(THM_CHUNK_VERSION, &version), th_name);
// if( version!=THM_CURRENT_VERSION ) FATAL ("Unsupported version of THM file.");
//u32 version = 0;
//R_ASSERT2(THM->r_chunk(THM_CHUNK_VERSION, &version), th_name);
//if (version != THM_CURRENT_VERSION) FATAL("Unsupported version of THM file.");

// analyze thumbnail information
R_ASSERT2(THM->find_chunk(THM_CHUNK_TEXTUREPARAM), th_name);
THM->r(&BT.THM.fmt, sizeof(STextureParams::ETFormat));
BT.THM.flags.assign(THM->r_u32());
BT.THM.border_color = THM->r_u32();
BT.THM.fade_color = THM->r_u32();
BT.THM.fade_amount = THM->r_u32();
BT.THM.mip_filter = THM->r_u32();
BT.THM.width = THM->r_u32();
BT.THM.height = THM->r_u32();
BT.THM.Load(*THM);
BOOL bLOD = FALSE;
if (N[0] == 'l' && N[1] == 'o' && N[2] == 'd' && N[3] == '\\')
bLOD = TRUE;
Expand All @@ -347,8 +339,7 @@ void CBuild::Load(const b_params& Params, const IReader& _in_FS)
BT.bHasAlpha = BT.THM.HasAlphaChannel();
if (!bLOD)
{
if (BT.bHasAlpha || BT.THM.flags.test(STextureParams::flImplicitLighted) ||
g_build_options.b_radiosity)
if (BT.bHasAlpha || BT.THM.flags.test(STextureParams::flImplicitLighted) || g_build_options.b_radiosity)
{
Logger.clMsg("- loading: %s", N);
u32 w = 0, h = 0;
Expand All @@ -357,8 +348,7 @@ void CBuild::Load(const b_params& Params, const IReader& _in_FS)
R_ASSERT2(BT.pSurface, "Can't load surface");
if ((w != BT.dwWidth) || (h != BT.dwHeight))
{
Msg("! THM doesn't correspond to the texture: %dx%d -> %dx%d", BT.dwWidth, BT.dwHeight, w,
h);
Msg("! THM doesn't correspond to the texture: %dx%d -> %dx%d", BT.dwWidth, BT.dwHeight, w, h);
BT.dwWidth = BT.THM.width = w;
BT.dwHeight = BT.THM.height = h;
}
Expand Down
2 changes: 2 additions & 0 deletions src/utils/xrLC/xrLC.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
<ClInclude Include="..\..\common\NvMender2003\NVMeshMender.h" />
<ClInclude Include="..\..\common\NvMender2003\remove_isolated_verts.h" />
<ClInclude Include="..\Shader_xrLC.h" />
<ClInclude Include="..\xrLC_Light\ETextureParams.h" />
<ClInclude Include="..\xrLC_Light\itterate_adjacents.h" />
<ClInclude Include="ArbitraryList.h" />
<ClInclude Include="Build.h" />
Expand Down Expand Up @@ -246,6 +247,7 @@
<XMLDocumentationFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename)1.xdc</XMLDocumentationFileName>
</ClCompile>
<ClCompile Include="..\..\xrEngine\xrLoadSurface.cpp" />
<ClCompile Include="..\xrLC_Light\ETextureParams.cpp" />
<ClCompile Include="Build.cpp" />
<ClCompile Include="Build_Load.cpp" />
<ClCompile Include="fmesh.cpp" />
Expand Down
6 changes: 6 additions & 0 deletions src/utils/xrLC/xrLC.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
<ClInclude Include="..\xrLC_Light\itterate_adjacents.h">
<Filter>%2a%2a%2a COMPILER %2a%2a%2a</Filter>
</ClInclude>
<ClInclude Include="..\xrLC_Light\ETextureParams.h">
<Filter>External</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="StdAfx.cpp">
Expand Down Expand Up @@ -261,5 +264,8 @@
<ClCompile Include="net.cpp">
<Filter>%2a%2a%2a COMPILER %2a%2a%2a\net</Filter>
</ClCompile>
<ClCompile Include="..\xrLC_Light\ETextureParams.cpp">
<Filter>External</Filter>
</ClCompile>
</ItemGroup>
</Project>
Loading

0 comments on commit 62bb2af

Please sign in to comment.