From: Oliver O. <fr...@us...> - 2007-03-15 07:27:06
|
Update of /cvsroot/simspark/simspark/spark/salt In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7790/spark/salt Modified Files: fileclasses.cpp fileclasses.h gmath.h sharedlibrary.cpp vector.h Added Files: salt.vcproj Log Message: Merged WIN32 branch back to main trunk (access previous version with tag pre_merge_WIN32) --- NEW FILE: salt.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8,00" Name="salt" ProjectGUID="{17DECC5C-BD53-4ECE-8E4F-707C52D4987C}" RootNamespace="salt" Keyword="Win32Proj" > <Platforms> <Platform Name="Win32" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" /> <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="VCRelease|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" WholeProgramOptimization="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H" RuntimeLibrary="2" UsePrecompiledHeader="0" 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> </Configurations> <References> </References> <Files> <File RelativePath=".\bounds.cpp" > </File> <File RelativePath=".\bounds.h" > </File> <File RelativePath=".\defines.h" > </File> <File RelativePath=".\fileclasses.cpp" > </File> <File RelativePath=".\fileclasses.h" > </File> <File RelativePath=".\frustum.cpp" > </File> <File RelativePath=".\frustum.h" > </File> <File RelativePath=".\gmath.h" > </File> <File RelativePath=".\matrix.cpp" > </File> <File RelativePath=".\matrix.h" > </File> <File RelativePath=".\path.cpp" > </File> <File RelativePath=".\path.h" > </File> <File RelativePath=".\plane.cpp" > </File> <File RelativePath=".\plane.h" > </File> <File RelativePath=".\random.h" > </File> <File RelativePath=".\rect.h" > </File> <File RelativePath=".\salt.h" > </File> <File RelativePath=".\sharedlibrary.cpp" > </File> <File RelativePath=".\sharedlibrary.h" > </File> <File RelativePath=".\tvector.h" > </File> <File RelativePath=".\vector.h" > </File> </Files> <Globals> </Globals> </VisualStudioProject> Index: fileclasses.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/salt/fileclasses.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fileclasses.h 5 Dec 2005 20:56:00 -0000 1.1 --- fileclasses.h 15 Mar 2007 07:26:29 -0000 1.2 *************** *** 39,45 **** --- 39,59 ---- #include <cstdlib> + #ifndef PATH_MAX + #define PATH_MAX 4096 + #endif + namespace salt { + /** Defines the native path separator character for the + platform + */ + static const char* PathSeparator = + #ifdef WIN32 + "\\"; + #else + "/"; + #endif + /** RFile defines an interface and some basic support functions for * classes providing read only file services Index: gmath.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/salt/gmath.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gmath.h 10 Feb 2006 10:12:19 -0000 1.2 --- gmath.h 15 Mar 2007 07:26:29 -0000 1.3 *************** *** 40,43 **** --- 40,51 ---- #endif + #ifndef M_PI + #define M_PI 3.1415926535897932384626433832795 + #endif + + #ifndef M_PI_2 + #define M_PI_2 1.57079632679489661923132169164 /* pi/2 */ + #endif + // better directly use the cmath constants static const double gPI = M_PI; // was ((float)3.1415926535); *************** *** 153,157 **** f_inline TYPE gDegToRad(TYPE deg) { ! return (static_cast<TYPE>(deg)) * (M_PI / 180.0); } --- 161,165 ---- f_inline TYPE gDegToRad(TYPE deg) { ! return (static_cast<TYPE>(deg * (M_PI / 180.0))); } *************** *** 159,163 **** f_inline TYPE gRadToDeg(TYPE rad) { ! return (static_cast<TYPE>(rad)) * (180.0 / M_PI); } --- 167,171 ---- f_inline TYPE gRadToDeg(TYPE rad) { ! return (static_cast<TYPE>(rad * (180.0 / M_PI))); } Index: vector.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/salt/vector.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** vector.h 5 Dec 2005 20:56:00 -0000 1.1 --- vector.h 15 Mar 2007 07:26:29 -0000 1.2 *************** *** 70,74 **** } ! return rad; } --- 70,74 ---- } ! return static_cast<float>(rad); } Index: fileclasses.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/salt/fileclasses.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fileclasses.cpp 5 Dec 2005 20:56:00 -0000 1.1 --- fileclasses.cpp 15 Mar 2007 07:26:29 -0000 1.2 *************** *** 210,214 **** long oldPos = mPosition; ! mPosition += (size*count); if(mPosition >= mSize) { --- 210,214 ---- long oldPos = mPosition; ! mPosition += static_cast<long>(size*count); if(mPosition >= mSize) { *************** *** 297,301 **** } ! int StdFile::GetPos(long*/* pos*/) { return ftell((FILE*)mHandle); --- 297,301 ---- } ! int StdFile::GetPos(long* /*pos*/) { return ftell((FILE*)mHandle); Index: sharedlibrary.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/salt/sharedlibrary.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sharedlibrary.cpp 22 Jan 2006 12:13:08 -0000 1.3 --- sharedlibrary.cpp 15 Mar 2007 07:26:29 -0000 1.4 *************** *** 21,29 **** */ #include "sharedlibrary.h" - #include <dlfcn.h> #include <iostream> using namespace salt; bool SharedLibrary::Open(const std::string &libName) --- 21,71 ---- */ #include "sharedlibrary.h" #include <iostream> + #ifdef WIN32 + #include <windows.h> + #else + #include <dlfcn.h> + #endif + using namespace salt; + #ifdef WIN32 + + bool SharedLibrary::Open(const std::string &libName) + { + if (mLibHandle) + { + Close(); + } + + #if INIT_DEBUG + std::cerr << "(SharedLibrary) Opening " << libName + ".so\n"; + #endif + mLibHandle = ::LoadLibrary((libName + ".dll").c_str()); + + return (mLibHandle!=NULL); + } + + void* SharedLibrary::GetProcAddress(const std::string &procName) + { + if (mLibHandle) + { + return ::GetProcAddress((HMODULE)mLibHandle, procName.c_str()); + } + return NULL; + } + + void SharedLibrary::Close() + { + if (mLibHandle) + { + ::FreeLibrary((HMODULE)mLibHandle); + mLibHandle = NULL; + } + } + + #else + bool SharedLibrary::Open(const std::string &libName) *************** *** 40,44 **** if (mLibHandle == NULL) { ! std::cerr << "(SharedLibrary) ERROR: dlopen faild for " << libName << " with: \n\t" << dlerror() << std::endl; } --- 82,86 ---- if (mLibHandle == NULL) { ! std::cerr << "(SharedLibrary) ERROR: dlopen failed for " << libName << " with: \n\t" << dlerror() << std::endl; } *************** *** 70,73 **** --- 112,117 ---- } + #endif // WIN32 + const std::string& SharedLibrary::GetName() const *************** *** 75,76 **** --- 119,122 ---- return mName; } + + |