forked from imoital/CastleBlast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModelManager.cpp
38 lines (26 loc) · 832 Bytes
/
ModelManager.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// ModelManager.cpp
// Project
//
// Created by Inês on 11/13/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#include "ModelManager.h"
#include "Model.h"
namespace CastleBlast {
ModelManager::ModelManager() : cg::Entity("MODEL_MANAGER") {}
ModelManager::~ModelManager() {}
void ModelManager::init() {}
void ModelManager::newModel(std::string type, const char* filename) {
std::map<std::string, Model*>::iterator model = _models.find(type);
if (model == _models.end()) {
Model* newModel = new Model();
newModel->loadModelData(filename);
_models.insert(std::pair<std::string, Model*>(type, newModel));
}
}
void ModelManager::drawModel(std::string type) {
std::map<std::string, Model*>::iterator model = _models.find(type);
model->second->drawModel();
}
}