1 /***************************************************************************
2  *   Copyright (C) 2004 by Murray Evans                                    *
3  *   m.evans@rdg.ac.uk                                                     *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20 #include "Scene.h"
21 /********************************************************************
22  *								 Dazzle								*
23  *							Basic Scene Class						*
24  *																	*
25  *							   Murray Evans							*
26  ********************************************************************/
27 
CScene(void)28 CScene::CScene(void)
29 {
30 	shadowsEnabled_b = false;
31 	lightsEnabled_b = false;
32 	texturesEnabled_b = false;
33 }
34 
~CScene(void)35 CScene::~CScene(void)
36 {
37 	for(int ec_i = 0; ec_i < ents.Size(); ec_i++)
38 	{
39 		ents[ec_i]->PrepareForDestruction();
40 //		if(ents[ec_i] != NULL) delete(ents[ec_i]);
41 	}
42 	ents.Clear();
43 }
44 
45 // Add an entity to the scene. Return the index of the entity once it has been added
AddEntity(CEntity * in_Entity_p)46 int CScene::AddEntity(CEntity* in_Entity_p)
47 {
48 	ents.AddToEnd(in_Entity_p);
49 	return ents.Size() -1;
50 }
AddLight(CEntity * in_Entity_p)51 int CScene::AddLight(CEntity* in_Entity_p)
52 {
53 	ents.AddToEnd(in_Entity_p);
54 	lights.AddToEnd(ents.Size()-1);
55 	return ents.Size()-1;
56 }
AddMent(CEntity * in_Entity_p)57 int CScene::AddMent(CEntity* in_Entity_p)
58 {
59 	int index;
60 	index = AddEntity(in_Entity_p);
61 	ments.AddToEnd(index);
62 	return index;
63 }
64 
65 // Load the scene from a scenefile, which details all entities that need be loaded, and anything special about them.
LoadFromFile(string in_Filename_s)66 int CScene::LoadFromFile(string in_Filename_s)
67 {
68 	return 0;
69 }
70 
71 // Update the scene
Update(void)72 void CScene::Update(void)
73 {
74 }
75