Changeset 735

Show
Ignore:
Timestamp:
06/21/09 00:46:27 (9 months ago)
Author:
hagish
Message:

added function to display number of allocated gfx 3d objects

Location:
trunk/lugre
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/lugre/include/lugre_gfx3D.h

    r548 r735  
    6868         
    6969class cGfx3D : public cSmartPointable { public : 
     70        static unsigned int miCount; 
     71 
    7072        // client only 
    7173        SceneNode*                                      mpSceneNode; 
  • trunk/lugre/src/lugre_gfx3D.cpp

    r734 r735  
    538538} 
    539539 
     540unsigned int cGfx3D::miCount = 0; 
     541 
    540542cGfx3D::cGfx3D  (SceneNode* pSceneNode) :  
    541543        mpSceneNode                             (pSceneNode), 
     
    561563        mpForceRotCam                   (0), 
    562564        mbHasPath                               (false), 
    563         mbPrepareFrameStep      (false) {} 
     565        mbPrepareFrameStep      (false)  
     566{ 
     567        ++miCount;       
     568} 
    564569 
    565570cGfx3D::~cGfx3D () { PROFILE 
     571        --miCount; 
    566572        Clear(); 
    567573        DestroyPath(); 
  • trunk/lugre/src/lugre_gfx3D_L.cpp

    r663 r735  
    3636                        lua_register(L,"CreateCamPosGfx3D",             &cGfx3D_L::CreateCamPosGfx3D); 
    3737                        lua_register(L,"CreateCockpitGfx3D",    &cGfx3D_L::CreateCockpitGfx3D); 
     38                        lua_register(L,"GetGfx3DCount",                 &cGfx3D_L::GetGfx3DCount); 
    3839                         
    3940                        #define REGISTER_METHOD(methodname) mlMethod.push_back(make_luaL_reg(#methodname,&cGfx3D_L::methodname)); 
     
    160161 
    161162 
     163                /// returns the number of gfx3d objects that are currently allocated 
     164                static int      GetGfx3DCount           (lua_State *L) { PROFILE 
     165                        lua_pushnumber(L,cGfx3D::miCount); 
     166                        return 1; 
     167                } 
     168 
    162169                static int      CreateGfx3D             (lua_State *L) { PROFILE 
    163170                        std::string sSceneMgrName       = (lua_gettop(L) >= 1 && !lua_isnil(L,1)) ? luaL_checkstring(L,1) : "main";