Index: exec.c ================================================================== --- exec.c +++ exec.c @@ -32,10 +32,12 @@ Uint8 generation_number_inc; Uint32 move_number; unsigned char*quiz_text; Inventory*inventory; Uint32 ninventory; +char**levelstrings; +Uint16 nlevelstrings; typedef struct { Uint16 msg; Uint32 from; Value arg1,arg2,arg3; @@ -69,11 +71,11 @@ static const Sint8 y_delta[8]={0,-1,-1,-1,0,1,1,1}; const char*value_string_ptr(Value v) { switch(v.t) { case TY_STRING: return stringpool[v.u]; - //TODO: Level strings + case TY_LEVELSTRING: return v.u"; default: fatal("Internal confusion: Trying to get string pointer for a non-string\n"); } } void pfunlink(Uint32 n) { @@ -1558,10 +1560,12 @@ nobjects=0; free(objects); objects=0; gameover=0; clear_inventory(); + for(i=0;ianim; Index: heromesh.h ================================================================== --- heromesh.h +++ heromesh.h @@ -235,10 +235,12 @@ extern Uint8 generation_number_inc; extern Uint32 move_number; extern unsigned char*quiz_text; extern Inventory*inventory; extern Uint32 ninventory; +extern char**levelstrings; +extern Uint16 nlevelstrings; const char*value_string_ptr(Value v); void pfunlink(Uint32 n); void pflink(Uint32 n); Uint32 objalloc(Uint16 c); Index: main.c ================================================================== --- main.c +++ main.c @@ -198,10 +198,11 @@ // Load level by ID. Returns null pointer if successful, or an error message if it failed. long sz=0; unsigned char*buf=lvl>=0?read_lump(FIL_LEVEL,lvl,&sz,0):0; unsigned char*p=buf; unsigned char*end=buf+sz; + unsigned char*q; int i,n,x,y,z; Uint16 lo=0; Uint32 o; Uint32 mru[2]; if(lvl<0 && level_index && -lvl<=level_nindex) { @@ -310,11 +311,24 @@ pflink(o); n=0; } } } - // skip level strings for now + // Level strings + i=0; + while(p=max_objects) goto bad3; + q=memchr(p,0,end-p); + if(!q) goto bad1; + levelstrings=realloc(levelstrings,(i+1)*sizeof(char*)); + if(!levelstrings) fatal("Allocation failed\n"); + levelstrings[i]=strdup(p); + if(!levelstrings[i]) fatal("Allocation failed\n"); + p=q+1; + i++; + } + nlevelstrings=i; if(p>end) goto bad1; free(buf); level_id=lvl; level_ord=lo; if(level_index && !lo) { Index: picture.c ================================================================== --- picture.c +++ picture.c @@ -606,11 +606,27 @@ } SDL_LockSurface(screen); } static void pop_quiz(int x,int y,PopLine*li,Uint8 c,Uint8 v) { - + SDL_Rect r; + Uint8*p=screen->pixels; + Uint16 pitch=screen->pitch; + int xx,yy; + const unsigned char*f=fontdata+(v<<3); + if(li->h>16) y+=(li->h-16)/2; + r.x=x; + r.y=y; + r.w=r.h=16; + SDL_FillRect(screen,&r,0x07); + if(y+16>=screen->h || x+24>=screen->w) return; + p+=(y+4)*pitch+x+4; + for(yy=0;yy<8;yy++) { + for(xx=0;xx<8;xx++) p[xx]=(*f<