Index: bindings.doc ================================================================== --- bindings.doc +++ bindings.doc @@ -63,10 +63,13 @@ Rewind to mark. '^>' Replay to mark. +'^I' + Toggle the inventory/move-list display. + '^M' Set the replay mark position. '^T' Display the level title popup. Index: class.c ================================================================== --- class.c +++ class.c @@ -42,10 +42,11 @@ const char*messages[0x4000]; Uint16 functions[0x4000]; int max_animation=32; Sint32 max_volume=10000; Uint8 back_color=1; +Uint8 inv_back_color=9; char**stringpool; AnimationSlot anim_slot[8]; #define HASH_SIZE 8888 #define LOCAL_HASH_SIZE 5555 @@ -1613,12 +1614,17 @@ break; case OP_BACKGROUND: nxttok(); if(tokent!=TF_INT) ParseError("Number expected\n"); if(tokenv&~255) ParseError("Background color out of range\n"); - back_color=tokenv; + back_color=inv_back_color=tokenv; nxttok(); + if(tokent==TF_INT) { + if(tokenv&~255) ParseError("Background color out of range\n"); + inv_back_color=tokenv; + nxttok(); + } if(tokent!=TF_CLOSE) ParseError("Expected close parenthesis\n"); break; case OP_ANIMATE: nxttok(); if(tokent!=TF_INT) ParseError("Number expected\n"); Index: class.doc ================================================================== --- class.doc +++ class.doc @@ -192,12 +192,14 @@ These are the global definitions in the class definition file. (Animate ) Set the limit for logical animations, from 1 to 255. The default is 32. -(Background ) - Set the background colour, from 0 to 255. The default value is 1. +(Background []) + Set the background colour, from 0 to 255. The default value is 1. You + can optionally specify a second number, which is the background colour + for the inventory; if not specified, uses the same colour for both. (Synchronize ) Define an animation slot for synchronized animation. The slot number can be 0 to 7, the length is the number of images in the sequence, and the speed is the number of centiseconds between frames. Index: game.c ================================================================== --- game.c +++ game.c @@ -23,10 +23,18 @@ static volatile Uint8 timerflag; static int exam_scroll; static Uint8*inputs; static int inputs_size,inputs_count; +static Uint8 side_mode=255; + +static void setup_game(void) { + const char*v; + optionquery[1]=Q_showInventory; + v=xrm_get_resource(resourcedb,optionquery,optionquery,2)?:""; + side_mode=boolxrm(v,1); +} static void redraw_game(void) { char buf[32]; SDL_Rect r; int x,y; @@ -75,11 +83,34 @@ x=x>=left_margin?(x-left_margin)/picture_size+1:0; y=y/picture_size+1; if(x>0 && y>0 && x<=pfwidth && y<=pfheight) snprintf(buf,8,"(%2d,%2d)",x,y); else strcpy(buf," "); draw_text(0,40,buf,0xF0,0xF1); - SDL_UnlockSurface(screen); + if(side_mode) { + // Inventory + x=20-(left_margin-picture_size)/8; + if(x>19) x=19; + if(x<0) x=0; + for(y=0;y=screen->h) break; + snprintf(buf,22,"%20d",inventory[y].value); + draw_text(picture_size,y*picture_size+52,buf+x,0xF8,0xFE); + } + SDL_UnlockSurface(screen); + r.x=0; r.y=52; r.w=picture_size; r.h=screen->h-52; + SDL_FillRect(screen,&r,inv_back_color); + for(y=0;y=screen->h) break; + if(classes[inventory[y].class]->nimagesimages[inventory[y].image]&0x7FFF); + } + } else { + // Move list + + SDL_UnlockSurface(screen); + + } if(quiz_text) draw_popup(quiz_text); SDL_Flip(screen); set_cursor(XC_arrow); } @@ -442,10 +473,13 @@ inputs_count=0; number=replay_mark-replay_pos; goto replay; case '^E': // Edit return -2; + case '^I': // Toggle inventory display + side_mode^=1; + return prev; case '^M': // Mark replay position replay_mark=replay_pos+inputs_count; return prev; case '^Q': // Quit return -1; @@ -514,10 +548,11 @@ void run_game(void) { int i; SDL_Event ev; set_caption(); + if(side_mode==255) setup_game(); begin_level(level_id); redraw_game(); timerflag=0; SDL_SetTimer(10,timer_callback); while(SDL_WaitEvent(&ev)) { Index: heromesh.h ================================================================== --- heromesh.h +++ heromesh.h @@ -150,11 +150,11 @@ extern Class*classes[0x4000]; // 0 isn't a real class extern const char*messages[0x4000]; // index is 256 less than message number extern Uint16 functions[0x4000]; extern int max_animation; // max steps in animation queue (default 32) extern Sint32 max_volume; // max total volume to allow moving diagonally (default 10000) -extern Uint8 back_color; +extern Uint8 back_color,inv_back_color; extern char**stringpool; extern AnimationSlot anim_slot[8]; Uint16 get_message_ptr(int c,int m); void load_classes(void); Index: quarks ================================================================== --- quarks +++ quarks @@ -213,6 +213,7 @@ tracePrefix stackProtection maxObjects traceAll traceObject +showInventory Index: quarks.h ================================================================== --- quarks.h +++ quarks.h @@ -178,10 +178,11 @@ #define Q_tracePrefix 179 #define Q_stackProtection 180 #define Q_maxObjects 181 #define Q_traceAll 182 #define Q_traceObject 183 +#define Q_showInventory 184 static const char*const global_quarks[]={ "screenWidth", "screenHeight", "margin", "palette", @@ -361,10 +362,11 @@ "tracePrefix", "stackProtection", "maxObjects", "traceAll", "traceObject", + "showInventory", 0}; #ifdef HEROMESH_BINDINGS static const SDLKey quark_to_key[Q_undo+1-Q_backspace]={ SDLK_BACKSPACE, SDLK_TAB,