Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2007, 5:58:14 PM (16 years ago)
Author:
nicolasc
Message:

added copyright notice
network still need to be done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/loader/LevelLoader.cc

    r507 r513  
     1/*
     2 *   ORXONOX - the hottest 3D action shooter ever to exist
     3 *
     4 *
     5 *   License notice:
     6 *
     7 *   This program is free software; you can redistribute it and/or
     8 *   modify it under the terms of the GNU General Public License
     9 *   as published by the Free Software Foundation; either version 2
     10 *   of the License, or (at your option) any later version.
     11 *
     12 *   This program is distributed in the hope that it will be useful,
     13 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 *   GNU General Public License for more details.
     16 *
     17 *   You should have received a copy of the GNU General Public License
     18 *   along with this program; if not, write to the Free Software
     19 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     20 *
     21 *   Author:
     22 *      ...
     23 *   Co-authors:
     24 *      ...
     25 *
     26 */
     27
    128#include <string>
    229#include <vector>
     
    1946{
    2047        valid_ = false;
    21        
     48
    2249        // Load XML level file
    2350        path.append("/");
    24         path.append(file);     
    25        
     51        path.append(file);
     52
    2653        // Open xml file
    2754        doc.LoadFile(path);
     
    3158        {
    3259                TiXmlHandle hDoc(&doc);
    33                 TiXmlHandle hRoot(0);           
     60                TiXmlHandle hRoot(0);
    3461                TiXmlElement* pElem;
    3562
     
    4673                        if (pElem)
    4774                        {
    48                                 description_ = pElem->GetText();       
     75                                description_ = pElem->GetText();
    4976                        }
    50                        
     77
    5178                        // Set level name
    5279                        name_ = rootElement->Attribute("name");
    5380                        image_ = rootElement->Attribute("image");
    54                        
     81
    5582                        valid_ = true;
    5683                }
     
    5885                {
    5986                        orxonox::Error("Level file has no valid root node");
    60                 }       
     87                }
    6188        }
    6289        else
    6390        {
    6491                orxonox::Error("Could not load level file ");
    65         }       
     92        }
    6693}
    6794
     
    74101                        TiXmlElement* tElem;
    75102                        TiXmlNode* tNode;
    76                        
    77                        
     103
     104
    78105                        // Set loading screen
    79106                        loadElem = rootElement->FirstChildElement("loading");
     
    99126                                showLoadingScreen();
    100127                        }
    101                        
     128
    102129                        // Load audio
    103130                        // TODO
    104                        
     131
    105132                        // Load scripts
    106133                        // TODO
    107                        
     134
    108135                        // Load world
    109136                        worldElem = rootElement->FirstChildElement("world");
    110137                        if (worldElem)
    111                         {       
     138                        {
    112139                                tNode = 0;
    113140                                while( tNode = worldElem->IterateChildren( tNode ) )
     
    116143                                        orxonox::BaseObject* obj = ID(tElem->Value())->fabricate();
    117144                                        obj->loadParams(tElem);
    118                                 }                       
     145                                }
    119146                        }
    120                        
    121                         std::cout << "Loading finished!\n\n\n\n\n";                                             
     147
     148                        std::cout << "Loading finished!\n\n\n\n\n";
    122149                }
    123150        }
    124        
     151
    125152        void LevelLoader::showLoadingScreen()
    126153        {
     
    129156                std::cout << "Backgroundcolor: " << loadingBackgroundColor_ << "\nBackgroundimage:" << loadingBackgroundImage_ << "\n\n\n";
    130157        }
    131        
     158
    132159        LevelLoader::~LevelLoader()
    133160        {
    134161
    135162        }
    136        
    137        
     163
     164
    138165        string LevelLoader::name()
    139166        {
    140167                return this->name_;
    141168        }
    142        
     169
    143170        string LevelLoader::description()
    144171        {
    145172                return this->description_;
    146173        }
    147        
     174
    148175        string LevelLoader::image()
    149176        {
Note: See TracChangeset for help on using the changeset viewer.