X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGraphic%2FSprite.cpp;h=c775323901c73cc22c58ca5dc8af0b56cdb3d695;hb=6ae42d2d722158cbe08425937a33f65bbf306b59;hp=4276ce5e8cbb18a8fa037162728c8abddf3f7262;hpb=b84825978803615f45a9f128232e62431042aec0;p=lugaru.git diff --git a/Source/Graphic/Sprite.cpp b/Source/Graphic/Sprite.cpp index 4276ce5..c775323 100644 --- a/Source/Graphic/Sprite.cpp +++ b/Source/Graphic/Sprite.cpp @@ -18,9 +18,10 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" -#include "Graphic/Sprite.h" -#include "Objects/Person.h" +#include "Graphic/Sprite.hpp" + +#include "Game.hpp" +#include "Objects/Person.hpp" extern XYZ viewer; extern float viewdistance; @@ -31,7 +32,6 @@ extern Light light; extern float multiplier; extern float gravity; extern Terrain terrain; -extern Objects objects; extern int detail; extern XYZ viewerfacing; extern int bloodtoggle; @@ -245,14 +245,14 @@ void Sprite::Draw() if (distancemult >= 1) glColor4f(sprites[i]->color[0]*lightcolor[0], sprites[i]->color[1]*lightcolor[1], sprites[i]->color[2]*lightcolor[2], 1); else - glColor4f(sprites[i]->color[0]*lightcolor[0], sprites[i]->color[1]*lightcolor[1], sprites[i]->color[2]*lightcolor[2], 1); + glColor4f(sprites[i]->color[0]*lightcolor[0], sprites[i]->color[1]*lightcolor[1], sprites[i]->color[2]*lightcolor[2], distancemult); } } if (sprites[i]->type == splintersprite && (sprites[i]->special == 0 || sprites[i]->special == 3)) { if (distancemult >= 1) glColor4f(sprites[i]->color[0]*lightcolor[0], sprites[i]->color[1]*lightcolor[1], sprites[i]->color[2]*lightcolor[2], 1); else - glColor4f(sprites[i]->color[0]*lightcolor[0], sprites[i]->color[1]*lightcolor[1], sprites[i]->color[2]*lightcolor[2], 1); + glColor4f(sprites[i]->color[0]*lightcolor[0], sprites[i]->color[1]*lightcolor[1], sprites[i]->color[2]*lightcolor[2], distancemult); } glBegin(GL_TRIANGLES); @@ -357,9 +357,9 @@ void Sprite::Draw() start = sprites[i]->oldposition; end = sprites[i]->position; if (!spritehit) - if (objects.model[k].LineCheck(&start, &end, &colpoint, &objects.position[k], &objects.yaw[k]) != -1) { + if (Object::objects[k]->model.LineCheck(&start, &end, &colpoint, &Object::objects[k]->position, &Object::objects[k]->yaw) != -1) { if (detail == 2 || (detail == 1 && abs(Random() % 4) == 0) || (detail == 0 && abs(Random() % 8) == 0)) - objects.model[k].MakeDecal(blooddecalfast, DoRotation(colpoint - objects.position[k], 0, -objects.yaw[k], 0), sprites[i]->size * 1.6, .5, Random() % 360); + Object::objects[k]->model.MakeDecal(blooddecalfast, DoRotation(colpoint - Object::objects[k]->position, 0, -Object::objects[k]->yaw, 0), sprites[i]->size * 1.6, .5, Random() % 360); DeleteSprite(i); spritehit = 1; } @@ -462,19 +462,3 @@ Sprite::Sprite() speed = 0; rotatespeed = 0; } - -void Sprite::clearTextures() -{ - toothtexture.destroy(); - cloudtexture.destroy(); - cloudimpacttexture.destroy(); - bloodtexture.destroy(); - flametexture.destroy(); - bloodflametexture.destroy(); - smoketexture.destroy(); - snowflaketexture.destroy(); - shinetexture.destroy(); - splintertexture.destroy(); - leaftexture.destroy(); -} -