1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: Patrick Boenzli |
---|
13 | */ |
---|
14 | |
---|
15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD |
---|
16 | |
---|
17 | #include "multi_player_world.h" |
---|
18 | |
---|
19 | #include "state.h" |
---|
20 | #include "class_list.h" |
---|
21 | |
---|
22 | #include "load_param.h" |
---|
23 | #include "fast_factory.h" |
---|
24 | #include "factory.h" |
---|
25 | |
---|
26 | |
---|
27 | #include "shell_command.h" |
---|
28 | #include "resource_manager.h" |
---|
29 | #include "state.h" |
---|
30 | |
---|
31 | #include "game_loader.h" |
---|
32 | #include "glmenu_imagescreen.h" |
---|
33 | |
---|
34 | #include "p_node.h" |
---|
35 | #include "world_entity.h" |
---|
36 | #include "player.h" |
---|
37 | #include "camera.h" |
---|
38 | #include "environment.h" |
---|
39 | #include "terrain.h" |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | using namespace std; |
---|
45 | |
---|
46 | //! This creates a Factory to fabricate a MultiPlayerWorld |
---|
47 | CREATE_FACTORY(MultiPlayerWorld, CL_MULTI_PLAYER_WORLD); |
---|
48 | |
---|
49 | |
---|
50 | MultiPlayerWorld::MultiPlayerWorld(const TiXmlElement* root) |
---|
51 | : GameWorld(root) |
---|
52 | { |
---|
53 | this->constuctorInit("", -1); |
---|
54 | this->path = NULL; |
---|
55 | |
---|
56 | this->loadParams(root); |
---|
57 | } |
---|
58 | |
---|
59 | |
---|
60 | /** |
---|
61 | * remove the MultiPlayerWorld from memory |
---|
62 | * |
---|
63 | * delete everything explicitly, that isn't contained in the parenting tree! |
---|
64 | * things contained in the tree are deleted automaticaly |
---|
65 | */ |
---|
66 | MultiPlayerWorld::~MultiPlayerWorld () |
---|
67 | { |
---|
68 | PRINTF(3)("MultiPlayerWorld::~MultiPlayerWorld() - deleting current world\n"); |
---|
69 | } |
---|
70 | |
---|
71 | |
---|
72 | /** |
---|
73 | * initializes the world. |
---|
74 | * @param name the name of the world |
---|
75 | * @param worldID the ID of this world |
---|
76 | * |
---|
77 | * set all stuff here that is world generic and does not use to much memory |
---|
78 | * because the real init() function StoryEntity::init() will be called |
---|
79 | * shortly before start of the game. |
---|
80 | * since all worlds are initiated/referenced before they will be started. |
---|
81 | * NO LEVEL LOADING HERE - NEVER! |
---|
82 | */ |
---|
83 | void MultiPlayerWorld::constuctorInit(const char* name, int worldID) |
---|
84 | { |
---|
85 | this->setClassID(CL_MULTI_PLAYER_WORLD, "MultiPlayerWorld"); |
---|
86 | this->setName(name); |
---|
87 | |
---|
88 | this->gameTime = 0.0f; |
---|
89 | this->setSpeed(1.0); |
---|
90 | this->music = NULL; |
---|
91 | this->shell = NULL; |
---|
92 | this->localPlayer = NULL; |
---|
93 | this->localCamera = NULL; |
---|
94 | |
---|
95 | this->showPNodes = false; |
---|
96 | this->showBV = false; |
---|
97 | } |
---|
98 | |
---|
99 | |
---|
100 | /** |
---|
101 | * loads the parameters of a MultiPlayerWorld from an XML-element |
---|
102 | * @param root the XML-element to load from |
---|
103 | */ |
---|
104 | void MultiPlayerWorld::loadParams(const TiXmlElement* root) |
---|
105 | { |
---|
106 | static_cast<GameWorld*>(this)->loadParams(root); |
---|
107 | |
---|
108 | PRINTF(4)("Creating a MultiPlayerWorld\n"); |
---|
109 | } |
---|
110 | |
---|
111 | |
---|
112 | |
---|
113 | |
---|
114 | /** |
---|
115 | * loads the GameWorld by initializing all resources, and set their default values. |
---|
116 | */ |
---|
117 | ErrorMessage MultiPlayerWorld::load() |
---|
118 | {} |
---|