Skip to content

Commit

Permalink
Restore original sources state (almost unmodified leaked version).
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kovalenko committed Sep 21, 2014
1 parent fe6e119 commit ce3c373
Show file tree
Hide file tree
Showing 25 changed files with 389 additions and 368 deletions.
2 changes: 1 addition & 1 deletion src/engine/Layers/xrRender/DetailManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void CDetailManager::UpdateVisibleM()

u32 dwCC = dm_cache1_count*dm_cache1_count;

for (int _i=0; _i < dwCC ; _i++){
for (u32 _i=0; _i < dwCC ; _i++){
Slot* PS = *MS.slots[_i];
Slot& S = *PS;

Expand Down
6 changes: 1 addition & 5 deletions src/engine/Layers/xrRender/DetailManager_VS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,11 @@ void CDetailManager::hw_Render_dump (ref_constant x_array, u32 var_id, u32 lod_
RCache.stat.r.s_details.add (dwCNT_verts);
}
// Clean up
<<<<<<< HEAD
vis.clear_not_free ();
=======
vis.clear_not_free ();
>>>>>>> origin/master
}
vOffset += hw_BatchSize * Object.number_vertices;
iOffset += hw_BatchSize * Object.number_indices;
}
}

#endif // USE_DX10
#endif // USE_DX10
8 changes: 4 additions & 4 deletions src/engine/Layers/xrRender/ParticleEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,19 +442,19 @@ void ParticleRenderStream( LPVOID lpvParams )
lt.set (0.f,0.f);
rb.set (1.f,1.f);

// _mm_prefetch( (char*) &particles[i + 1] , _MM_HINT_NTA );
_mm_prefetch( (char*) &particles[i + 1] , _MM_HINT_NTA );

//if ( angle != *((DWORD*)&m.rot.x) ) {
if ( angle != *((DWORD*)&m.rot.x) ) {
angle = *((DWORD*)&m.rot.x);
__asm {
fld DWORD PTR [angle]
fsincos
fstp DWORD PTR [cosa]
fstp DWORD PTR [sina]
}
//}
}

// _mm_prefetch( 64 + (char*) &particles[i + 1] , _MM_HINT_NTA );
_mm_prefetch( 64 + (char*) &particles[i + 1] , _MM_HINT_NTA );

if (pPE.m_Def->m_Flags.is(CPEDef::dfFramed))
pPE.m_Def->m_Frame.CalculateTC(iFloor(float(m.frame)/255.f),lt,rb);
Expand Down
4 changes: 2 additions & 2 deletions src/engine/Layers/xrRenderPC_R1/xrRender_R1.vcproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="9,00"
Name="xrRender_R1"
ProjectGUID="{57A498C9-A741-4DDF-8EFC-BFB9EB6B00E2}"
RootNamespace="xrRender_R1"
Expand Down Expand Up @@ -180,7 +180,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="nvapi.lib atimgpud_s_x86.lib tal_sr.lib"
AdditionalDependencies="nvapi.lib atimgpud_s_x86.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\sdk\libraries;..\..\..\..\libraries"
GenerateDebugInformation="true"
Expand Down
2 changes: 1 addition & 1 deletion src/engine/Layers/xrRenderPC_R2/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "../../xrEngine/igame_level.h"
#include "../xrRender/blenders\blender.h"
#include "../xrRender/blenders\blender_clsid.h"
#include "../../xrEngine/psystem.h"
#include "../../xrParticles/psystem.h"
#include "../xrRender/xrRender_console.h"
#include "r2.h"

Expand Down
2 changes: 1 addition & 1 deletion src/engine/Layers/xrRenderPC_R3/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define RENDER R_R3


#include "../../xrEngine/psystem.h"
#include "../../xrParticles/psystem.h"

#include "../xrRender/HW.h"
#include "../xrRender/Shader.h"
Expand Down
2 changes: 1 addition & 1 deletion src/engine/Layers/xrRenderPC_R4/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define R_R4 4
#define RENDER R_R4

#include "../../xrEngine/psystem.h"
#include "../../xrParticles/psystem.h"

