rayzor
annotate src/scene.cc @ 5:5fcf72837b69
fixed the dosemu bit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 06 Apr 2014 02:43:24 +0300 |
parents | a826bf0fb169 |
children | a68dbf80d547 |
rev | line source |
---|---|
nuclear@5 | 1 #include <string.h> |
nuclear@1 | 2 #include "scene.h" |
nuclear@1 | 3 |
nuclear@1 | 4 Scene::Scene() |
nuclear@1 | 5 { |
nuclear@1 | 6 name = 0; |
nuclear@1 | 7 } |
nuclear@1 | 8 |
nuclear@1 | 9 Scene::~Scene() |
nuclear@1 | 10 { |
nuclear@1 | 11 clear(); |
nuclear@1 | 12 } |
nuclear@1 | 13 |
nuclear@1 | 14 void Scene::clear() |
nuclear@1 | 15 { |
nuclear@1 | 16 delete [] name; |
nuclear@1 | 17 |
nuclear@1 | 18 size_t i; |
nuclear@1 | 19 for(i=0; i<objects.size(); i++) { |
nuclear@1 | 20 delete objects[i]; |
nuclear@1 | 21 } |
nuclear@1 | 22 for(i=0; i<lights.size(); i++) { |
nuclear@1 | 23 delete lights[i]; |
nuclear@1 | 24 } |
nuclear@1 | 25 for(i=0; i<cameras.size(); i++) { |
nuclear@1 | 26 delete cameras[i]; |
nuclear@1 | 27 } |
nuclear@1 | 28 } |
nuclear@1 | 29 |
nuclear@1 | 30 void Scene::set_name(const char *name) |
nuclear@1 | 31 { |
nuclear@1 | 32 delete [] this->name; |
nuclear@1 | 33 this->name = new char[strlen(name) + 1]; |
nuclear@1 | 34 strcpy(this->name, name); |
nuclear@1 | 35 } |
nuclear@1 | 36 |
nuclear@1 | 37 const char *Scene::get_name() const |
nuclear@1 | 38 { |
nuclear@1 | 39 return name ? name : "<unknown>"; |
nuclear@1 | 40 } |
nuclear@1 | 41 |
nuclear@1 | 42 void Scene::draw() const |
nuclear@1 | 43 { |
nuclear@1 | 44 } |