Index: TODO ================================================================== --- TODO +++ TODO @@ -5,12 +5,10 @@ * Compressed wave sounds (?) * MML sounds * Numeric sounds (?) * Game engine features * Multiple connected objects moving as a unit - * Bizarro world - * Testing the deferred movement * 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 * Coordinate input (may be suitable for some kind of games) @@ -46,5 +44,8 @@ * Warning if file changed when uncommited data exists in the cache database * Composite puzzle set format (in a single file; read-only) * Optional hypertext help * Compressed class definitions (?) * Option to auto display level titles +* Testing + * Bizarro world + * Deferred movement Index: bindings.doc ================================================================== --- bindings.doc +++ bindings.doc @@ -140,10 +140,13 @@ '^u' Add an object with the current MRU values to that location, even if there is already another object of the same class at that location. +'^w' + Swap the normal world with the bizarro world. + 'em' Edit the Misc/Dir of an existing object. 'ex' Export a level (given the operating system command to receive the Index: default.heromeshrc ================================================================== --- default.heromeshrc +++ default.heromeshrc @@ -144,10 +144,11 @@ ?.editKey.down: select 'mR',+1; ?.editKey.C: select 'lc',:level_code where :level_code=cast(:level_code as int); ?.editKey.E: ^s ?.editKey.F: with n(n) as (select 65 union all select n+1 h from n where h<=64*pfheight()+65) select '^a',n from n; ?.editKey.R: select 're',substr(:resize,1,instr(:resize,'x')-1),substr(:resize,instr(:resize,'x')+1) where length(:resize); +?.editKey.W: ^w ?.editKey.ctrl.N: ^N ?.editKey.ctrl.P: ^P ?.editKey.ctrl.X: select 're',pfwidth(),pfheight(); ?.editKey.space: ^c ?.editKey.return: ^e Index: edit.c ================================================================== --- edit.c +++ edit.c @@ -205,10 +205,11 @@ bit3-bit2 = Misc2 type bit1-bit0 = Misc1 type * misc data (variable size) Store/use MRU slot 0 if any bits of 0x70 set in flag byte; slot 1 otherwise */ + Uint32*p=playfield; Uint8 x=0; Uint8 y=1; const Object*m[2]={0,0}; sqlite3_str*str=sqlite3_str_new(0); Uint32 n; @@ -225,20 +226,30 @@ sqlite3_str_appendchar(str,1,pfwidth-1); sqlite3_str_appendchar(str,1,pfheight-1); if(level_title) sqlite3_str_appendall(str,level_title); sqlite3_str_appendchar(str,1,0); // Objects + again: for(i=0;i<64*64;i++) { - n=playfield[i]; + n=p[i]; while(n!=VOIDLINK) { save_obj(str,objects[n],m,x,y); x=objects[n]->x; y=objects[n]->y; n=objects[n]->up; } } save_obj(str,0,m,x,y); + if(p==playfield) { + p=bizplayfield; + for(i=0;i<64*64;i++) if(p[i]!=VOIDLINK) { + sqlite3_str_appendchar(str,1,0xFE); + x=0; + y=1; + goto again; + } + } sqlite3_str_appendchar(str,1,0xFF); // Level strings for(i=0;iclass); if(n==VOIDLINK) return; level_changed=1; + objects[n]->oflags&=~OF_BIZARRO; objects[n]->x=x; objects[n]->y=y; objects[n]->image=m->img; objects[n]->dir=m->dir; objects[n]->misc1=m->misc1; @@ -796,10 +808,11 @@ default: fprintf(fp," ???"); break; } } static void export_level(const char*cmd) { + Uint32*p=playfield; int i; Uint32 n; Object*o; FILE*fp; if(!cmd || !*cmd) return; @@ -809,12 +822,13 @@ return; } fprintf(fp,"; Free Hero Mesh exported level ID=%d ORD=%d\n",level_id,level_ord); fprint_esc(fp,'@',level_title); fprintf(fp,"C %d\nD %d %d\n",level_code,pfwidth,pfheight); + again: for(i=0;i<64*64;i++) { - n=playfield[i]; + n=p[i]; while(n!=VOIDLINK) { o=objects[n]; fprintf(fp,"%d %d $%s %d",o->x,o->y,classes[o->class]->name,o->image); fprint_misc(fp,o->misc1); fprint_misc(fp,o->misc2); @@ -821,10 +835,19 @@ fprint_misc(fp,o->misc3); fprintf(fp," %d\n",o->dir); n=o->up; } } + if(p==playfield) { + p=bizplayfield; + for(i=0;i<64*64;i++) if(p[i]!=VOIDLINK) { + fprintf(fp,"W\n"); + goto again; + } + } else { + fprintf(fp,"W\n"); + } for(i=0;i0xFFFE) return 0; new_level(); return 1; Index: export.doc ================================================================== --- export.doc +++ export.doc @@ -8,10 +8,14 @@ * To export a level, to be parsed by an external program. * To produce by an external program and then import into Free Hero Mesh. * To edit it in a text editor. + +(In the first case, when duplicating the level within the same puzzle set, +you can also just copy the .LVL lump. However, that will not work if you +are copying between puzzle sets.) Each line is one record, and is terminated by a line feed. Everything in this file is case-sensitive. @@ -35,10 +39,14 @@ V version This command never occurs in levels exported from Free Hero Mesh, although it can optionally occur in imported levels. If it is specified, then it sets the level version number. +W + After all objects in the normal world, use this command to start the + objects in the bizarro world; you then need another W at the end. + x y $class image misc1 misc2 misc3 dir Specify an object. Objects are listed starting from the top left corner, going right, and within each cell the objects are listed from bottom to top. Coordinates are one-based. The image is a number (0 for the first image), misc1 to misc3 are misc values (see below), and dir is also a Index: main.c ================================================================== --- main.c +++ main.c @@ -236,11 +236,10 @@ generation_number=TY_MAXTYPE+1; generation_number_inc=0; level_version=p[0]|(p[1]<<8); level_code=p[2]|(p[3]<<8); p+=4; - if(*p&0x80) of=OF_BIZARRO; pfwidth=(*p++&63)+1; pfheight=(*p++&63)+1; while(*p && p=end) goto bad1; @@ -267,13 +266,13 @@ pflink(o); --n; } else { if(p>=end) goto bad1; z=*p++; - if(z==0xFF) { - if(!of) break; - of=0; + if(z==0xFF) break; + if(z==0xFE) { + of^=OF_BIZARRO; goto restart; } if(z&0x20) x=*p++; if(z&0x10) y=*p++; if(z&0x40) x++;