1) Split file_manager into file handling functions (in file_manager),
and loading related (very plib specific) functions in the new loader object. 2) Move *.tkkf files into separate subdirs, and renamed them to *.kart files. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1619 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
0f05001944
commit
9715f53659
@ -1,14 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Dino")
|
||||
(model-file "dinokart-high.ac")
|
||||
(icon-file "dinoicon.rgb")
|
||||
(shadow-file "dinoshadow.rgb")
|
||||
|
||||
(red 1.0)
|
||||
(green 0.7)
|
||||
(blue 0.1)
|
||||
|
||||
)
|
||||
;; EOF ;;
|
@ -1,14 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Eviltux")
|
||||
(model-file "eviltux.ac")
|
||||
(icon-file "eviltuxicon.rgb")
|
||||
(shadow-file "tuxkartshadow.rgb")
|
||||
|
||||
(red 0.3)
|
||||
(green 0.1)
|
||||
(blue 0.6)
|
||||
|
||||
)
|
||||
;; EOF ;;
|
@ -1,14 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Hexley")
|
||||
(model-file "hexleykart.ac")
|
||||
(icon-file "hexleyicon.rgb")
|
||||
(shadow-file "hexleyshadow.rgb")
|
||||
|
||||
(red 0.9)
|
||||
(green 0.2)
|
||||
(blue 0.2)
|
||||
|
||||
)
|
||||
;; EOF ;;
|
@ -1,14 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Mr. Ice Block")
|
||||
(model-file "mriceblock.ac")
|
||||
(icon-file "mriceblockicon.rgb")
|
||||
(shadow-file "mriceblockshadow.rgb")
|
||||
|
||||
(red 0.0)
|
||||
(green 0.9)
|
||||
(blue 1.0)
|
||||
|
||||
)
|
||||
;; EOF ;;
|
@ -1,15 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Nolok")
|
||||
(model-file "nolokkart-high.ac")
|
||||
(icon-file "nolokicon.rgb")
|
||||
(shadow-file "tuxkartshadow.rgb")
|
||||
|
||||
(red 0.6)
|
||||
(green 0.6)
|
||||
(blue 0.5)
|
||||
|
||||
)
|
||||
|
||||
;; EOF ;;
|
@ -1,14 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Penny")
|
||||
(model-file "pennykart-med.ac")
|
||||
(icon-file "pennyicon.rgb")
|
||||
(shadow-file "pennyshadow.rgb")
|
||||
|
||||
(red 0.8)
|
||||
(green 0.2)
|
||||
(blue 0.6)
|
||||
|
||||
)
|
||||
;; EOF ;;
|
@ -1,14 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Skirpy")
|
||||
(model-file "skirpy-high.ac")
|
||||
(icon-file "skirpyicon.rgb")
|
||||
(shadow-file "tuxkartshadow.rgb")
|
||||
|
||||
(red 0.1)
|
||||
(green 0.5)
|
||||
(blue 0.1)
|
||||
|
||||
)
|
||||
;; EOF ;;
|
@ -1,14 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Sushi")
|
||||
(model-file "sushikart.ac")
|
||||
(icon-file "sushiicon.rgb")
|
||||
(shadow-file "sushishadow.rgb")
|
||||
|
||||
(red 0.8)
|
||||
(green 0.0)
|
||||
(blue 0.5)
|
||||
|
||||
)
|
||||
;; EOF ;;
|
@ -1,13 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Tux")
|
||||
(model-file "tuxkart.ac")
|
||||
(icon-file "tuxicon.rgb")
|
||||
(shadow-file "tuxkartshadow.rgb")
|
||||
|
||||
(red 0.7)
|
||||
(green 0.0)
|
||||
(blue 0.0)
|
||||
)
|
||||
;; EOF ;;
|
@ -1,14 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Wilber")
|
||||
(model-file "wilber-low.ac")
|
||||
(icon-file "wilbericon.rgb")
|
||||
(shadow-file "wilbershadow.rgb")
|
||||
|
||||
(red 0.25)
|
||||
(green 0.23)
|
||||
(blue 0.18)
|
||||
|
||||
)
|
||||
;; EOF ;;
|
@ -1,14 +0,0 @@
|
||||
;; -*- mode: lisp -*-
|
||||
|
||||
(tuxkart-kart
|
||||
(name "Yeti")
|
||||
(model-file "yetikart.ac")
|
||||
(icon-file "yetiicon.rgb")
|
||||
(shadow-file "yetishadow.rgb")
|
||||
|
||||
(red 0.5)
|
||||
(green 0.8)
|
||||
(blue 1.0)
|
||||
|
||||
)
|
||||
;; EOF ;;
|
@ -51,7 +51,8 @@ supertuxkart_SOURCES = main.cpp \
|
||||
stk_config.cpp stk_config.hpp \
|
||||
highscores.cpp highscores.hpp \
|
||||
highscore_manager.cpp highscore_manager.hpp \
|
||||
file_manager.cpp file_manager.hpp \
|
||||
file_manager.cpp file_manager.hpp \
|
||||
loader.cpp loadre.hpp \
|
||||
race_manager.cpp race_manager.hpp \
|
||||
string_utils.cpp string_utils.hpp \
|
||||
track_manager.cpp track_manager.hpp \
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "attachment_manager.hpp"
|
||||
#include "file_manager.hpp"
|
||||
#include "loader.hpp"
|
||||
|
||||
AttachmentManager *attachment_manager = 0;
|
||||
|
||||
@ -65,7 +66,7 @@ void AttachmentManager::loadModels()
|
||||
{
|
||||
for(int i=0; iat[i].attachment!=ATTACH_MAX; i++)
|
||||
{
|
||||
m_attachments[iat[i].attachment]=file_manager->load(iat[i].file, CB_ATTACHMENT);
|
||||
m_attachments[iat[i].attachment]=loader->load(iat[i].file, CB_ATTACHMENT);
|
||||
m_attachments[iat[i].attachment]->ref();
|
||||
} // for
|
||||
} // reInit
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include "spark.hpp"
|
||||
#include "missile.hpp"
|
||||
#include "homing.hpp"
|
||||
#include "loader.hpp"
|
||||
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
# define snprintf _snprintf
|
||||
#endif
|
||||
@ -124,7 +126,7 @@ void CollectableManager::LoadNode(const lisp::Lisp* lisp, int collectType )
|
||||
|
||||
if(sModel!="")
|
||||
{
|
||||
ssgEntity* e = file_manager->load(sModel, CB_COLLECTABLE);
|
||||
ssgEntity* e = loader->load(sModel, CB_COLLECTABLE);
|
||||
m_all_models[collectType] = e;
|
||||
e->ref();
|
||||
e->clrTraversalMaskBits(SSGTRAV_ISECT|SSGTRAV_HOT);
|
||||
|
@ -86,8 +86,6 @@ FileManager::FileManager()
|
||||
{
|
||||
m_is_full_path = false;
|
||||
|
||||
m_current_callback_type = CB_COLLECTABLE;
|
||||
|
||||
if ( getenv ( "SUPERTUXKART_DATADIR" ) != NULL )
|
||||
m_root_dir= getenv ( "SUPERTUXKART_DATADIR" ) ;
|
||||
#ifdef __APPLE__
|
||||
@ -137,23 +135,6 @@ bool FileManager::findFile(std::string& full_path,
|
||||
return false;
|
||||
} // findFile
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void FileManager::makeModelPath(char* path, const char* FNAME) const
|
||||
{
|
||||
if(m_is_full_path)
|
||||
{
|
||||
strcpy(path, FNAME);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string p;
|
||||
if(findFile(p, FNAME, m_model_search_path))
|
||||
{
|
||||
strcpy(path, p.c_str());
|
||||
return;
|
||||
}
|
||||
} // makeModelPath
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string FileManager::getTextureFile(const std::string& FNAME) const
|
||||
{
|
||||
@ -170,20 +151,21 @@ std::string FileManager::getModelFile(const std::string& FNAME) const
|
||||
return path;
|
||||
} // makeTexturePath
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string FileManager::getKartFile(const std::string& fname) const
|
||||
{
|
||||
return m_root_dir+"/data/"+fname;
|
||||
} // getKartFile
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string FileManager::getTrackDir() const
|
||||
{
|
||||
return m_root_dir+"/data/tracks";
|
||||
} // getTrackDir
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string FileManager::getKartDir() const
|
||||
{
|
||||
return m_root_dir+"/data/karts";
|
||||
} // getKartDir
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string FileManager::getTrackFile(const std::string& fname,
|
||||
const std::string& track_name) const
|
||||
const std::string& track_name) const
|
||||
{
|
||||
// tracks file are in data/tracks/TRACKNAME/TRACKNAME.ext
|
||||
// but if a track name is supplied use it (which is necessary
|
||||
@ -193,6 +175,18 @@ std::string FileManager::getTrackFile(const std::string& fname,
|
||||
return getTrackDir()+"/"+basename+"/"+fname;
|
||||
} // getTrackFile
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string FileManager::getKartFile(const std::string& fname,
|
||||
const std::string& kart_name) const
|
||||
{
|
||||
// kart file are in data/karts/KARTNAME/KARTNAME.ext
|
||||
// but if a kart name is supplied use it (which is necessary
|
||||
// e.g. to load a model from a kart directory
|
||||
std::string basename = (kart_name!="") ? kart_name
|
||||
: StringUtils::without_extension(fname);
|
||||
return getKartDir()+"/"+basename+"/"+fname;
|
||||
} // getKartFile
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string FileManager::getConfigFile(const std::string& fname) const
|
||||
{
|
||||
@ -301,159 +295,4 @@ void FileManager::listFiles(std::set<std::string>& result, const std::string& di
|
||||
ulCloseDir(mydir);
|
||||
} // listFiles
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Loads a .ac model
|
||||
*
|
||||
* Loads the .ac model 'filename'. Callbacks contained in this file
|
||||
* are stored in the callback class t. If optimise is set to false,
|
||||
* the file will not be flattened, which is necessary for the kart
|
||||
* models - flattening them will remove the wheel nodes, withouth
|
||||
* which the wheels do not rotate.
|
||||
*
|
||||
* \param filename File to load
|
||||
*
|
||||
* \param t Callback category for callbacks included in this
|
||||
* file (see callback_manager.hpp)
|
||||
*
|
||||
* \param optimise Default is true. If set to false, the model will not
|
||||
* be flattened.
|
||||
*/
|
||||
ssgEntity *FileManager::load(const std::string& filename, CallbackType t,
|
||||
bool optimise, bool is_full_path)
|
||||
{
|
||||
m_current_callback_type = t;
|
||||
m_is_full_path = is_full_path;
|
||||
ssgEntity *obj = optimise ? ssgLoad (filename.c_str(), this)
|
||||
: ssgLoadAC(filename.c_str(), this);
|
||||
preProcessObj(obj, false);
|
||||
return obj;
|
||||
} // load
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void FileManager::preProcessObj ( ssgEntity *n, bool mirror )
|
||||
{
|
||||
if ( n == NULL ) return ;
|
||||
|
||||
n -> dirtyBSphere () ;
|
||||
|
||||
if ( n -> isAKindOf ( ssgTypeLeaf() ) )
|
||||
{
|
||||
if ( mirror )
|
||||
for ( int i = 0 ; i < ((ssgLeaf *)n) -> getNumVertices () ; i++ )
|
||||
((ssgLeaf *)n) -> getVertex ( i ) [ 0 ] *= -1.0f ;
|
||||
|
||||
material_manager->getMaterial ( (ssgLeaf *) n ) -> applyToLeaf ( (ssgLeaf *) n ) ;
|
||||
return ;
|
||||
}
|
||||
|
||||
if ( mirror && n -> isAKindOf ( ssgTypeTransform () ) )
|
||||
{
|
||||
sgMat4 xform ;
|
||||
|
||||
((ssgTransform *)n) -> getTransform ( xform ) ;
|
||||
xform [ 0 ][ 0 ] *= -1.0f ;
|
||||
xform [ 1 ][ 0 ] *= -1.0f ;
|
||||
xform [ 2 ][ 0 ] *= -1.0f ;
|
||||
xform [ 3 ][ 0 ] *= -1.0f ;
|
||||
((ssgTransform *)n) -> setTransform ( xform ) ;
|
||||
}
|
||||
|
||||
ssgBranch *b = (ssgBranch *) n ;
|
||||
|
||||
for ( int i = 0 ; i < b -> getNumKids () ; i++ )
|
||||
preProcessObj ( b -> getKid ( i ), mirror ) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
ssgBranch *FileManager::animInit (char *data ) const
|
||||
{
|
||||
while ( ! isdigit ( *data ) && *data != '\0' )
|
||||
data++ ;
|
||||
|
||||
const int START_LIM = strtol(data, &data, 0 );
|
||||
const int END_LIM = strtol(data, &data, 0 );
|
||||
const float TIME_LIM = (float)strtod(data, &data );
|
||||
|
||||
while ( *data <= ' ' && *data != '\0' )
|
||||
data++ ;
|
||||
|
||||
char mode = toupper ( *data ) ;
|
||||
|
||||
ssgTimedSelector *br = new ssgTimedSelector;
|
||||
|
||||
br->setLimits (START_LIM+1, END_LIM+1 ) ;
|
||||
br->setDuration(TIME_LIM ) ;
|
||||
br->setMode ((mode=='O') ? SSG_ANIM_ONESHOT
|
||||
: (mode=='S') ? SSG_ANIM_SWING
|
||||
: SSG_ANIM_SHUTTLE ) ;
|
||||
br->control (SSG_ANIM_START ) ;
|
||||
|
||||
return br;
|
||||
} // animInit
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Handle userdata that is stored in the model files. Mostly the userdata
|
||||
* indicates that a special branch is to be created (e.g. a ssgCutout instead
|
||||
* of the standard branch). But some userdata indicate that callbacks need
|
||||
* to be created, which are then handled by the callback manager.
|
||||
*/
|
||||
|
||||
ssgBranch *FileManager::createBranch(char *data) const
|
||||
{
|
||||
|
||||
if ( data == NULL || data[0] != '@' ) return NULL;
|
||||
|
||||
data++ ; /* Skip the '@' */
|
||||
|
||||
if ( strncmp("billboard", data, strlen("billboard") ) == 0 )
|
||||
return new ssgCutout();
|
||||
|
||||
if ( strncmp("DONT_DELETE", data, strlen("DONT_DELETE") ) == 0 )
|
||||
{
|
||||
printf("DONT\n");
|
||||
ssgBranch *br = new ssgTransform();
|
||||
br->setUserData(new ssgBase());
|
||||
return br;
|
||||
}
|
||||
|
||||
if ( strncmp("invisible", data, strlen("invisible") ) == 0 )
|
||||
return new ssgInvisible();
|
||||
|
||||
if ( strncmp ( "switch", data, strlen ( "switch" ) ) == 0 )
|
||||
{
|
||||
ssgSelector *sel = new ssgSelector();
|
||||
sel->select(0);
|
||||
return sel;
|
||||
}
|
||||
|
||||
if ( strncmp ( "animate", data, strlen ( "animate" ) ) == 0 )
|
||||
return animInit(data);
|
||||
|
||||
|
||||
if ( strncmp ( "autodcs", data, strlen ( "autodcs" ) ) == 0 )
|
||||
{
|
||||
ssgTransform *br = new ssgTransform();
|
||||
Callback *c = new MovingTexture(data, br);
|
||||
br->setUserData(new ssgBase());
|
||||
callback_manager->addCallback(c, m_current_callback_type);
|
||||
return br;
|
||||
}
|
||||
|
||||
if ( strncmp ( "autotex", data, strlen ( "autotex" ) ) == 0 )
|
||||
{
|
||||
ssgTexTrans *br = new ssgTexTrans();
|
||||
Callback *c = new MovingTexture(data, br);
|
||||
callback_manager->addCallback(c, m_current_callback_type);
|
||||
return br;
|
||||
}
|
||||
if(strncmp("physics", data, strlen("physics")) == 0)
|
||||
{
|
||||
MovingPhysics *mp = new MovingPhysics(std::string(data));
|
||||
callback_manager->addCallback(mp, m_current_callback_type);
|
||||
return mp;
|
||||
}
|
||||
fprintf(stderr, "Warning: Ignoring userdata '%s'\n", data);
|
||||
return NULL ;
|
||||
} // createBranch
|
||||
|
||||
//-----------------------------------------------------------------------------
|
@ -20,7 +20,6 @@
|
||||
#ifndef HEADER_FILE_MANAGER_H
|
||||
#define HEADER_FILE_MANAGER_H
|
||||
|
||||
#include <plib/ssg.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
@ -41,9 +40,12 @@ public:
|
||||
FileManager();
|
||||
~FileManager();
|
||||
|
||||
virtual void makeModelPath (char* path, const char* fname) const;
|
||||
std::string getHomeDir () const;
|
||||
std::string getTrackDir () const;
|
||||
std::string getKartDir () const;
|
||||
std::string getTextureFile (const std::string& fname) const;
|
||||
std::string getKartFile (const std::string& fname) const;
|
||||
std::string getKartFile (const std::string& fname,
|
||||
const std::string& kart="") const;
|
||||
std::string getTrackFile (const std::string& fname,
|
||||
const std::string& track="") const;
|
||||
std::string getConfigFile (const std::string& fname) const;
|
||||
@ -53,8 +55,6 @@ public:
|
||||
std::string getSFXFile (const std::string& fname) const;
|
||||
std::string getFontFile (const std::string& fname) const;
|
||||
std::string getModelFile (const std::string& fname) const;
|
||||
std::string getHomeDir () const;
|
||||
std::string getTrackDir () const;
|
||||
#ifdef HAVE_GHOST_REPLAY
|
||||
std::string getReplayFile(const std::string& fname) const;
|
||||
#endif
|
||||
@ -73,17 +73,9 @@ public:
|
||||
void popModelSearchPath () {m_model_search_path.pop_back(); }
|
||||
void popMusicSearchPath () {m_music_search_path.pop_back(); }
|
||||
void initConfigDir();
|
||||
ssgEntity *load(const std::string& filename, CallbackType t, bool optimise=true,
|
||||
bool is_full_path=false);
|
||||
void setCallbackType(CallbackType t) {m_current_callback_type=t;}
|
||||
private:
|
||||
CallbackType m_current_callback_type;
|
||||
|
||||
void makePath (std::string& path, const std::string& dir,
|
||||
const std::string& fname) const;
|
||||
ssgBranch *createBranch (char *data) const;
|
||||
void preProcessObj( ssgEntity *n, bool mirror );
|
||||
ssgBranch *animInit (char *data) const;
|
||||
};
|
||||
|
||||
extern FileManager* file_manager;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "user_config.hpp"
|
||||
#include "herring_manager.hpp"
|
||||
#include "file_manager.hpp"
|
||||
#include "loader.hpp"
|
||||
#include "material_manager.hpp"
|
||||
#include "material.hpp"
|
||||
#include "kart.hpp"
|
||||
@ -128,7 +129,7 @@ void HerringManager::loadDefaultHerrings()
|
||||
{
|
||||
if(!StringUtils::has_suffix(*i, ".ac")) continue;
|
||||
std::string fullName = "herrings/"+(*i);
|
||||
ssgEntity* h = file_manager->load(fullName, CB_HERRING);
|
||||
ssgEntity* h = loader->load(fullName, CB_HERRING);
|
||||
std::string shortName = StringUtils::without_extension(*i);
|
||||
h->ref();
|
||||
h->setName(shortName.c_str());
|
||||
|
@ -754,6 +754,10 @@
|
||||
RelativePath="../../../src\kart_properties_manager.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\loader.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="../../../src\main.cpp"
|
||||
>
|
||||
@ -1160,6 +1164,10 @@
|
||||
RelativePath="../../../src\kart_properties_manager.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\loader.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="../../../src\material.hpp"
|
||||
>
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "material_manager.hpp"
|
||||
#include "lisp/parser.hpp"
|
||||
#include "lisp/lisp.hpp"
|
||||
#include "loader.hpp"
|
||||
#include "file_manager.hpp"
|
||||
#include "string_utils.hpp"
|
||||
#include "kart_properties.hpp"
|
||||
@ -83,7 +84,8 @@ void KartProperties::load(const std::string filename, const std::string node,
|
||||
// Load model, except when called as part of --list-karts
|
||||
if(m_model_file.length()>0 && !dont_load_models)
|
||||
{
|
||||
m_model = file_manager->load(m_model_file, CB_KART, false);
|
||||
|
||||
m_model = loader->load(m_model_file, CB_KART, false);
|
||||
ssgStripify(m_model);
|
||||
float x_min, x_max, y_min, y_max, z_min, z_max;
|
||||
MinMax(m_model, &x_min, &x_max, &y_min, &y_max, &z_min, &z_max);
|
||||
|
@ -59,24 +59,35 @@ void KartPropertiesManager::loadKartData(bool dont_load_models)
|
||||
{
|
||||
m_max_steer_angle = -1.0f;
|
||||
std::set<std::string> result;
|
||||
file_manager->listFiles(result, "data");
|
||||
file_manager->listFiles(result, file_manager->getKartDir(),
|
||||
/*is_full_path*/ true);
|
||||
|
||||
// Find out which characters are available and load them
|
||||
for(std::set<std::string>::iterator i = result.begin();
|
||||
i != result.end(); ++i)
|
||||
{
|
||||
std::string kart_file;
|
||||
if(*i=="." || *i=="..") continue;
|
||||
try
|
||||
{
|
||||
if (StringUtils::has_suffix(*i, ".tkkf"))
|
||||
{
|
||||
KartProperties* kp = new KartProperties();
|
||||
std::string filename=file_manager->getKartFile(*i);
|
||||
kp->load(filename.c_str(), "tuxkart-kart", dont_load_models);
|
||||
m_karts_properties.push_back(kp);
|
||||
if(kp->getMaxSteerAngle() > m_max_steer_angle)
|
||||
{
|
||||
m_max_steer_angle = kp->getMaxSteerAngle();
|
||||
}
|
||||
} // if
|
||||
} // for i
|
||||
kart_file = file_manager->getKartFile((*i)+".kart");
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
(void)e; // remove warning about unused variable
|
||||
continue;
|
||||
}
|
||||
FILE *f=fopen(kart_file.c_str(),"r");
|
||||
if(!f) continue;
|
||||
fclose(f);
|
||||
KartProperties* kp = new KartProperties();
|
||||
kp->load(kart_file, "tuxkart-kart", dont_load_models);
|
||||
m_karts_properties.push_back(kp);
|
||||
if(kp->getMaxSteerAngle() > m_max_steer_angle)
|
||||
{
|
||||
m_max_steer_angle = kp->getMaxSteerAngle();
|
||||
}
|
||||
} // for i
|
||||
} // loadKartData
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "projectile_manager.hpp"
|
||||
#include "race_manager.hpp"
|
||||
#include "file_manager.hpp"
|
||||
#include "loader.hpp"
|
||||
#include "game_manager.hpp"
|
||||
#include "widget_manager.hpp"
|
||||
#include "material_manager.hpp"
|
||||
@ -370,7 +371,8 @@ int handleCmdLine(int argc, char **argv)
|
||||
void InitTuxkart()
|
||||
{
|
||||
file_manager = new FileManager();
|
||||
file_manager->setCreateStateCallback(getAppState);
|
||||
loader = new Loader();
|
||||
loader->setCreateStateCallback(getAppState);
|
||||
user_config = new UserConfig();
|
||||
sound_manager = new SoundManager();
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "file_manager.hpp"
|
||||
#include "loader.hpp"
|
||||
#include "projectile_manager.hpp"
|
||||
#include "spark.hpp"
|
||||
#include "missile.hpp"
|
||||
@ -36,7 +36,7 @@ void ProjectileManager::loadData()
|
||||
|
||||
// Load the explosion model and find the actual selector branch in it.
|
||||
// Only the explosion model is loaded here, see collectable_manager.
|
||||
m_explosion_model = find_selector((ssgBranch*)file_manager->load("explode.ac",
|
||||
m_explosion_model = find_selector((ssgBranch*)loader->load("explode.ac",
|
||||
CB_EXPLOSION) );
|
||||
m_explosion_model->ref();
|
||||
if ( m_explosion_model == NULL )
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <sstream>
|
||||
#include <plib/ssgAux.h>
|
||||
#include "file_manager.hpp"
|
||||
#include "loader.hpp"
|
||||
#include "track.hpp"
|
||||
#include "string_utils.hpp"
|
||||
#include "lisp/lisp.hpp"
|
||||
@ -1249,7 +1250,7 @@ void Track::loadTrackModel()
|
||||
}
|
||||
} // if need_hat
|
||||
|
||||
ssgEntity *obj = file_manager->load(file_manager->getModelFile(fname),
|
||||
ssgEntity *obj = loader->load(file_manager->getModelFile(fname),
|
||||
CB_TRACK,
|
||||
/* optimise */ true,
|
||||
/*is_full_path*/ true);
|
||||
|
Loading…
Reference in New Issue
Block a user