mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 13:23:59 +02:00
- Fixed some bugs related to logfile processing.
- Added debug project to win32 projects - Changed some compiler settings for win32 projects to enable sse
This commit is contained in:
@@ -29,6 +29,7 @@ Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug+MT|Win32 = Debug+MT|Win32
|
||||
Debug-MT|Win32 = Debug-MT|Win32
|
||||
No debug|Win32 = No debug|Win32
|
||||
Release with error catching|Win32 = Release with error catching|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
@@ -40,6 +41,8 @@ Global
|
||||
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Debug+MT|Win32.ActiveCfg = Debug|Win32
|
||||
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Debug+MT|Win32.Build.0 = Debug|Win32
|
||||
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Debug-MT|Win32.ActiveCfg = Debug|Win32
|
||||
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Debug-MT|Win32.Build.0 = Debug|Win32
|
||||
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.No debug|Win32.ActiveCfg = Release|Win32
|
||||
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.No debug|Win32.Build.0 = Release|Win32
|
||||
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release with error catching|Win32.ActiveCfg = Release|Win32
|
||||
@@ -54,6 +57,8 @@ Global
|
||||
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Debug+MT|Win32.ActiveCfg = Debug|Win32
|
||||
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Debug+MT|Win32.Build.0 = Debug|Win32
|
||||
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Debug-MT|Win32.ActiveCfg = Debug|Win32
|
||||
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Debug-MT|Win32.Build.0 = Debug|Win32
|
||||
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.No debug|Win32.ActiveCfg = Release|Win32
|
||||
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.No debug|Win32.Build.0 = Release|Win32
|
||||
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release with error catching|Win32.ActiveCfg = Release|Win32
|
||||
@@ -68,6 +73,8 @@ Global
|
||||
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Debug+MT|Win32.ActiveCfg = Debug|Win32
|
||||
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Debug+MT|Win32.Build.0 = Debug|Win32
|
||||
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Debug-MT|Win32.ActiveCfg = Debug|Win32
|
||||
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Debug-MT|Win32.Build.0 = Debug|Win32
|
||||
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.No debug|Win32.ActiveCfg = Release|Win32
|
||||
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.No debug|Win32.Build.0 = Release|Win32
|
||||
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release with error catching|Win32.ActiveCfg = Release|Win32
|
||||
@@ -82,6 +89,8 @@ Global
|
||||
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Debug+MT|Win32.ActiveCfg = Debug|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Debug+MT|Win32.Build.0 = Debug|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Debug-MT|Win32.ActiveCfg = Debug|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Debug-MT|Win32.Build.0 = Debug|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.No debug|Win32.ActiveCfg = Release|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.No debug|Win32.Build.0 = Release|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release with error catching|Win32.ActiveCfg = Release|Win32
|
||||
@@ -96,6 +105,8 @@ Global
|
||||
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.Debug+MT|Win32.ActiveCfg = Debug|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.Debug+MT|Win32.Build.0 = Debug|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.Debug-MT|Win32.ActiveCfg = Debug|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.Debug-MT|Win32.Build.0 = Debug|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.No debug|Win32.ActiveCfg = Release|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.No debug|Win32.Build.0 = Release|Win32
|
||||
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.Release with error catching|Win32.ActiveCfg = Release|Win32
|
||||
@@ -110,6 +121,8 @@ Global
|
||||
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Debug+MT|Win32.ActiveCfg = Debug|Win32
|
||||
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Debug+MT|Win32.Build.0 = Debug|Win32
|
||||
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Debug-MT|Win32.ActiveCfg = Debug-MT|Win32
|
||||
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Debug-MT|Win32.Build.0 = Debug-MT|Win32
|
||||
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.No debug|Win32.ActiveCfg = Release|Win32
|
||||
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.No debug|Win32.Build.0 = Release|Win32
|
||||
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release with error catching|Win32.ActiveCfg = Release|Win32
|
||||
|
Binary file not shown.
@@ -116,6 +116,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/arch:SSE2"
|
||||
AdditionalIncludeDirectories=""..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\mswd";"..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc";..\..\source\shared_lib\include\util;..\..\source\shared_lib\include\platform\win32;..\..\source\shared_lib\include\graphics\gl;..\..\source\win32_deps\include;..\..\source\shared_lib\include\graphics;"..\..\source\win32_deps\wxWidgets-2.8.10\include";..\..\source\shared_lib\include\platform\sdl;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;"
|
||||
StringPooling="true"
|
||||
|
@@ -116,6 +116,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/arch:SSE2"
|
||||
AdditionalIncludeDirectories=""..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\mswd";"..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc";..\..\source\shared_lib\include\util;..\..\source\shared_lib\include\platform\win32;..\..\source\shared_lib\include\graphics\gl;..\..\source\win32_deps\include;..\..\source\shared_lib\include\graphics;"..\..\source\win32_deps\wxWidgets-2.8.10\include";..\..\source\shared_lib\include\xml;"../../source/win32_deps/xerces-c-3.0.1/src";..\..\source\shared_lib\include\platform\sdl;../../source/shared_lib/include/platform/common"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;"
|
||||
StringPooling="true"
|
||||
|
@@ -116,6 +116,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/arch:SSE2"
|
||||
AdditionalIncludeDirectories=""..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\msw";"..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc";..\..\source\shared_lib\include\util;..\..\source\shared_lib\include\platform\win32;..\..\source\shared_lib\include\graphics\gl;..\..\source\win32_deps\include;..\..\source\shared_lib\include\graphics;"..\..\source\win32_deps\wxWidgets-2.8.10\include";..\..\source\shared_lib\include\platform\sdl;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common"
|
||||
PreprocessorDefinitions="MWIN;__WXMSW__"
|
||||
StringPooling="true"
|
||||
|
@@ -44,14 +44,14 @@
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
WholeProgramOptimization="false"
|
||||
AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/tinyxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src""
|
||||
AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/tinyxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/SDL-1.2.14/include";../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/sound/openal;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common;$(NOINHERIT)"
|
||||
AdditionalUsingDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;XML_LIBRARY;NO_GL_ASSERTIONS;USE_PCH=1"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;XML_LIBRARY;NO_GL_ASSERTIONS;USE_PCH=1;USE_STREFLOP;STREFLOP_X87;LIBM_COMPILING_FLT32"
|
||||
StringPooling="true"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
EnableEnhancedInstructionSet="2"
|
||||
FloatingPointModel="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -73,8 +73,8 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="dsound.lib dxguid.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib opengl32.lib glu32.lib wsock32.lib libglest.lib mmc.lib zlib.lib lua5.1.lib xerces-c_3D.lib Dbghelp.lib libpng.lib jpeg.lib"
|
||||
AdditionalLibraryDirectories="../../source/win32_deps/lib;"../../build/$(ConfigurationName)/libglest""
|
||||
AdditionalDependencies="dsound.lib dxguid.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib opengl32.lib glu32.lib wsock32.lib libglest.lib mmc.lib lua5.1.lib xerces-c_3.lib Dbghelp.lib libpng.lib jpeg.lib zlib.lib sdl.lib sdlmain.lib winmm.lib openal32.lib iphlpapi.lib libstreflop.lib"
|
||||
AdditionalLibraryDirectories="../../source/win32_deps/lib;"../../build/$(ConfigurationName)/libglest";../../source/shared_lib/sources/streflop/libstreflop"
|
||||
IgnoreAllDefaultLibraries="false"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
GenerateDebugInformation="true"
|
||||
@@ -128,6 +128,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/arch:SSE2"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
@@ -169,7 +170,7 @@
|
||||
LinkTimeCodeGeneration="0"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
TargetMachine="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
|
@@ -42,7 +42,7 @@
|
||||
Optimization="0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
@@ -107,6 +107,79 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/arch:SSE2"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
WholeProgramOptimization="false"
|
||||
AdditionalIncludeDirectories=""..\..\source\shared_lib\include\streflop\libm\flt-32";..\..\source\shared_lib\include\streflop\libm\headers"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_X87;LIBM_COMPILING_FLT32"
|
||||
StringPooling="true"
|
||||
ExceptionHandling="2"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
EnableEnhancedInstructionSet="0"
|
||||
FloatingPointModel="0"
|
||||
RuntimeTypeInfo="true"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug-MT|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/arch:SSE2"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
|
@@ -40,13 +40,13 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude";../../source/win32_deps/lpng141;"../../source/win32_deps/jpeg-8a""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;NO_GL_ASSERTIONS;USE_PCH=1"
|
||||
AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude";../../source/win32_deps/libpng141;"../../source/win32_deps/jpeg-8a";"../../source/win32_deps/SDL-1.2.14/include";../../source/shared_lib/include/platform/sdl;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/streflop/libm_flt32_source;../../source/shared_lib/include/platform/common"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;NO_GL_ASSERTIONS;USE_PCH=1;USE_STREFLOP;STREFLOP_X87;LIBM_COMPILING_FLT32"
|
||||
StringPooling="true"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
EnableFunctionLevelLinking="true"
|
||||
FloatingPointModel="2"
|
||||
RuntimeTypeInfo="false"
|
||||
@@ -109,6 +109,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/arch:SSE2"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
@@ -731,6 +732,10 @@
|
||||
RelativePath="..\..\source\shared_lib\include\platform\sdl\gl_wrap.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\shared_lib\include\platform\common\math_wrapper.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\source\shared_lib\include\platform\sdl\noimpl.h"
|
||||
>
|
||||
|
@@ -15,10 +15,10 @@
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
//#include "thread.h"
|
||||
#include "thread.h"
|
||||
|
||||
using std::string;
|
||||
//using namespace Shared::Platform;
|
||||
using namespace Shared::Platform;
|
||||
|
||||
namespace Shared{ namespace Util{
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
this->fileStream = NULL;
|
||||
this->debugLogFileName = "";
|
||||
this->fileStreamOwner = false;
|
||||
//this->mutex = NULL;
|
||||
this->mutex = NULL;
|
||||
}
|
||||
SystemFlagsType(DebugType debugType) {
|
||||
this->debugType = debugType;
|
||||
@@ -53,7 +53,10 @@ public:
|
||||
this->fileStream = NULL;
|
||||
this->debugLogFileName = "";
|
||||
this->fileStreamOwner = false;
|
||||
//this->mutex = NULL;
|
||||
this->mutex = NULL;
|
||||
}
|
||||
~SystemFlagsType() {
|
||||
Close();
|
||||
}
|
||||
SystemFlagsType(DebugType debugType,bool enabled,
|
||||
std::ofstream *fileStream,std::string debugLogFileName) {
|
||||
@@ -62,14 +65,28 @@ public:
|
||||
this->fileStream = fileStream;
|
||||
this->debugLogFileName = debugLogFileName;
|
||||
this->fileStreamOwner = false;
|
||||
//this->mutex = mutex;
|
||||
this->mutex = NULL;
|
||||
}
|
||||
|
||||
void Close() {
|
||||
if(this->fileStreamOwner == true) {
|
||||
if( this->fileStream != NULL &&
|
||||
this->fileStream->is_open() == true) {
|
||||
this->fileStream->close();
|
||||
}
|
||||
delete this->fileStream;
|
||||
delete this->mutex;
|
||||
}
|
||||
this->fileStream = NULL;
|
||||
this->fileStreamOwner = false;
|
||||
this->mutex = NULL;
|
||||
}
|
||||
|
||||
bool enabled;
|
||||
std::ofstream *fileStream;
|
||||
std::string debugLogFileName;
|
||||
bool fileStreamOwner;
|
||||
//Mutex *mutex;
|
||||
Mutex *mutex;
|
||||
};
|
||||
|
||||
protected:
|
||||
|
@@ -40,11 +40,13 @@ namespace Shared{ namespace Util{
|
||||
std::map<SystemFlags::DebugType,SystemFlags::SystemFlagsType> SystemFlags::debugLogFileList;
|
||||
|
||||
void SystemFlags::init() {
|
||||
if(SystemFlags::debugLogFileList.size() == 0) {
|
||||
SystemFlags::debugLogFileList[SystemFlags::debugSystem] = SystemFlags::SystemFlagsType(SystemFlags::debugSystem);
|
||||
SystemFlags::debugLogFileList[SystemFlags::debugNetwork] = SystemFlags::SystemFlagsType(SystemFlags::debugNetwork);
|
||||
SystemFlags::debugLogFileList[SystemFlags::debugPerformance] = SystemFlags::SystemFlagsType(SystemFlags::debugPerformance);
|
||||
SystemFlags::debugLogFileList[SystemFlags::debugWorldSynch] = SystemFlags::SystemFlagsType(SystemFlags::debugWorldSynch);
|
||||
}
|
||||
}
|
||||
|
||||
int SystemFlags::lockFile = -1;
|
||||
string SystemFlags::lockfilename = "";
|
||||
@@ -74,23 +76,13 @@ SystemFlags::~SystemFlags() {
|
||||
void SystemFlags::Close() {
|
||||
printf("START Closing logfiles\n");
|
||||
|
||||
if(SystemFlags::debugLogFileList.size() > 0) {
|
||||
for(std::map<SystemFlags::DebugType,SystemFlags::SystemFlagsType>::iterator iterMap = SystemFlags::debugLogFileList.begin();
|
||||
iterMap != SystemFlags::debugLogFileList.end(); iterMap++) {
|
||||
SystemFlags::SystemFlagsType ¤tDebugLog = iterMap->second;
|
||||
|
||||
if(currentDebugLog.fileStreamOwner == true) {
|
||||
if( currentDebugLog.fileStream != NULL &&
|
||||
currentDebugLog.fileStream->is_open() == true) {
|
||||
currentDebugLog.fileStream->close();
|
||||
currentDebugLog.Close();
|
||||
}
|
||||
delete currentDebugLog.fileStream;
|
||||
//delete currentDebugLog.mutex;
|
||||
}
|
||||
currentDebugLog.fileStream = NULL;
|
||||
currentDebugLog.fileStreamOwner = false;
|
||||
//currentDebugLog.mutex = NULL;
|
||||
}
|
||||
|
||||
if(SystemFlags::lockFile != -1) {
|
||||
#ifndef WIN32
|
||||
close(SystemFlags::lockFile);
|
||||
@@ -109,6 +101,9 @@ void SystemFlags::Close() {
|
||||
}
|
||||
|
||||
void SystemFlags::OutputDebug(DebugType type, const char *fmt, ...) {
|
||||
if(SystemFlags::debugLogFileList.size() == 0) {
|
||||
SystemFlags::init();
|
||||
}
|
||||
SystemFlags::SystemFlagsType ¤tDebugLog = SystemFlags::debugLogFileList[type];
|
||||
if(currentDebugLog.enabled == false) {
|
||||
return;
|
||||
@@ -143,7 +138,7 @@ void SystemFlags::OutputDebug(DebugType type, const char *fmt, ...) {
|
||||
currentDebugLog2.fileStream != NULL) {
|
||||
currentDebugLog.fileStream = currentDebugLog2.fileStream;
|
||||
currentDebugLog.fileStreamOwner = false;
|
||||
//currentDebugLog.mutex = currentDebugLog2.mutex;
|
||||
currentDebugLog.mutex = currentDebugLog2.mutex;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -189,17 +184,17 @@ void SystemFlags::OutputDebug(DebugType type, const char *fmt, ...) {
|
||||
currentDebugLog.fileStream = new std::ofstream();
|
||||
currentDebugLog.fileStream->open(debugLog.c_str(), ios_base::out | ios_base::trunc);
|
||||
currentDebugLog.fileStreamOwner = true;
|
||||
//currentDebugLog.mutex = new Mutex();
|
||||
currentDebugLog.mutex = new Mutex();
|
||||
}
|
||||
|
||||
printf("Opening logfile [%s] type = %d, currentDebugLog.fileStreamOwner = %d\n",debugLog.c_str(),type, currentDebugLog.fileStreamOwner);
|
||||
|
||||
//currentDebugLog.mutex->p();
|
||||
currentDebugLog.mutex->p();
|
||||
|
||||
(*currentDebugLog.fileStream) << "Starting Mega-Glest logging for type: " << type << "\n";
|
||||
(*currentDebugLog.fileStream).flush();
|
||||
|
||||
//currentDebugLog.mutex->v();
|
||||
currentDebugLog.mutex->v();
|
||||
}
|
||||
|
||||
//printf("Logfile is open [%s]\n",SystemFlags::debugLogFile);
|
||||
@@ -208,12 +203,12 @@ void SystemFlags::OutputDebug(DebugType type, const char *fmt, ...) {
|
||||
|
||||
assert(currentDebugLog.fileStream != NULL);
|
||||
|
||||
//currentDebugLog.mutex->p();
|
||||
currentDebugLog.mutex->p();
|
||||
|
||||
(*currentDebugLog.fileStream) << "[" << szBuf2 << "] " << szBuf;
|
||||
(*currentDebugLog.fileStream).flush();
|
||||
|
||||
//currentDebugLog.mutex->v();
|
||||
currentDebugLog.mutex->v();
|
||||
}
|
||||
// output to console
|
||||
else {
|
||||
|
Reference in New Issue
Block a user