Skip to content

Commit

Permalink
Return back loading stages from previous games (SOC, CS)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Jan 9, 2018
1 parent 685bd0a commit cce18f3
Show file tree
Hide file tree
Showing 20 changed files with 83 additions and 104 deletions.
4 changes: 4 additions & 0 deletions src/Layers/xrRender/dxApplicationRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ void dxApplicationRender::load_draw_internal(CApplication& owner)
logo_tex_coords.rb.set(1.0f, 0.77926f);

draw_face(hLevelLogo, r, logo_tex_coords, Fvector2().set(1, 1));
owner.pFontSystem->SetColor(color_rgba(180, 180, 180, 200));
}

owner.pFontSystem->OutI(0.f, 0.385f, owner.ls_title); // XXX: 0.385f <- hardcoded coordinates
owner.pFontSystem->OnRender();
}

void dxApplicationRender::draw_face(ref_shader& sh, Frect& coords, Frect& tex_coords, const Fvector2& tsz)
Expand Down
13 changes: 7 additions & 6 deletions src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void CRender::level_Load(IReader* fs)
IReader* chunk;

// Shaders
// g_pGamePersistent->LoadTitle ("st_loading_shaders");
g_pGamePersistent->SetLoadStageTitle("st_loading_shaders");
g_pGamePersistent->LoadTitle();
{
chunk = fs->open_chunk(fsL_SHADERS);
Expand Down Expand Up @@ -62,36 +62,37 @@ void CRender::level_Load(IReader* fs)
if (!GEnv.isDedicatedServer)
{
// VB,IB,SWI
// g_pGamePersistent->LoadTitle("st_loading_geometry");
g_pGamePersistent->SetLoadStageTitle("st_loading_geometry");
g_pGamePersistent->LoadTitle();
CStreamReader* geom = FS.rs_open("$level$", "level.geom");
LoadBuffers(geom);
LoadSWIs(geom);
FS.r_close(geom);

// Visuals
// g_pGamePersistent->LoadTitle("st_loading_spatial_db");
g_pGamePersistent->SetLoadStageTitle("st_loading_spatial_db");
g_pGamePersistent->LoadTitle();
chunk = fs->open_chunk(fsL_VISUALS);
LoadVisuals(chunk);
chunk->close();

// Details
// g_pGamePersistent->LoadTitle("st_loading_details");
g_pGamePersistent->SetLoadStageTitle("st_loading_details");
g_pGamePersistent->LoadTitle();
Details->Load();
}

// Sectors
// g_pGamePersistent->LoadTitle("st_loading_sectors_portals");
g_pGamePersistent->SetLoadStageTitle("st_loading_sectors_portals");
g_pGamePersistent->LoadTitle();
LoadSectors(fs);

// HOM
HOM.Load();

// Lights
// pApp->LoadTitle ("Loading lights...");
g_pGamePersistent->SetLoadStageTitle("st_loading_lights");
g_pGamePersistent->LoadTitle();
LoadLights(fs);

// End
Expand Down
13 changes: 7 additions & 6 deletions src/Layers/xrRenderPC_R2/r2_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void CRender::level_Load(IReader* fs)
IReader* chunk;

// Shaders
// g_pGamePersistent->LoadTitle ("st_loading_shaders");
g_pGamePersistent->SetLoadStageTitle("st_loading_shaders");
g_pGamePersistent->LoadTitle();
{
chunk = fs->open_chunk(fsL_SHADERS);
Expand Down Expand Up @@ -54,7 +54,7 @@ void CRender::level_Load(IReader* fs)
if (!GEnv.isDedicatedServer)
{
// VB,IB,SWI
// g_pGamePersistent->LoadTitle("st_loading_geometry");
g_pGamePersistent->SetLoadStageTitle("st_loading_geometry");
g_pGamePersistent->LoadTitle();
{
CStreamReader* geom = FS.rs_open("$level$", "level.geom");
Expand All @@ -73,28 +73,29 @@ void CRender::level_Load(IReader* fs)
}

// Visuals
// g_pGamePersistent->LoadTitle("st_loading_spatial_db");
g_pGamePersistent->SetLoadStageTitle("st_loading_spatial_db");
g_pGamePersistent->LoadTitle();
chunk = fs->open_chunk(fsL_VISUALS);
LoadVisuals(chunk);
chunk->close();

// Details
// g_pGamePersistent->LoadTitle("st_loading_details");
g_pGamePersistent->SetLoadStageTitle("st_loading_details");
g_pGamePersistent->LoadTitle();
Details->Load();
}

// Sectors
// g_pGamePersistent->LoadTitle("st_loading_sectors_portals");
g_pGamePersistent->SetLoadStageTitle("st_loading_sectors_portals");
g_pGamePersistent->LoadTitle();
LoadSectors(fs);

// HOM
HOM.Load();

// Lights
// pApp->LoadTitle ("Loading lights...");
g_pGamePersistent->SetLoadStageTitle("st_loading_lights");
g_pGamePersistent->LoadTitle();
LoadLights(fs);

// End
Expand Down
13 changes: 7 additions & 6 deletions src/Layers/xrRenderPC_R3/r3_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void CRender::level_Load(IReader* fs)
IReader* chunk;

// Shaders
// g_pGamePersistent->LoadTitle ("st_loading_shaders");
g_pGamePersistent->SetLoadStageTitle("st_loading_shaders");
g_pGamePersistent->LoadTitle();
{
chunk = fs->open_chunk(fsL_SHADERS);
Expand Down Expand Up @@ -57,7 +57,7 @@ void CRender::level_Load(IReader* fs)
if (!GEnv.isDedicatedServer)
{
// VB,IB,SWI
// g_pGamePersistent->LoadTitle("st_loading_geometry");
g_pGamePersistent->SetLoadStageTitle("st_loading_geometry");
g_pGamePersistent->LoadTitle();
{
CStreamReader* geom = FS.rs_open("$level$", "level.geom");
Expand All @@ -76,20 +76,20 @@ void CRender::level_Load(IReader* fs)
}

// Visuals
// g_pGamePersistent->LoadTitle("st_loading_spatial_db");
g_pGamePersistent->SetLoadStageTitle("st_loading_spatial_db");
g_pGamePersistent->LoadTitle();
chunk = fs->open_chunk(fsL_VISUALS);
LoadVisuals(chunk);
chunk->close();

// Details
// g_pGamePersistent->LoadTitle("st_loading_details");
g_pGamePersistent->SetLoadStageTitle("st_loading_details");
g_pGamePersistent->LoadTitle();
Details->Load();
}

// Sectors
// g_pGamePersistent->LoadTitle("st_loading_sectors_portals");
g_pGamePersistent->SetLoadStageTitle("st_loading_sectors_portals");
g_pGamePersistent->LoadTitle();
LoadSectors(fs);

Expand All @@ -100,7 +100,8 @@ void CRender::level_Load(IReader* fs)
HOM.Load();

// Lights
// pApp->LoadTitle ("Loading lights...");
g_pGamePersistent->SetLoadStageTitle("st_loading_lights");
g_pGamePersistent->LoadTitle();
LoadLights(fs);

// End
Expand Down
13 changes: 7 additions & 6 deletions src/Layers/xrRenderPC_R4/r4_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void CRender::level_Load(IReader* fs)
IReader* chunk;

// Shaders
// g_pGamePersistent->LoadTitle ("st_loading_shaders");
g_pGamePersistent->SetLoadStageTitle("st_loading_shaders");
g_pGamePersistent->LoadTitle();
{
chunk = fs->open_chunk(fsL_SHADERS);
Expand Down Expand Up @@ -57,7 +57,7 @@ void CRender::level_Load(IReader* fs)
if (!GEnv.isDedicatedServer)
{
// VB,IB,SWI
// g_pGamePersistent->LoadTitle("st_loading_geometry");
g_pGamePersistent->SetLoadStageTitle("st_loading_geometry");
g_pGamePersistent->LoadTitle();
{
CStreamReader* geom = FS.rs_open("$level$", "level.geom");
Expand All @@ -76,20 +76,20 @@ void CRender::level_Load(IReader* fs)
}

// Visuals
// g_pGamePersistent->LoadTitle("st_loading_spatial_db");
g_pGamePersistent->SetLoadStageTitle("st_loading_spatial_db");
g_pGamePersistent->LoadTitle();
chunk = fs->open_chunk(fsL_VISUALS);
LoadVisuals(chunk);
chunk->close();

// Details
// g_pGamePersistent->LoadTitle("st_loading_details");
g_pGamePersistent->SetLoadStageTitle("st_loading_details");
g_pGamePersistent->LoadTitle();
Details->Load();
}

// Sectors
// g_pGamePersistent->LoadTitle("st_loading_sectors_portals");
g_pGamePersistent->SetLoadStageTitle("st_loading_sectors_portals");
g_pGamePersistent->LoadTitle();
LoadSectors(fs);

Expand All @@ -100,7 +100,8 @@ void CRender::level_Load(IReader* fs)
HOM.Load();

// Lights
// pApp->LoadTitle ("Loading lights...");
g_pGamePersistent->SetLoadStageTitle("st_loading_lights");
g_pGamePersistent->LoadTitle();
LoadLights(fs);

// End
Expand Down
62 changes: 6 additions & 56 deletions src/utils/xrSE_Factory/xrSE_Factory.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,68 +67,23 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)Common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)Common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Mixed|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)Common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Mixed|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)Common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)Common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)Common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>XRSE_FACTORY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<AdditionalIncludeDirectories>$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>XRSE_FACTORY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Mixed|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>XRSE_FACTORY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Mixed|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>XRSE_FACTORY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>XRSE_FACTORY_EXPORTS;LUABIND_NO_ERROR_CHECKING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(xrExternals)pugixml\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>XRSE_FACTORY_EXPORTS;LUABIND_NO_ERROR_CHECKING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>LUABIND_NO_ERROR_CHECKING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down Expand Up @@ -643,12 +598,7 @@
<ClCompile Include="properties_list_helper_script.cpp" />
<ClCompile Include="script_properties_list_helper.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Mixed|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Mixed|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="xrSE_Factory.cpp" />
<ClCompile Include="xrUIXmlParser.cpp" />
Expand All @@ -657,7 +607,7 @@
<ProjectReference Include="$(SolutionDir)xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\Externals\luabind\src\luabind.vcxproj">
<ProjectReference Include="$(xrExternals)luabind.vcxproj">
<Project>{ccd4afae-aa10-42c6-a452-fdee497ccdf1}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\Externals\luajit\src\luajit.vcxproj">
Expand Down
4 changes: 2 additions & 2 deletions src/xrEngine/IGame_Level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool IGame_Level::Load(u32 dwNum)
pLevel = new CInifile(temp);

