Jump to content
  • Advertisement
Sign in to follow this  
eye776

Oppinions on LevelRoom and LevelManager

This topic is 4485 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a game project (FF-like RPG) in the works and after much deliberation I decided to use Irrlicht as the engine(pls no boycots, and no n00b posts :D). I decided to load levels from XML files under the structure of "Level->Rooms". So could anyone tell me if i'm doing ok or if i need to change some aspects, please? Room
class cLevelRoom
        {
        private:
            int   m_ID;
            int   m_iNextValidID;
            char* m_cName;
            bool  m_bVisible;

            irr::core::aabbox3df Room_AABB; //culling purposes, collision purposes
            irr::core::array<irr::scene::ISceneNode*> m_pDisplayMeshes;
            irr::core::array<irr::scene::ISceneNode*> m_pCollisionMeshes;
            irr::scene::IMetaTriangleSelector* m_pMetaTriangleSelector;
            irr::scene::ISceneManager* m_pSceneMgr;
        public:
            cLevelRoom();
            ~cLevelRoom();

            void addVisibleMesh(char* meshname, video::ITexture *texture, irr::core::vector3df position, irr::core::vector3df rotation, irr::core::vector3df scale, irr::video::E_MATERIAL_TYPE material_type);

            void addCollisionMesh(char* meshname, irr::core::vector3df position, irr::core::vector3df rotation, irr::core::vector3df scale, bool use_AABB_not_Mesh);

            void moveSceneNode (int m_iNodeID, irr::core::vector3df m_vNewPos);
            void enableFog (bool flag);
            void setVisible (bool flag);
            char* getName(){return m_cName;};

            void processTriangleSelector(); //build up meta triangle selector
            void processRoom(); //update room

            void init(int id, char* name, irr::scene::ISceneManager* ScnMgr, irr::core::aabbox3df startAABB);
            void clear(); // free tri. selector, delete meshes
        };
Level
class cLevelManager
        {
        private:
            bool m_bIsWorldMap;
            irr::core::aabbox3df Level_AABB;

            irr::scene::ISceneManager* m_pSceneMgr;
            core::array<cLevelRoom*> m_cuRoomArray;

            DS3D::Game::cLevelRoom* createRoom();
        public:
            cLevelManager();
            ~cLevelManager();

            void addRoom(char* name, bool visible);
            void removeRoomByID(int roomID);
            void removeRoomByName(char* name);
            DS3D::Game::cLevelRoom* getRoom(int roomID);

            void setRoom_Visible(int roomID, bool flag);
            void setRoom_Fog(int roomID, bool flag);
            void addLight(core::vector3df lightPos);
            void update();

            void loadFromXML(irr::IrrlichtDevice* device, char* filename);
        };
Thanks for the comments in advance. :D (Help a n00b out here, will you? :) )

Share this post


Link to post
Share on other sites
Advertisement
The only thing I have issue with is the 'int m_iNextValidID;' in the cLevelRoom class.

I'm assuming that since each room has a particular id, then that is the next valid id for when a room is being added? If so, then it shouldn't really be there. A single room shouldn't care about future rooms, the cLevelManager class should care about that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!