#include "../xrRender/HW.h"
#include "../xrRender/Shader.h"
Expand Down
6 changes: 3 additions & 3 deletions src/engine/utils/ETools/ETools.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="ogg_static.lib vorbis_static.lib vorbisenc_static.lib vorbisfile_static.lib"
AdditionalDependencies="libogg_static.lib libvorbis_static.lib libvorbisenc_static.lib libvorbisfile_static.lib"
LinkIncremental="1"
SuppressStartupBanner="false"
AdditionalLibraryDirectories="..\..\..\sdk\libraries;..\..\..\..\libraries"
Expand Down Expand Up @@ -201,7 +201,7 @@
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalOptions="/MACHINE:I386 /NODEFAULTLIB:LIBCMTD"
AdditionalDependencies="ogg_static_d.lib vorbis_static_d.lib vorbisenc_static.lib vorbisfile_static_d.lib"
AdditionalDependencies="libogg_static_d.lib libvorbis_static_d.lib libvorbisenc_static.lib libvorbisfile_static_d.lib"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\sdk\libraries;..\..\..\..\libraries"
Expand Down Expand Up @@ -309,7 +309,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /NODEFAULTLIB:user32"
AdditionalDependencies="ogg_static.lib vorbis_static.lib vorbisenc_static.lib vorbisfile_static.lib"
AdditionalDependencies="libogg_static.lib libvorbis_static.lib libvorbisenc_static.lib libvorbisfile_static.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\sdk\libraries;..\..\..\..\libraries"
Expand Down
4 changes: 2 additions & 2 deletions src/engine/xrCPU_Pipe/xrCPU_Pipe.vcproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="9,00"
Name="xrCPU_Pipe"
ProjectGUID="{CA0649DD-D089-423A-981C-46B57A884EB9}"
RootNamespace="xrCPU_Pipe"
TargetFrameworkVersion="131072"
>
<Platforms>
Expand Down Expand Up @@ -95,7 +96,6 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 "
AdditionalDependencies="tal_sr.lib"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\sdk\libraries;..\..\..\libraries"
Expand Down
12 changes: 6 additions & 6 deletions src/engine/xrCore/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# define O_SEQUENTIAL 0
#endif // M_BORLAND

#ifdef DEBUG
#ifdef FS_DEBUG
XRCORE_API u32 g_file_mapped_memory = 0;
u32 g_file_mapped_count = 0;
typedef xr_map<u32,std::pair<u32,shared_str> > FILE_MAPPINGS;
Expand Down Expand Up @@ -474,7 +474,7 @@ CTempReader::~CTempReader()
// pack stream
CPackReader::~CPackReader()
{
#ifdef DEBUG
#ifdef FS_DEBUG
unregister_file_mapping (base_address,Size);
#endif // DEBUG

Expand Down Expand Up @@ -514,14 +514,14 @@ CVirtualFileRW::CVirtualFileRW(const char *cFileName)
data = (char*)MapViewOfFile (hSrcMap, FILE_MAP_ALL_ACCESS, 0, 0, 0);
R_ASSERT3 (data,cFileName,Debug.error2string(GetLastError()));

#ifdef DEBUG
#ifdef FS_DEBUG
register_file_mapping (data,Size,cFileName);
#endif // DEBUG
}

CVirtualFileRW::~CVirtualFileRW()
{
#ifdef DEBUG
#ifdef FS_DEBUG
unregister_file_mapping (data,Size);
#endif // DEBUG

Expand All @@ -544,14 +544,14 @@ CVirtualFileReader::CVirtualFileReader(const char *cFileName)
data = (char*)MapViewOfFile (hSrcMap, FILE_MAP_READ, 0, 0, 0);
R_ASSERT3 (data,cFileName,Debug.error2string(GetLastError()));

#ifdef DEBUG
#ifdef FS_DEBUG
register_file_mapping (data,Size,cFileName);
#endif // DEBUG
}