// Open
// g_pGamePersistent->LoadTitle ("st_opening_stream");
g_pGamePersistent->SetLoadStageTitle("st_opening_stream");
g_pGamePersistent->LoadTitle();
IReader* LL_Stream = FS.r_open("$level$", "level");
IReader& fs = *LL_Stream;
Expand All @@ -98,7 +98,7 @@ bool IGame_Level::Load(u32 dwNum)
R_ASSERT2(XRCL_PRODUCTION_VERSION == H.XRLC_version, "Incompatible level version.");

// CForms
// g_pGamePersistent->LoadTitle ("st_loading_cform");
g_pGamePersistent->SetLoadStageTitle("st_loading_cform");
g_pGamePersistent->LoadTitle();
ObjectSpace.Load(build_callback);
// GEnv.Sound->set_geometry_occ ( &Static );
Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/IGame_Persistent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void IGame_Persistent::Disconnect()
void IGame_Persistent::OnGameStart()
{
#ifndef _EDITOR
// LoadTitle("st_prefetching_objects");
SetLoadStageTitle("st_prefetching_objects");
LoadTitle();
if (!strstr(Core.Params, "-noprefetch"))
Prefetch();
Expand Down
1 change: 1 addition & 0 deletions src/xrEngine/IGame_Persistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class ENGINE_API IGame_Persistent :
ICF u32 GameType() { return m_game_params.m_e_game_type; };
virtual void DumpStatistics(class IGameFont& font, class IPerformanceAlert* alert);
virtual void LoadTitle(bool /*change_tip*/ = false, shared_str /*map_name*/ = "") {}
virtual void SetLoadStageTitle(pcstr /*ls_title*/) {}
virtual bool CanBePaused() { return true; }
};

Expand Down
5 changes: 5 additions & 0 deletions src/xrEngine/x_ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ void CApplication::LoadDraw()
Device.End();
}

void CApplication::SetLoadStageTitle(pcstr _ls_title)
{
xr_strcpy(ls_title, _ls_title);
}

void CApplication::LoadTitleInt(LPCSTR str1, LPCSTR str2, LPCSTR str3)
{
xr_strcpy(ls_header, str1);
Expand Down
3 changes: 3 additions & 0 deletions src/xrEngine/x_ray.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ENGINE_API CApplication : public pureFrame, public IEventReceiver
};

public:
string256 ls_title;
string2048 ls_header;
string2048 ls_tip_number;
string2048 ls_tip;
Expand Down Expand Up @@ -65,6 +66,8 @@ class ENGINE_API CApplication : public pureFrame, public IEventReceiver
void LoadSwitch();
void LoadDraw();

void SetLoadStageTitle(pcstr ls_title);

virtual void OnEvent(EVENT E, u64 P1, u64 P2);

// Other
Expand Down
Loading

1 comment on commit cce18f3

@Xottab-DUTY
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indirectly related to #382 and #392

Please sign in to comment.