Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv13038
Modified Files:
GlobalCommands.cpp Makefile TerrainObject.cpp
Log Message:
scripts now searched for in ./scripts
Index: GlobalCommands.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source/GlobalCommands.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** GlobalCommands.cpp 12 Dec 2002 21:13:45 -0000 1.4
--- GlobalCommands.cpp 13 Dec 2002 04:39:06 -0000 1.5
***************
*** 4,7 ****
--- 4,8 ----
#include "global.h"
+ #include "Platform.h"
#include "GlobalCommands.h"
#include "VirtualBattlefield.h"
***************
*** 96,105 ****
char buff[255];
// open file
! ifstream file(args[0].c_str());
if (!file)
{
! return "Unable to find script file " + args[0];
}
--- 97,115 ----
char buff[255];
+ string path = args[0];
+
+ if (!OSPath::isabs(path)) {
+ string base;
+ base = OSPath::join(".", "scripts");
+ path = OSPath::join(base, path);
+ }
+
+ path = OSPath::filter(path);
// open file
! ifstream file(path.c_str());
if (!file)
{
! return "Unable to find script file " + path;
}
Index: Makefile
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Makefile 13 Dec 2002 01:20:58 -0000 1.3
--- Makefile 13 Dec 2002 04:39:06 -0000 1.4
***************
*** 79,82 ****
--- 79,83 ----
./ObjectTypeSymbol.cpp \
./ParticleObject.cpp \
+ ./Platform.cpp \
./ProjectileController.cpp \
./ProjectileObject.cpp \
Index: TerrainObject.cpp
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/CSPFlightSim/Source/TerrainObject.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TerrainObject.cpp 12 Dec 2002 21:13:45 -0000 1.3
--- TerrainObject.cpp 13 Dec 2002 04:39:06 -0000 1.4
***************
*** 309,320 ****
void TerrainObject::UpdateDemeterSettings()
{
! #ifdef _WIN32
! char fileSeparator = '\\';
! #else
! char fileSeparator = '/';
! #endif
! char szMediaPath[9];
! sprintf(szMediaPath,".%cterrain%c",fileSeparator,fileSeparator);
Demeter::Settings::GetInstance()->SetMediaPath(szMediaPath);
--- 309,315 ----
void TerrainObject::UpdateDemeterSettings()
{
! char szMediaPath[9];
! sprintf(szMediaPath,".%cterrain%c",DIR_SEPARATOR,DIR_SEPARATOR);
Demeter::Settings::GetInstance()->SetMediaPath(szMediaPath);
|