// -*- mode: C++; tab-width: 4; indent-tabs-mode: t; -*- vim:ts=4:sw=4 // // Copyright (C) 2004,2005 David Lau (skunix) // Chong Kai Xiong (descender) // // This file is part of The Plains of Usata. // // The Plains of Usata is licensed under the GNU General Public // License (GPL) version 2. For details, please see the COPYING file // included in the software distribution, or visit // http://www.fsf.org/licenses/gpl.html. // // $Id: scene-loader.hpp,v 1.1 2005/02/23 16:52:07 skunix Exp $ #ifndef USATA_SCENE_LOADER_HPP #define USATA_SCENE_LOADER_HPP #include #include #include #include #include #include #include #include "object.hpp" namespace usata { class SceneLoader { typedef std::queue FileQueueT; typedef std::set LoadedT; typedef std::vector ObjectVector; typedef std::queue RealizeQueue; boost::filesystem::path mScenePath; std::auto_ptr mLoadThread; FileQueueT mFileQueue; RealizeQueue mRealizeQueue; boost::mutex mFileQueueM, mRealizeQueueM; bool mTimeToDie; void thread_main(); void thread_load(const std::string& fn); public: SceneLoader(const boost::filesystem::path&); void update(); void load(const std::string& scene); void unloaded(const std::string&); ~SceneLoader(); }; } #endif