Author Topic: [DONE] Remove dead units from the minimap instantly  (Read 1128 times)

claymore

  • Guest
[DONE] Remove dead units from the minimap instantly
« on: 18 September 2010, 21:44:39 »
...rather than waiting for the corpses to disappear. The minimap gets a bit busy at times and this only adds to the confusion.
« Last Edit: 9 June 2011, 07:35:40 by tomreyn »

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Remove dead units from the minimap instantly
« Reply #1 on: 19 September 2010, 03:12:46 »
Code: [Select]
Index: renderer.cpp
===================================================================
--- renderer.cpp (revision 1012)
+++ renderer.cpp (working copy)
@@ -2167,6 +2167,9 @@
  for(int visibleIndex = 0;
  visibleIndex < qCache.visibleUnitList.size(); ++visibleIndex) {
  Unit *unit = qCache.visibleUnitList[visibleIndex];
+ if (!unit->isAlive()) {
+ continue;
+ }
 
  Vec2i pos= unit->getPos() / Map::cellScale;
  int size= unit->getType()->getSize();
@@ -2190,6 +2193,9 @@
  for(int j=0; j<world->getFaction(i)->getUnitCount(); ++j){
  Unit *unit= world->getFaction(i)->getUnit(j);
  if(world->toRenderUnit(unit)){
+ if (!unit->isAlive()) {
+ continue;
+ }
  Vec2i pos= unit->getPos()/Map::cellScale;
  int size= unit->getType()->getSize();
  Vec3f color=  world->getFaction(i)->getTexture()->getPixmap()->getPixel3f(0, 0);
Glest Advanced Engine - Code Monkey

Timeline | Downloads

claymore

  • Guest
Re: Remove dead units from the minimap instantly
« Reply #2 on: 19 September 2010, 14:06:57 »
Cool, please commit!  :thumbup:

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: Remove dead units from the minimap instantly
« Reply #3 on: 19 September 2010, 18:22:06 »
I didn't tried it yet but it looks good  :)
commit it .
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: Remove dead units from the minimap instantly
« Reply #4 on: 20 September 2010, 23:11:03 »
Cool, he committed it.