Fixed bug drawing construction

This commit is contained in:
jsalmon3 2003-04-18 21:46:41 +00:00
parent 711fc63b0c
commit 6722217556
2 changed files with 6 additions and 5 deletions

View file

@ -69,6 +69,7 @@ local void UpdateConstructionFrame(Unit* unit)
}
if( cframe!=unit->Data.Builded.Frame ) {
unit->Data.Builded.Frame=cframe;
unit->Frame=cframe->Frame;
UnitMarkSeen(unit);
}
}

View file

@ -1733,7 +1733,7 @@ local void DrawUnitPlayerColor(const UnitType* type,int player,int frame,int x,i
** @param x X position.
** @param y Y position.
*/
local void DrawConstruction(const Unit* unit,int x,int y)
local void DrawConstruction(const Unit* unit,int frame,int x,int y)
{
ConstructionFrame* cframe;
@ -1745,14 +1745,14 @@ local void DrawConstruction(const Unit* unit,int x,int y)
x-=construction->Width/2;
y-=construction->Height/2;
GraphicUnitPixels(unit,construction->Sprite);
VideoDrawClip(construction->Sprite,cframe->Frame,x,y);
VideoDrawClip(construction->Sprite,frame,x,y);
} else {
x-=unit->Type->Sprite->Width/2;
y-=unit->Type->Sprite->Height/2;
GraphicUnitPixels(unit,unit->Type->Sprite);
DrawUnitType(unit->Type,cframe->Frame,x,y);
DrawUnitType(unit->Type,frame,x,y);
#ifdef USE_OPENGL
DrawUnitPlayerColor(unit->Type,unit->Player->Player,cframe->Frame,x,y);
DrawUnitPlayerColor(unit->Type,unit->Player->Player,frame,x,y);
#endif
}
}
@ -1821,7 +1821,7 @@ global void DrawBuilding(const Unit* unit)
//
if( state == 1 ) {
if( constructed ) {
DrawConstruction(unit
DrawConstruction(unit,frame
,x+(type->TileWidth*TileSizeX)/2
,y+(type->TileHeight*TileSizeY)/2);
}