Index: TODO ================================================================== --- TODO +++ TODO @@ -6,11 +6,11 @@ * Numeric sounds (?) * Game engine features * Multiple connected objects moving as a unit * Bizarro world * Testing the deferred movement - * String data (?) + * String data * A ,PopUp command to use a popup with arguments starting from a mark * "Goto message" instruction (?) * Returning a class from COLLIDE/COLLIDEBY to transform * Editor * Mouse dragging Index: class.c ================================================================== --- class.c +++ class.c @@ -201,10 +201,11 @@ } else switch(c=fgetc(classfp)) { case '"': case '\\': tokenstr[i++]=c; break; case '0' ... '7': tokenstr[i++]=c+1-'0'; break; case 'b': tokenstr[i++]=15; break; case 'c': tokenstr[i++]=12; break; + case 'd': tokenstr[i++]=30; isimg=1; break; case 'i': tokenstr[i++]=14; isimg=1; break; case 'l': tokenstr[i++]=11; break; case 'n': tokenstr[i++]=10; break; case 'q': tokenstr[i++]=16; break; case 'x': Index: class.doc ================================================================== --- class.doc +++ class.doc @@ -80,10 +80,16 @@ Draws a horizontal rule. \c Makes further text centred. +\dDATA\ + Includes inline data in the string. The data is not displayed, but + can be read by class codes, or used in level titles to provide data + and delimieters for the auto-generated table of contents. Data items + are separated by semicolons. (Not fully implemented yet) + \iCLASS:NUMBER\ Displays a picture. Give the class name (without $ at first) and a colon and the zero-based index number of the picture in that class. This is then followed by another backslash. The picture may span multiple lines; it will automatically move the text to make room. Index: edit.c ================================================================== --- edit.c +++ edit.c @@ -751,10 +751,11 @@ case 11: fprintf(fp,"\\l"); break; case 12: fprintf(fp,"\\c"); break; case 14: fprintf(fp,"\\i"); isimg=1; break; case 15: fprintf(fp,"\\b"); break; case 16: fprintf(fp,"\\q"); break; + case 30: fprintf(fp,"\\d"); isimg=1; break; case 31: if(!*t) break; fprintf(fp,"\\x%02X",*t++); break; case 32 ... 127: @@ -887,10 +888,11 @@ } else { switch(*p) { case '0' ... '7': *q++=*p+1-'0'; break; case 'b': *q++=15; break; case 'c': *q++=12; break; + case 'd': *q++=30; isimg=1; break; case 'i': *q++=14; isimg=1; break; case 'l': *q++=11; break; case 'n': *q++=10; break; case 'q': *q++=16; break; case 'x': @@ -1152,11 +1154,11 @@ snprintf(buf,19," String %d: ",(int)(ps-levelstrings)); draw_text(0,16,buf,0xF9,0xFF); } draw_text(160,16,o?"OVR":"INS",0xF1,0xFE); draw_text(0,0," Cancel Preview Save <\x18\x19\x1A\x1B> MoveCursor <^P> InsertChar <^Y> DelLine",0xF1,0xFB); - draw_text(0,8,"ALT+ <0-7> Color Bar Center Image Left Quiz",0xF1,0xFB); + draw_text(0,8,"ALT+ <0-7> Color Bar Center Data Image Left Quiz",0xF1,0xFB); draw_text(0,24,"\x10",0xF0,0xF1); cp=0; for(i=j=n=0;s[i] && n<63;) { draw_text(0,(n+3)<<3,"\x10",0xF0,0xF1); i+=draw_text_line(8,(n+3)<<3,s+i,r==n?c:-1,&cp); @@ -1239,10 +1241,11 @@ case SDLK_5: i=6; goto addch; case SDLK_6: i=7; goto addch; case SDLK_7: i=8; goto addch; case SDLK_b: i=15; goto addch; case SDLK_c: i=12; goto addch; + case SDLK_d: i=30; goto addch; case SDLK_i: i=14; goto addch; case SDLK_l: i=11; goto addch; case SDLK_n: i=10; goto addch; case SDLK_q: i=16; goto addch; } Index: function.c ================================================================== --- function.c +++ function.c @@ -140,10 +140,11 @@ case 11: e[en++]='\\'; e[en++]='l'; break; case 12: e[en++]='\\'; e[en++]='c'; break; case 14: e[en++]='\\'; e[en++]='i'; isimg=1; break; case 15: e[en++]='\\'; e[en++]='b'; break; case 16: e[en++]='\\'; e[en++]='q'; break; + case 30: e[en++]='\\'; e[en++]='d'; isimg=1; break; case 31: if(i==un) break; c=u[i++]; e[en++]='\\'; e[en++]='x'; @@ -209,10 +210,11 @@ isimg=0; } else switch(c=*e++) { case '0' ... '7': u[un++]=c-'0'+1; break; case 'b': u[un++]=15; break; case 'c': u[un++]=12; break; + case 'd': u[un++]=30; isimg=1; break; case 'i': u[un++]=14; isimg=1; break; case 'l': u[un++]=11; break; case 'n': u[un++]=10; break; case 'q': u[un++]=16; break; case 'x': Index: picture.c ================================================================== --- picture.c +++ picture.c @@ -161,12 +161,12 @@ } else if(!*t) { f=fontdata+(254<<3); bg=0xF0,fg=0xF1; e=1; } else if(*t<31) { - f=fontdata+(" 01234567?NLC#IBQ???????????????"[*t]<<3); - if(*t==14) isimg=1; + f=fontdata+(" 01234567?NLC#IBQ?????????????D?"[*t]<<3); + if(*t==14 || *t==30) isimg=1; bg=0xF3,fg=0xF0; } else { if(*t==31 && t[1]) t++; f=fontdata+(*t<<3); bg=0xF0,fg=isimg?0xF2:0xF7; @@ -1083,10 +1083,14 @@ case 16: lw+=24; if(lh<16) lh=16; if(*p) p++; break; + case 30: + p=strchr(p,'\\')?:""; + if(*p) p++; + break; case 31: lw+=8; if(*p) p++; break; default: @@ -1155,10 +1159,14 @@ case 16: pop_quiz(x,y,li+ln,c,*p); if(*p) p++; x+=24; break; + case 30: + p=strchr(p,'\\')?:""; + if(*p) p++; + break; case 31: pop_char(x,y,li+ln,c,*p); if(*p) p++; x+=8; break;