- VideoDrawNumber(50000) prints 50,000 now

- Fixed `Wood: NN%' for peons chopping wood (info panel)
This commit is contained in:
cade 2002-03-03 11:29:17 +00:00
parent 6f458deab0
commit 77c89302fe
4 changed files with 25 additions and 10 deletions

View file

@ -9,3 +9,4 @@ srcdoc
.depend
.gdbinit
obj
freeceaft.vpj

View file

@ -20,8 +20,12 @@ CCL = -DUSE_CCL
CCLLIB = -lm
# Video support
VIDEO = -DUSE_X11
VIDEOLIB = -lXext -lX11 -ldl
SDL = -DUSE_SDL -DUSE_SDLA $(SDL_CFLAGS)
SDL_CFLAGS = $(shell sdl-config --cflags)
SDLLIB = $(shell sdl-config --libs)
VIDEO = $(SDL)
VIDEOLIB = $(SDLLIB) -ldl
# Sound support
DSOUND = -DWITH_SOUND
@ -54,11 +58,10 @@ OBJDIR=obj/
#ARCHOBJS=stdmman.$(OE) svgalib.$(OE) unix_lib.$(OE) bitm_lnx.$(OE)
IFLAGS= -I$(TOPDIR)/src/include $(XIFLAGS)
DEBUG= -DDEBUG #-DFLAG_DEBUG
DFLAGS= $(THREAD) $(CCL) $(VERSION) \
$(VIDEO) $(ZDEFS) $(DSOUND) \
$(DEBUG) -DHAVE_EXPANSION
CFLAGS=-g -O1 -Wall -Werror $(IFLAGS) $(DFLAGS) -DUNIT_ON_MAP -DNEW_AI -DUSE_LIBMODPLUG -DUSE_HP_FOR_XP
CFLAGS=-O2 -pipe -fomit-frame-pointer -fconserve-space -fexpensive-optimizations -ffast-math $(IFLAGS) $(DFLAGS) -DUNIT_ON_MAP -DNEW_AI -DUSE_LIBMODPLUG -DUSE_HP_FOR_XP
CTAGSFLAGS=-i defptvS -a -f
# Locks versions with a symbolic name

View file

@ -487,9 +487,9 @@ global void DrawUnitInfo(const Unit* unit)
// Show how much wood is harvested already in percents! :) //vladi
// FIXME: Make this optional
if( unit->Orders[0].Action==UnitActionHarvest && unit->SubAction==64 ) {
sprintf(buf,"W%%:%d"
sprintf(buf,"Wood: %d%%"
,(100*(CHOP_FOR_WOOD-unit->Value))/CHOP_FOR_WOOD);
VideoDrawText(x+120,y+8+140,GameFont,buf);
VideoDrawText(x+63,y+8+141,GameFont,buf);
}
}

View file

@ -492,10 +492,21 @@ global int VideoDrawTextCentered(int x,int y,unsigned font,const unsigned char*
*/
global int VideoDrawNumber(int x,int y,unsigned font,int number)
{
char buf[sizeof(int)*10+2];
sprintf(buf,"%d",number);
return VideoDrawText(x,y,font,buf);
//char buf[sizeof(int)*10+2];
//sprintf(buf,"%d",number);
char bufs[16];
char bufd[16];
int sl, s, d;
sl = s = d = 0;
sprintf(bufs,"%d",number);
sl = strlen( bufs );
while(4)
{
if( s > 0 && s < sl && (s - (sl % 3)) % 3 == 0 ) bufd[d++] = ',';
bufd[d++] = bufs[s++];
if ( s > sl ) break;
}
return VideoDrawText(x,y,font,bufd);
}
/**