Ported streflop code to win32

This commit is contained in:
Mark Vejvoda 2010-04-24 11:15:15 +00:00
parent 2bfaa4d1d7
commit f748874601
26 changed files with 867 additions and 51 deletions

View File

@ -1,6 +1,6 @@
@echo off
if not exist ..\..\data\glest_game\dsound.dll copy dsound.dll ..\..\data\glest_game\
rem if not exist ..\..\data\glest_game\dsound.dll copy dsound.dll ..\..\data\glest_game\
if not exist ..\..\data\glest_game\xerces-c_3_0.dll copy xerces-c_3_0.dll ..\..\data\glest_game\
if not exist ..\..\data\glest_game\libpng14.dll copy libpng14.dll ..\..\data\glest_game\
if not exist ..\..\data\glest_game\zlib1.dll copy zlib1.dll ..\..\data\glest_game\

View File

@ -20,6 +20,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g3d_viewer", "g3d_viewer.vc
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glest_configurator", "glest_configurator.vcproj", "{FE5C7C7C-F109-44F5-8329-19A4E24F162D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libstreflop", "libstreflop.vcproj", "{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -46,6 +48,10 @@ Global
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.Debug|Win32.Build.0 = Debug|Win32
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.Release|Win32.ActiveCfg = Release|Win32
{FE5C7C7C-F109-44F5-8329-19A4E24F162D}.Release|Win32.Build.0 = Release|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Debug|Win32.ActiveCfg = Debug|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Debug|Win32.Build.0 = Debug|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release|Win32.ActiveCfg = Release|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Binary file not shown.

View File

@ -4,6 +4,7 @@
Version="9.00"
Name="g3d_viewer"
ProjectGUID="{FE5C7C7C-F109-44F5-8329-25A4E24F162C}"
RootNamespace="g3d_viewer"
Keyword="Win32Proj"
TargetFrameworkVersion="0"
>
@ -115,7 +116,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\mswd&quot;;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc&quot;;..\..\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;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include&quot;;..\..\source\shared_lib\include\platform\sdl"
AdditionalIncludeDirectories="&quot;..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\mswd&quot;;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc&quot;;..\..\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;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include&quot;;..\..\source\shared_lib\include\platform\sdl;../../source/shared_lib/include/streflop"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
@ -136,10 +137,10 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wxbase28.lib wxbase28_net.lib wxbase28_xml.lib wxexpat.lib wxjpeg.lib wxmsw28_adv.lib wxmsw28_aui.lib wxmsw28_core.lib wxmsw28_gl.lib wxmsw28_html.lib wxmsw28_media.lib wxmsw28_qa.lib wxmsw28_richtext.lib wxmsw28_xrc.lib wxpng.lib wxregex.lib wxtiff.lib wxzlib.lib winmm.lib rpcrt4.lib kernel32.lib user32.lib gdi32.lib ole32.lib oleaut32.lib comctl32.lib comdlg32.lib uuid.lib advapi32.lib shell32.lib libglest.lib Dbghelp.lib sdl.lib sdlmain.lib dxguid.lib"
AdditionalDependencies="wxbase28.lib wxbase28_net.lib wxbase28_xml.lib wxexpat.lib wxjpeg.lib wxmsw28_adv.lib wxmsw28_aui.lib wxmsw28_core.lib wxmsw28_gl.lib wxmsw28_html.lib wxmsw28_media.lib wxmsw28_qa.lib wxmsw28_richtext.lib wxmsw28_xrc.lib wxpng.lib wxregex.lib wxtiff.lib wxzlib.lib winmm.lib rpcrt4.lib kernel32.lib user32.lib gdi32.lib ole32.lib oleaut32.lib comctl32.lib comdlg32.lib uuid.lib advapi32.lib shell32.lib libglest.lib Dbghelp.lib sdl.lib sdlmain.lib dxguid.lib libstreflop.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="2"
AdditionalLibraryDirectories="../../source/win32_deps/lib;&quot;../../build/$(ConfigurationName)/libglest&quot;"
AdditionalLibraryDirectories="../../source/win32_deps/lib;&quot;../../build/$(ConfigurationName)/libglest&quot;;../../source/shared_lib/sources/streflop/libstreflop"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"

View File

@ -116,7 +116,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\msw&quot;;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc&quot;;..\..\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;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include&quot;;..\..\source\shared_lib\include\platform\sdl"
AdditionalIncludeDirectories="&quot;..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\msw&quot;;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc&quot;;..\..\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;&quot;..\..\source\win32_deps\wxWidgets-2.8.10\include&quot;;..\..\source\shared_lib\include\platform\sdl;../../source/shared_lib/include/streflop"
PreprocessorDefinitions="MWIN;__WXMSW__"
RuntimeLibrary="0"
UsePrecompiledHeader="0"

View File

@ -133,13 +133,13 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
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;&quot;../../source/win32_deps/xerces-c-3.0.1/src&quot;;&quot;../../source/win32_deps/SDL-1.2.14/include&quot;;../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/sound/openal;&quot;../../source/win32_deps/openal-soft-1.12.854/include&quot;;../../source/shared_lib/include/platform/posix"
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;&quot;../../source/win32_deps/xerces-c-3.0.1/src&quot;;&quot;../../source/win32_deps/SDL-1.2.14/include&quot;;../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/sound/openal;&quot;../../source/win32_deps/openal-soft-1.12.854/include&quot;;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop"
AdditionalUsingDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="2"
EnableEnhancedInstructionSet="1"
FloatingPointModel="2"
WarningLevel="2"
DebugInformationFormat="3"
@ -155,8 +155,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 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"
AdditionalLibraryDirectories="../../source/win32_deps/lib;&quot;../../build/$(ConfigurationName)/libglest&quot;"
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;&quot;../../build/$(ConfigurationName)/libglest&quot;;../../source/shared_lib/sources/streflop/libstreflop"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="false"
SubSystem="1"
@ -227,6 +227,10 @@
RelativePath="..\..\source\glest_game\facilities\logger.h"
>
</File>
<File
RelativePath="..\..\source\glest_game\menu\menu_state_connected_game.cpp"
>
</File>
</Filter>
<Filter
Name="ai"
@ -257,6 +261,10 @@
RelativePath="..\..\source\glest_game\ai\ai_rule.h"
>
</File>
<File
RelativePath="..\..\source\glest_game\menu\menu_state_connected_game.h"
>
</File>
<File
RelativePath="..\..\source\glest_game\ai\path_finder.cpp"
>

View File

@ -0,0 +1,473 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="libstreflop"
ProjectGUID="{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}"
RootNamespace="libstreflop"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\"
IntermediateDirectory="$(ConfigurationName)/$(ProjectName)"
ConfigurationType="4"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="&quot;..\..\source\shared_lib\include\streflop\libm\flt-32&quot;;..\..\source\shared_lib\include\streflop\libm\headers"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="1"
FloatingPointModel="2"
RuntimeTypeInfo="false"
WarningLevel="3"
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>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\libm\flt-32\e_acosf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_acoshf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_asinf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_atan2f.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_atanhf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_coshf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_exp2f.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_expf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_fmodf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_gammaf_r.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_hypotf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_j0f.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_j1f.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_jnf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_lgammaf_r.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_log10f.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_log2f.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_logf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_powf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_rem_pio2f.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_remainderf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_sinhf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\e_sqrtf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\k_cosf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\k_rem_pio2f.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\k_sinf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\k_tanf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_asinhf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_atanf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_cbrtf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_ceilf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_copysignf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_cosf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_erff.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_expm1f.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_fabsf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_finitef.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_floorf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_fpclassifyf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_frexpf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_ilogbf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_isinff.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_isnanf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_ldexpf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_llrintf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_llroundf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_log1pf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_logbf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_lrintf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_lroundf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_modff.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_nearbyintf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_nextafterf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_remquof.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_rintf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_roundf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_scalblnf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_scalbnf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_signbitf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_sincosf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_sinf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_tanf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_tanhf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\s_truncf.cpp"
>
</File>
<File
RelativePath="..\libm\flt-32\w_expf.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\..\include\streflop\libm\headers\endian.h"
>
</File>
<File
RelativePath="..\..\..\include\streflop\libm\headers\features.h"
>
</File>
<File
RelativePath="..\..\..\include\streflop\libm\headers\ieee754.h"
>
</File>
<File
RelativePath="..\..\..\include\streflop\libm\headers\math.h"
>
</File>
<File
RelativePath="..\..\..\include\streflop\libm\headers\math_private.h"
>
</File>
<File
RelativePath="..\..\..\include\streflop\libm\headers\SMath.h"
>
</File>
<File
RelativePath="..\..\..\include\streflop\libm\flt-32\t_exp2f.h"
>
</File>
<File
RelativePath="..\..\..\include\streflop\libm\headers\wchar.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<File
RelativePath="..\libm\flt-32\Makefile"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -113,11 +113,11 @@
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="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;&quot;../../source/win32_deps/xerces-c-3.0.1/src&quot;;&quot;../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude&quot;;../../source/win32_deps/libpng141;&quot;../../source/win32_deps/jpeg-8a&quot;;&quot;../../source/win32_deps/SDL-1.2.14/include&quot;;../../source/shared_lib/include/platform/sdl;&quot;../../source/win32_deps/openal-soft-1.12.854/include&quot;;../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;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;&quot;../../source/win32_deps/xerces-c-3.0.1/src&quot;;&quot;../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude&quot;;../../source/win32_deps/libpng141;&quot;../../source/win32_deps/jpeg-8a&quot;;&quot;../../source/win32_deps/SDL-1.2.14/include&quot;;../../source/shared_lib/include/platform/sdl;&quot;../../source/win32_deps/openal-soft-1.12.854/include&quot;;../../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"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="2"
EnableEnhancedInstructionSet="1"
FloatingPointModel="2"
RuntimeTypeInfo="false"
WarningLevel="3"
@ -134,6 +134,8 @@
/>
<Tool
Name="VCLibrarianTool"
AdditionalDependencies="libstreflop.lib"
AdditionalLibraryDirectories=".\"
/>
<Tool
Name="VCALinkTool"
@ -164,6 +166,18 @@
RelativePath="..\..\source\win32_deps\src\glprocs.c"
>
</File>
<File
RelativePath="..\..\source\shared_lib\sources\streflop\Random.cpp"
>
</File>
<File
RelativePath="..\..\source\shared_lib\sources\streflop\SMath.cpp"
>
</File>
<File
RelativePath="..\..\source\shared_lib\sources\streflop\streflopC.cpp"
>
</File>
<Filter
Name="graphics"
>
@ -332,7 +346,7 @@
>
</File>
<File
RelativePath="..\..\source\shared_lib\sources\util\random.cpp"
RelativePath="..\..\source\shared_lib\sources\util\randomgen.cpp"
>
</File>
<File
@ -414,6 +428,42 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\..\source\shared_lib\include\streflop\FPUSettings.h"
>
</File>
<File
RelativePath="..\..\source\shared_lib\include\streflop\IntegerTypes.h"
>
</File>
<File
RelativePath="..\..\source\shared_lib\include\streflop\Random.h"
>
</File>
<File
RelativePath="..\..\source\shared_lib\include\streflop\SMath.h"
>
</File>
<File
RelativePath="..\..\source\shared_lib\include\streflop\streflop.h"
>
</File>
<File
RelativePath="..\..\source\shared_lib\include\streflop\streflop_cond.h"
>
</File>
<File
RelativePath="..\..\source\shared_lib\include\streflop\streflopC.h"
>
</File>
<File
RelativePath="..\..\source\shared_lib\include\streflop\System.h"
>
</File>
<File
RelativePath="..\..\source\shared_lib\include\streflop\X87DenormalSquasher.h"
>
</File>
<Filter
Name="graphics"
>
@ -726,7 +776,7 @@
>
</File>
<File
RelativePath="..\..\source\shared_lib\include\util\random.h"
RelativePath="..\..\source\shared_lib\include\util\randomgen.h"
>
</File>
<File

View File

@ -18,12 +18,12 @@
#include "world.h"
#include "commander.h"
#include "command.h"
#include "random.h"
#include "randomgen.h"
using std::deque;
using std::vector;
using std::list;
using Shared::Util::Random;
using Shared::Util::RandomGen;
namespace Glest{ namespace Game{
@ -142,7 +142,7 @@ private:
int upgradeCount;
Tasks tasks;
Positions expansionPositions;
Random random;
RandomGen random;
public:
int minWarriors;
@ -152,7 +152,7 @@ public:
//state requests
AiInterface *getAiInterface() const {return aiInterface;}
Random* getRandom() {return &random;}
RandomGen* getRandom() {return &random;}
int getCountOfType(const UnitType *ut);
int getCountOfClass(UnitClass uc);

View File

@ -16,9 +16,10 @@
#include "menu_state_new_game.h"
#include "menu_state_scenario.h"
#include "game.h"
#include "config.h"
#include "leak_dumper.h"
#include "config.h"
namespace Glest{ namespace Game{

View File

@ -0,0 +1,57 @@
// ==============================================================
// This file is part of Glest (www.glest.org)
//
// Copyright (C) 2001-2009 Martiño Figueroa
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
// by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version
// ==============================================================
#ifndef _SHARED_UTIL_AUTO_TEST_H_
#define _SHARED_UTIL_AUTO_TEST_H_
#include <ctime>
#include "randomgen.h"
using Shared::Util::RandomGen;
namespace Glest{ namespace Game{
class Program;
class MainMenu;
class MenuStateScenario;
class Game;
// =====================================================
// class AutoTest
//
/// Interface to write log files
// =====================================================
class AutoTest{
private:
int gameStartTime;
RandomGen random;
private:
static const time_t invalidTime;
static const time_t gameTime;
public:
static AutoTest & getInstance();
AutoTest();
void updateIntro(Program *program);
void updateRoot(Program *program, MainMenu *mainMenu);
void updateNewGame(Program *program, MainMenu *mainMenu);
void updateScenario(MenuStateScenario *menuStateScenario);
void updateGame(Game *game);
void updateBattleEnd(Program *program);
};
}}//end namespace
#endif

View File

@ -24,7 +24,7 @@
#include "opengl.h"
#include "faction.h"
#include "factory_repository.h"
#include <cmath>
//#include <cmath>
#include "leak_dumper.h"

View File

@ -18,10 +18,10 @@
#include "commander.h"
#include "console.h"
#include "selection.h"
#include "random.h"
#include "randomgen.h"
#include <map>
//using Shared::Util::Random;
using Shared::Util::RandomGen;
namespace Glest{ namespace Game{
@ -102,7 +102,7 @@ public:
private:
//External objects
Shared::Util::Random random;
RandomGen random;
const Commander *commander;
const World *world;
GameCamera *gameCamera;

View File

@ -17,7 +17,7 @@
#include "vec.h"
#include "texture.h"
#include "model.h"
#include "random.h"
#include "randomgen.h"
using Shared::Graphics::RainParticleSystem;
using Shared::Graphics::FireParticleSystem;
@ -26,7 +26,7 @@ using Shared::Graphics::Vec3f;
using Shared::Graphics::Vec2f;
using Shared::Graphics::Texture2D;
using Shared::Graphics::Model;
//using Shared::Util::Random;
using Shared::Util::RandomGen;
namespace Glest{ namespace Game{
@ -67,7 +67,7 @@ private:
float t;
//misc
Shared::Util::Random random;
RandomGen random;
Model *characterModels[characterCount];
float anim;
float fade;

View File

@ -15,10 +15,10 @@
#include <vector>
#include "sound.h"
#include "random.h"
#include "randomgen.h"
using std::vector;
//using Shared::Util::Random;
using Shared::Util::RandomGen;
using Shared::Sound::StaticSound;
namespace Glest{ namespace Game{
@ -35,7 +35,7 @@ public:
private:
Sounds sounds;
mutable Shared::Util::Random random;
mutable RandomGen random;
mutable int lastSound;
public:

View File

@ -18,7 +18,7 @@
#include "object_type.h"
#include "resource.h"
#include "util.h"
#include "random.h"
#include "randomgen.h"
#include "leak_dumper.h"
using namespace Shared::Util;
@ -31,7 +31,7 @@ namespace Glest{ namespace Game{
// =====================================================
Object::Object(ObjectType *objectType, const Vec3f &pos){
Shared::Util::Random random;
RandomGen random;
random.init(static_cast<int>(pos.x*pos.z));

View File

@ -23,11 +23,11 @@
#include "skill_type.h"
#include "core_data.h"
#include "renderer.h"
#include "leak_dumper.h"
#include <cmath>
//#include <cmath>
#include "socket.h"
#include "leak_dumper.h"
using namespace Shared::Graphics;
using namespace Shared::Util;
@ -115,7 +115,7 @@ Unit::Unit(int id, const Vec2i &pos, const UnitType *type, Faction *faction, Map
allowRotateUnits = Config::getInstance().getBool("AllowRotateUnits","0");
modelFacing = CardinalDir::NORTH;
Random random;
RandomGen random;
this->pos=pos;
this->type=type;

View File

@ -18,7 +18,7 @@
#include "xml_parser.h"
#include "object_type.h"
#include "sound.h"
#include "random.h"
#include "randomgen.h"
#include "surface_atlas.h"
#include "checksum.h"
@ -31,7 +31,7 @@ using Shared::Graphics::Model;
using Shared::Graphics::Vec3f;
using Shared::Graphics::Texture2D;
using Shared::Graphics::Texture3D;
using Shared::Util::Random;
using Shared::Util::RandomGen;
using Shared::Util::Checksum;
using std::map;
@ -115,7 +115,7 @@ private:
SurfProbs surfProbs[surfCount];
SurfPixmaps surfPixmaps[surfCount];
Random random;
RandomGen random;
Texture3D *waterTex;
bool waterEffects;
bool fog;

View File

@ -15,10 +15,10 @@
#include "gui.h"
#include "path_finder.h"
#include "particle.h"
#include "random.h"
#include "randomgen.h"
using Shared::Graphics::ParticleObserver;
//using Shared::Util::Random;
using Shared::Util::RandomGen;
namespace Glest{ namespace Game{
@ -55,7 +55,7 @@ private:
ScriptManager *scriptManager;
PathFinder pathFinder;
Game *game;
Shared::Util::Random random;
RandomGen random;
bool allowRotateUnits;
public:

View File

@ -28,14 +28,14 @@
#include "water_effects.h"
#include "faction.h"
#include "unit_updater.h"
#include "random.h"
#include "randomgen.h"
#include "game_constants.h"
namespace Glest{ namespace Game{
using Shared::Graphics::Quad2i;
using Shared::Graphics::Rect2i;
using Shared::Util::Random;
using Shared::Util::RandomGen;
class Faction;
class Unit;
@ -74,7 +74,7 @@ private:
Factions factions;
Random random;
RandomGen random;
ScriptManager* scriptManager;

View File

@ -0,0 +1,134 @@
// ==============================================================
// This file is part of Glest (www.glest.org)
//
// Copyright (C) 2001-2008 Martiño Figueroa
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
// by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version
// ==============================================================
#ifndef _MAPEDITOR_MAP_H_
#define _MAPEDITOR_MAP_H_
#include "util.h"
#include "types.h"
#include "randomgen.h"
using Shared::Platform::int8;
using Shared::Platform::int32;
using Shared::Platform::float32;
using Shared::Util::RandomGen;
namespace MapEditor {
struct MapFileHeader {
int32 version;
int32 maxFactions;
int32 width;
int32 height;
int32 altFactor;
int32 waterLevel;
int8 title[128];
int8 author[128];
int8 description[256];
};
// ===============================================
// class Map
// ===============================================
class Map {
public:
static const int maxHeight = 20;
static const int minHeight = 0;
private:
struct Cell {
int surface;
int object;
int resource;
float height;
};
struct StartLocation {
int x;
int y;
};
RandomGen random;
string title;
string author;
string desc;
string recScn;
int type;
int h;
int w;
int altFactor;
int waterLevel;
Cell **cells;
int maxFactions;
StartLocation *startLocations;
int refAlt;
public:
Map();
~Map();
float getHeight(int x, int y) const;
int getSurface(int x, int y) const;
int getObject(int x, int y) const;
int getResource(int x, int y) const;
int getStartLocationX(int index) const;
int getStartLocationY(int index) const;
int getHeightFactor() const;
int getWaterLevel() const;
bool inside(int x, int y);
void setRefAlt(int x, int y);
void setAdvanced(int altFactor, int waterLevel);
void setTitle(const string &title);
void setDesc(const string &desc);
void setAuthor(const string &author);
int getH() const {return h;}
int getW() const {return w;}
int getMaxFactions() const {return maxFactions;}
string getTitle() const {return title;}
string getDesc() const {return desc;}
string getAuthor() const {return author;}
void glestChangeHeight(int x, int y, int height, int radius);
void pirateChangeHeight(int x, int y, int height, int radius);
void changeSurface(int x, int y, int surface, int radius);
void changeObject(int x, int y, int object, int radius);
void changeResource(int x, int y, int resource, int radius);
void changeStartLocation(int x, int y, int player);
void setHeight(int x, int y, float height);
void setSurface(int x, int y, int surface);
void setObject(int x, int y, int object);
void setResource(int x, int y, int resource);
void flipX();
void flipY();
void reset(int w, int h, float alt, int surf);
void resize(int w, int h, float alt, int surf);
void resetFactions(int maxFactions);
void randomizeHeights();
void randomize();
void switchSurfaces(int surf1, int surf2);
void loadFromFile(const string &path);
void saveToFile(const string &path);
public:
void resetHeights(int height);
void sinRandomize(int strenght);
void decalRandomize(int strenght);
void applyNewHeight(float newHeight, int x, int y, int strenght);
};
}// end namespace
#endif

View File

@ -18,10 +18,10 @@
#include "vec.h"
#include "pixmap.h"
#include "texture_manager.h"
#include "random.h"
#include "randomgen.h"
using std::list;
//using Shared::Util::Random;
using Shared::Util::RandomGen;
namespace Shared{ namespace Graphics{
@ -95,7 +95,7 @@ protected:
protected:
Particle *particles;
Shared::Util::Random random;
RandomGen random;
BlendMode blendMode;
State state;

View File

@ -0,0 +1,41 @@
// ==============================================================
// This file is part of Glest Shared Library (www.glest.org)
//
// Copyright (C) 2001-2008 Martiño Figueroa
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
// by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version
// ==============================================================
#ifndef _SHARED_UTIL_RANDOM_H_
#define _SHARED_UTIL_RANDOM_H_
namespace Shared { namespace Util {
// =====================================================
// class RandomGen
// =====================================================
class RandomGen {
private:
static const int m;
static const int a;
static const int b;
private:
int lastNumber;
public:
RandomGen();
void init(int seed);
int rand();
int randRange(int min, int max);
float randRange(float min, float max);
};
}}//end namespace
#endif

View File

@ -18,7 +18,7 @@
#include "util.h"
#include "math_util.h"
#include "random.h"
#include "randomgen.h"
#include "FileReader.h"
#include "ImageReaders.h"
@ -631,7 +631,7 @@ float splatDist(Vec2i a, Vec2i b){
void Pixmap2D::splat(const Pixmap2D *leftUp, const Pixmap2D *rightUp, const Pixmap2D *leftDown, const Pixmap2D *rightDown){
Random random;
RandomGen random;
assert(components==3 || components==4);

View File

@ -12,7 +12,7 @@
#include "sound_player_ds8.h"
#include <cassert>
//#include <cmath>
#include <cmath>
//#include "streflop.h"
#include "util.h"

View File

@ -0,0 +1,45 @@
#include "randomgen.h"
#include <cassert>
#include "leak_dumper.h"
namespace Shared { namespace Util {
// =====================================================
// class RandomGen
// =====================================================
const int RandomGen::m= 714025;
const int RandomGen::a= 1366;
const int RandomGen::b= 150889;
RandomGen::RandomGen(){
lastNumber= 0;
}
void RandomGen::init(int seed){
lastNumber= seed % m;
}
int RandomGen::rand(){
lastNumber= (a*lastNumber + b) % m;
return lastNumber;
}
int RandomGen::randRange(int min, int max){
assert(min<=max);
int diff= max-min;
int res= min + static_cast<int>(static_cast<float>(diff+1)*RandomGen::rand() / m);
assert(res>=min && res<=max);
return res;
}
float RandomGen::randRange(float min, float max){
assert(min<=max);
float rand01= static_cast<float>(RandomGen::rand())/(m-1);
float res= min+(max-min)*rand01;
assert(res>=min && res<=max);
return res;
}
}}//end namespace