/[enigma]/enigma/src/d_models.cc
ViewVC logotype

Diff of /enigma/src/d_models.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by ant_39, Sat Jun 14 21:05:10 2003 UTC revision 1.9 by dheck, Sun Jun 15 10:28:34 2003 UTC
# Line 37  using namespace px; Line 37  using namespace px;
37    
38  #include "d_models.hh"  #include "d_models.hh"
39    
40    extern "C" {
41    #include "lualib.h"
42    #include "tolua.h"
43    }
44    #include "display-lua.hh"
45    #include "px-lua.hh"
46    
47  //----------------------------------------  //----------------------------------------
48  // Image cache  // Image cache
# Line 174  ModelManager::remove (const std::string Line 180  ModelManager::remove (const std::string
180  // MODELS  // MODELS
181  //----------------------------------------------------------------------  //----------------------------------------------------------------------
182    
183  void  void display::InitModels()
 display::InitModels()  
184  {  {
185      modelmgr = new ModelManager;      modelmgr = new ModelManager;
186    
187      lua::Dofile("models-2d.lua");      lua_State *L = lua_open(0);
188        lua_baselibopen (L);
189        lua_strlibopen(L);
190        lua_register (L, "FindDataFile", lua::FindDataFile);
191        tolua_open(L);
192        tolua_display_open(L);
193        tolua_px_open(L);
194    
195        string fname = enigma::FindDataFile ("models-2d.lua");
196        if (lua_dofile (L, fname.c_str()) != 0) {
197            fprintf (stderr, "Error loading 'models-2d.lua'\n");
198        }
199      enigma::Log << "# models: " << modelmgr->num_templates() << endl;      enigma::Log << "# models: " << modelmgr->num_templates() << endl;
200  //     enigma::Log << "# images: " << surface_cache.size() << endl;  //     enigma::Log << "# images: " << surface_cache.size() << endl;
201    
202      surface_cache_alpha.clear();      surface_cache_alpha.clear();
203  }  }
204    
205  void  void display::ShutdownModels()
 display::ShutdownModels()  
206  {  {
207      delete modelmgr;      delete modelmgr;
208  }  }
209    
210  void  void display::ReloadModels()
 display::ReloadModels()  
211  {  {
212      NewWorld(0,0);      NewWorld(0,0);
213      surface_cache.clear();      surface_cache.clear();

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26