CVirtualFileReader::~CVirtualFileReader()
{
#ifdef DEBUG
#ifdef FS_DEBUG
unregister_file_mapping (data,Size);
#endif // DEBUG

Expand Down
4 changes: 3 additions & 1 deletion src/engine/xrCore/FS.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

XRCORE_API void VerifyPath (LPCSTR path);

#ifdef DEBUG
//#define FS_DEBUG

#ifdef FS_DEBUG
XRCORE_API extern u32 g_file_mapped_memory;
XRCORE_API extern u32 g_file_mapped_count;
XRCORE_API void dump_file_mappings ();
Expand Down
17 changes: 6 additions & 11 deletions src/engine/xrCore/LocatorAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,16 +601,11 @@ bool CLocatorAPI::Recurse (const char* path)

_findclose ( hFile );

u32 count = rec_files.size();
_finddata_t *buffer = (_finddata_t*)_alloca(count*sizeof(_finddata_t));
std::copy (&*rec_files.begin(), &*rec_files.begin() + count, buffer);

//. std::copy (&*rec_files.begin(),&*rec_files.end(),buffer);

FFVec buffer(rec_files);
rec_files.clear_not_free();
std::sort (buffer, buffer + count, pred_str_ff);
for (_finddata_t *I = buffer, *E = buffer + count; I != E; ++I)
ProcessOne (path,I);
std::sort (buffer.begin(), buffer.end(), pred_str_ff);
for (FFIt I = buffer.begin(), E = buffer.end(); I != E; ++I)
ProcessOne (path, &*I);

// insert self
if (path&&path[0])\
Expand Down Expand Up @@ -1141,7 +1136,7 @@ void CLocatorAPI::file_from_archive (IReader *&R, LPCSTR fname, const file &desc
string512 temp;
xr_sprintf (temp, sizeof(temp),"%s:%s",*A.path,fname);

#ifdef DEBUG
#ifdef FS_DEBUG
register_file_mapping (ptr,sz,temp);
#endif // DEBUG

Expand All @@ -1157,7 +1152,7 @@ void CLocatorAPI::file_from_archive (IReader *&R, LPCSTR fname, const file &desc
R = xr_new<CTempReader>(dest,desc.size_real,0);
UnmapViewOfFile (ptr);

#ifdef DEBUG
#ifdef FS_DEBUG
unregister_file_mapping (ptr,sz);
#endif // DEBUG
}
Expand Down
2 changes: 1 addition & 1 deletion src/engine/xrCore/cpuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ __asm {
#ifdef _CPUID_DEBUG
char mask[255];
_itoa_s( dwAPIC_ID , mask , 2 );
printf("APID_ID #%2.2u = 0x%2.2X (%08.8sb)\n" , n_cpu , dwAPIC_ID , mask );
printf("APID_ID #%2.2u = 0x%2.2X (%08.8sb)\n" , n_avail , dwAPIC_ID , mask );
#endif // _CPUID_DEBUG

// search for the APIC_ID with the same base
Expand Down
12 changes: 12 additions & 0 deletions src/engine/xrEngine/EngineAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,17 @@ extern "C" {

void CEngineAPI::CreateRendererList()
{
#ifdef DEDICATED_SERVER

vid_quality_token = xr_alloc<xr_token>(2);

vid_quality_token[0].id = 0;
vid_quality_token[0].name = xr_strdup("renderer_r1");

vid_quality_token[1].id = -1;
vid_quality_token[1].name = NULL;

#else
// TODO: ask renderers if they are supported!
if(vid_quality_token != NULL) return;
bool bSupports_r2 = false;
Expand Down Expand Up @@ -371,4 +382,5 @@ void CEngineAPI::CreateRendererList()
#endif // DEBUG
}
*/
#endif //#ifndef DEDICATED_SERVER
}
11 changes: 9 additions & 2 deletions src/engine/xrEngine/IGame_Persistent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,14 @@ void IGame_Persistent::OnGameStart()
#ifndef _EDITOR
// LoadTitle("st_prefetching_objects");
LoadTitle();
if (strstr(Core.Params,"-noprefetch")) return;
if(!strstr(Core.Params,"-noprefetch"))
Prefetch();
#endif
}

#ifndef _EDITOR
void IGame_Persistent::Prefetch()
{
// prefetch game objects & models
float p_time = 1000.f*Device.GetTimerGlobal()->GetElapsed_sec();
u32 mem_0 = Memory.mem_usage() ;
Expand All @@ -152,8 +158,9 @@ void IGame_Persistent::OnGameStart()

Msg ("* [prefetch] time: %d ms", iFloor(p_time));
Msg ("* [prefetch] memory: %dKb", p_mem/1024);
#endif
}
#endif


void IGame_Persistent::OnGameEnd ()
{
Expand Down
1 change: 1 addition & 0 deletions src/engine/xrEngine/IGame_Persistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class ENGINE_API IGame_Persistent :
IGame_ObjectPool ObjectPool;
CEnvironment* pEnvironment;
CEnvironment& Environment() {return *pEnvironment;};
void Prefetch ( );
#endif
IMainMenu* m_pMainMenu;

Expand Down
2 changes: 2 additions & 0 deletions src/engine/xrEngine/Stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ void CStats::Show()
//F.OutNext ("DIP/DP: %d", RCache.stat.calls);
#ifdef DEBUG
F.OutSkip ();
#ifdef FS_DEBUG
F.OutNext ("mapped: %d", g_file_mapped_memory);
F.OutSkip ();
#endif
m_pRender->OutData2(F);
//F.OutNext ("SH/T/M/C: %d/%d/%d/%d",RCache.stat.states,RCache.stat.textures,RCache.stat.matrices,RCache.stat.constants);
//F.OutNext ("RT/PS/VS: %d/%d/%d", RCache.stat.target_rt,RCache.stat.ps,RCache.stat.vs);
Expand Down
10 changes: 7 additions & 3 deletions src/engine/xrEngine/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@
#include "..\editors\ECore\stdafx.h"
#else

#include "../xrCore/xrCore.h"
#include "../Include/xrAPI/xrAPI.h"

#ifndef NDEBUG
# ifndef INGAME_EDITOR
# define INGAME_EDITOR
# endif // #ifndef INGAME_EDITOR
#endif // #ifndef NDEBUG

#ifdef INGAME_EDITOR
# define _WIN32_WINNT 0x0550
#endif // #ifdef INGAME_EDITOR

#include "../xrCore/xrCore.h"
#include "../Include/xrAPI/xrAPI.h"

#ifdef _DEBUG
# define D3D_DEBUG_INFO
#endif
Expand Down
4 changes: 3 additions & 1 deletion src/engine/xrEngine/x_ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,7 @@ void CApplication::LoadStage()
max_load_stage = 14;
LoadDraw ();
}

void CApplication::LoadSwitch ()
{
}
Expand All @@ -1258,7 +1259,8 @@ void CApplication::OnFrame ( )
Engine.Event.OnFrame ();
g_SpatialSpace->update ();
g_SpatialSpacePhysic->update ();
if (g_pGameLevel) g_pGameLevel->SoundEvent_Dispatch ( );
if (g_pGameLevel)
g_pGameLevel->SoundEvent_Dispatch ( );
}

void CApplication::Level_Append (LPCSTR folder)
Expand Down
Loading

0 comments on commit ce3c373

Please sign in to comment.