aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-10-22 11:52:29 -0400
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-10-22 11:52:29 -0400
commit19ba40a368b06c38365fe861b6de9403044096a7 (patch)
tree2b062700490bae48d6e756d2138a1e2fd7c37a3b
parentc99d7fb5e5c047709ccd4823e39ccb16c153eecb (diff)
Converted all of the entities to the new texture library
-rw-r--r--include/entities.h2
-rw-r--r--main.cpp2
-rw-r--r--src/entities.cpp23
3 files changed, 9 insertions, 18 deletions
diff --git a/include/entities.h b/include/entities.h
index e71789a..43e744e 100644
--- a/include/entities.h
+++ b/include/entities.h
@@ -58,7 +58,7 @@ public:
char* name;
GENDER gender;
- GLuint texture[3]; //TODO: ADD TEXTURES
+ //GLuint texture[3]; //TODO: ADD TEXTURES
Texturec* tex;
diff --git a/main.cpp b/main.cpp
index 69cad20..373dbea 100644
--- a/main.cpp
+++ b/main.cpp
@@ -659,7 +659,7 @@ void logic(){
* click detection is done as well for NPC/player interaction.
*
*/
- std::cout << "Game Loop: "<< loops << std::endl;
+ //std::cout << "Game Loop: "<< loops << std::endl;
for(int i=0;i<=entity.size();i++){
diff --git a/src/entities.cpp b/src/entities.cpp
index 7a4da65..6d2b58c 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -49,10 +49,7 @@ NPC::NPC(){ //sets all of the NPC specific traits on object creation
alive = true;
canMove = true;
near = false;
- texture[0] = Texture::loadTexture("assets/NPC.png");
- texture[1] = 0;
- texture[2] = 0;
- //tex = new Texturec("assets/NPC.png");
+ tex = new Texturec(1,"assets/NPC.png");
inv = new Inventory(NPC_INV_SIZE);
}
@@ -61,9 +58,7 @@ Structures::Structures(){ //sets the structure type
speed = 0;
alive = true;
near = false;
- texture[0] = Texture::loadTexture("assets/house1.png");
- texture[1] = 0;
- texture[2] = 0;
+ tex = new Texturec(1,"assets/house1.png");
}
Mob::Mob(){
@@ -75,9 +70,7 @@ Mob::Mob(){
alive = true;
canMove = true;
near = false;
- texture[0] = Texture::loadTexture("assets/rabbit.png");
- texture[1] = Texture::loadTexture("assets/rabbit1.png");
- texture[2] = 0;
+ tex = new Texturec(2, "assets/rabbit.png", "assets/rabbit.png1");
inv = new Inventory(NPC_INV_SIZE);
}
@@ -136,18 +129,16 @@ void Entity::draw(void){ //draws the entities
switch(subtype){
case 1: //RABBIT
if(ground == 0){
- glBindTexture(GL_TEXTURE_2D, texture[1]);
+ glBindTexture(GL_TEXTURE_2D, tex->image[1]);
}else if(ground == 1){
- glBindTexture(GL_TEXTURE_2D, texture[0]);
+ glBindTexture(GL_TEXTURE_2D, tex->image[0]);
}
break;
default:
break;
}
- }/*else if(type == NPCT){
- glBindTexture(GL_TEXTURE_2D, tex->image);
- }*/else{
- glBindTexture(GL_TEXTURE_2D,texture[0]);
+ }else{
+ glBindTexture(GL_TEXTURE_2D,tex->image[0]);
}
glColor3ub(255,255,255);
glBegin(GL_QUADS);