X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameTick.cpp;h=ebf1175342ce52f5f383563c7668e8bfca5bf29e;hb=e60cbd7add6123d81b3c35543296449b5d02cbaa;hp=85224889b81343609ea219d2bd42d5a9cecd7aa5;hpb=a8d3adab262e66f609fa9b0a18d47cf27a0e65f0;p=lugaru.git diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 8522488..ebf1175 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -102,7 +102,7 @@ extern float envsoundlife[30]; extern float usermousesensitivity; extern bool ismotionblur; extern bool showdamagebar; // (des)activate the damage bar -extern bool decals; +extern bool decalstoggle; extern bool skyboxtexture; extern float skyboxr; extern float skyboxg; @@ -606,7 +606,7 @@ void Game::Loadlevel(const std::string& name, bool tutorial) } if (!stealthloading) { - terrain.numdecals = 0; + terrain.decals.clear(); Sprite::deleteSprites(); for (int i = 0; i < subdivision; i++) { @@ -2458,12 +2458,7 @@ void doAttacks() Person::players[i]->skeleton.free && Person::players[i]->skeleton.longdead > 1000) { Person::players[k]->animTarget = killanim; - //TODO: refactor this out, what does it do? - for (int j = 0; j < terrain.numdecals; j++) { - if ((terrain.decaltype[j] == blooddecal || terrain.decaltype[j] == blooddecalslow) && - terrain.decalalivetime[j] < 2) - terrain.DeleteDecal(j); - } + terrain.deleteDeadDecals(); for (unsigned int l = 0; l < Object::objects.size(); l++) { if (Object::objects[l]->model.type == decalstype) for (int j = 0; j < Object::objects[l]->model.numdecals; j++) { @@ -2484,12 +2479,7 @@ void doAttacks() Person::players[i]->skeleton.free) && (!Person::players[i]->dead || musictype != stream_fighttheme)) { Person::players[k]->animTarget = dropkickanim; - for (int j = 0; j < terrain.numdecals; j++) { - if ((terrain.decaltype[j] == blooddecal || terrain.decaltype[j] == blooddecalslow) && - terrain.decalalivetime[j] < 2) { - terrain.DeleteDecal(j); - } - } + terrain.deleteDeadDecals(); for (unsigned int l = 0; l < Object::objects.size(); l++) { if (Object::objects[l]->model.type == decalstype) for (int j = 0; j < Object::objects[l]->model.numdecals; j++) {