2011-08-15 16:11:24 +02:00
|
|
|
#include "creature.h"
|
2011-08-15 21:15:49 +02:00
|
|
|
#include "datmanager.h"
|
2011-08-15 16:11:24 +02:00
|
|
|
#include <framework/graphics/graphics.h>
|
|
|
|
#include <framework/graphics/framebuffer.h>
|
|
|
|
#include "game.h"
|
|
|
|
|
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GL/glu.h>
|
|
|
|
#include <GL/glext.h>
|
|
|
|
|
2011-08-15 23:02:52 +02:00
|
|
|
Creature::Creature() : Thing(THING_CREATURE)
|
2011-08-15 16:11:24 +02:00
|
|
|
{
|
2011-08-15 23:02:52 +02:00
|
|
|
m_healthPercent = 0;
|
|
|
|
m_direction = DIRECTION_SOUTH;
|
2011-08-15 16:11:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Creature::draw(int x, int y)
|
|
|
|
{
|
|
|
|
//ThingAttributes *creatureAttributes = getAttributes();
|
|
|
|
int anim = 0;
|
|
|
|
|
|
|
|
// draw outfit
|
|
|
|
internalDraw(x, y, 0, m_direction, 0, 0, anim);
|
|
|
|
|
|
|
|
// draw addons
|
|
|
|
//for(int a = 0; a < m_outfit.addons; ++a) {
|
|
|
|
//internalDraw(x, y, 0, m_direction, m_outfit.addons & (1 << a), 0, anim);
|
|
|
|
//}
|
|
|
|
//glPushAttrib(GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT);
|
|
|
|
|
|
|
|
//glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA);
|
|
|
|
|
|
|
|
//Color colors[4] = {Color::yellow, Color::red, Color::green, Color::blue};
|
|
|
|
|
|
|
|
//for(int i = 0; i < 4; ++i) {
|
|
|
|
|
|
|
|
|
|
|
|
/*g_graphics.bindColor(colors[i]);
|
|
|
|
internalDraw(creatureAttributes->width*32 - 32, creatureAttributes->height*32 - 32, 1, m_direction, 0, 0, 0);
|
|
|
|
framebuffer.unbind();
|
|
|
|
|
|
|
|
|
|
|
|
g_graphics.bindColor(Color::green);*/
|
|
|
|
//framebuffer.draw(x, y, creatureAttributes->width*32, creatureAttributes->height*32);
|
|
|
|
//}
|
|
|
|
//glPopAttrib();
|
|
|
|
}
|
2011-08-15 23:02:52 +02:00
|
|
|
|
|
|
|
const ThingAttributes& Creature::getAttributes()
|
|
|
|
{
|
|
|
|
return g_dat.getCreatureAttributes(m_outfit.type);
|
|
|
|
}
|