Ejemplo n.º 1
0
void dbDisplay(cellC* cell, mapViewC& mapview)
{
 // set some globals...
 battle = cell->Battle;
 dbDD = envIsTrue("debug");	// global
 dbRot = mapview.Rot;

 bool upd = dbTempo();

 for(int i = 0; i < 8; i++)
    dbEscape[i] = !cell->SMAC(i)->CheckBattle(self->Bit);



 // terrain
 mapSweepF normalSweep[] = {
    sweep1,
    sweep2,
    0
 };

 mapSweepF gsSweep[] = {
    sweep1,
    0
 };

 glEnable(GL_DEPTH_TEST);
 glDisable(GL_BLEND);
 glDisable(GL_ALPHA);

 if(gsOff())	mapview.FOVSweep(normalSweep);
 else		mapview.FOVSweep(gsSweep);



 // units
 for(unitC* u = cell->Unit; u; u = u->Next) //if(inBattlefield(u))
 {
    glLoadIdentity();
    glTranslated(u->X, u->Y, .0);

    if(gsOff() && u->IsAlive())
    	if(u->IsSelectedBy(self)) drawSelectionCircle(u);

    glScaled(1, -1, 1);
    glRotated(90, 1, 0, 0);
    glRotated(u->A, 0, 1, 0);
    gsPush(u);
    duStack(u);
 }


 // health bars
 if(gsOff()) for(unitC* u = cell->Unit; u; u = u->Next) //if(inBattlefield(u))
    if(u->IsAlive())
    {
	glLoadIdentity();
	glTranslated(u->X, u->Y, .0);

	glRotated(dbRot+180, 1, 0, 0);
	glScaled(.5,.5,.5);
	duHealth(u);
    }




 // particles
 if(gsOff()) for(particleC* p = battle->ParticlesHook; p; p = p->Next)
 {
    glLoadIdentity();
    glTranslated(p->X, p->Y, p->Z);
    p->Display();
 }


 /* debug to test mapViewC::MapYFromMouseY()
 if(gsOff())
 {
 double y = mapview.MapYFromMouseY();
 glLoadIdentity();
 glDisable(GL_TEXTURE_2D);
 screenLineWidth(3.);
 glColor4d(1,0,0,.8);
 glBegin(GL_LINES);
    glVertex2d(game->Map.W, y);
    glVertex2d(0, y);
    glVertex2d(0, y);
    glVertex2d(game->Map.W, y);
 glEnd();

 glDisable(GL_DEPTH_TEST);
 glColor4d(1,0,0,.15);
 glBegin(GL_LINES);
    glVertex2d(game->Map.W, y);
    glVertex2d(0, y);
    glVertex2d(0, y);
    glVertex2d(game->Map.W, y);
 glEnd();
 }
 */
}
Ejemplo n.º 2
0
void EllipseView::
        draw()
{
    if (visible)
        drawSelectionCircle();
}