-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuilding.cpp
53 lines (46 loc) · 1.18 KB
/
building.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "globals.h"
#include "object.h"
#include "building.h"
#include <iostream>
using namespace std;
Building::Building(ModelManager* modelManager,TextureManager* textureManager,int x,int y){
pos.x = x;
pos.y = y;
model = 0;
build_time = 0;
max_hp = 1;
cur_hp = 1;
defense = 20;
cr = .2;
cg = .2;
cb = .8;
}
Building::Building(PointI p){
pos = p;
model = 0;
build_time = 0;
max_hp = 1;
cur_hp = 1;
defense = 20;
cr = .8;
cg = .2;
cb = .2;
}
Building::~Building(){
}
void Building::Update(int ticks, GridMap *gridMap, ModelManager* modelManager){
}
void Building::Draw(ModelManager *modelManager, TextureManager *textureManager){
glPushMatrix();
//glTranslatef(2.5+(float)(TILE_SIZE*size.x)/2.0,0,2.5+(float)(TILE_SIZE*size.y)/2.0);
glTranslatef(TILE_SIZE*pos.x,0,TILE_SIZE*pos.y);
modelManager->DrawModel(model,textureManager,cr,cg,cb,NULL,true); // textured
glPopMatrix();
}
void Building::DrawShadow(ModelManager *modelManager){
glPushMatrix();
//glTranslatef(2.5+(float)(TILE_SIZE*size.x)/2.0,0,2.5+(float)(TILE_SIZE*size.y)/2.0);
glTranslatef(TILE_SIZE*pos.x,0,TILE_SIZE*pos.y);
modelManager->DrawModel(model,NULL,0,0,0,NULL,false); // not textured
glPopMatrix();
}