Overview
Comment: | Add saving levels. (Now it is probably ready for public testing.) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
d89808c09a14eeb9955522c75e94f3cb |
User & Date: | user on 2021-02-21 00:43:08 |
Other Links: | manifest | tags |
Context
2021-02-21
| ||
00:51 | Add editor help for objects, and add support for number pad in some more contexts. check-in: 131e9f9ca6 user: user tags: trunk | |
00:43 | Add saving levels. (Now it is probably ready for public testing.) check-in: d89808c09a user: user tags: trunk | |
2021-02-18
| ||
05:06 | Add 'lc' and 'lv' to set level code and level version. check-in: 5439829a5f user: user tags: trunk | |
Changes
Modified bindings.doc from [11b6d55d1e] to [1946559283].
︙ | |||
94 95 96 97 98 99 100 101 102 103 104 105 106 107 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | + + + | 'mx' <command> Export a move list. The argument is a operating system command that will receive the move list (in the same format as above) on stdin. === Editor commands === '^S' Save level. '^a' <location> Add an object with the current MRU values to that location, if there is not already another object of the same class there. '^c' Display the class selection menu. |
︙ |
Modified default.heromeshrc from [b489fce8f4] to [f4fd84468a].
︙ | |||
134 135 136 137 138 139 140 | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | - + + - + | ?.editKey.6: select 'mr',5; ?.editKey.7: select 'mr',6; ?.editKey.8: select 'mr',7; ?.editKey.9: select 'mr',8; ?.editKey.up: select 'mR',-1; ?.editKey.down: select 'mR',+1; ?.editKey.C: select 'lc',:level_code where :level_code=cast(:level_code as int); |
︙ |
Modified edit.c from [5ea8991e9d] to [19de92fbba].
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - + | static void rewrite_class_def(void) { Uint32 i,n; Uint8 cu[0x4000/8]; Uint8 mu[0x4000/8]; Object*o; long size=0; unsigned char*data=read_lump(FIL_LEVEL,LUMP_CLASS_DEF,&size); |
︙ | |||
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } DoMisc(misc1) DoMisc(misc2) DoMisc(misc3) #undef DoMisc } // Now write out the new data s=sqlite3_str_new(0); for(i=0;i<0x4000;i++) if(cu[i/8]&(1<<(i&7))) { sqlite3_str_appendchar(s,1,i&255); sqlite3_str_appendchar(s,1,i>>8); sqlite3_str_appendall(s,classes[i]->name); sqlite3_str_appendchar(s,1,0); } sqlite3_str_appendchar(s,2,0); for(i=0;i<0x4000;i++) if(mu[i/8]&(1<<(i&7))) { sqlite3_str_appendchar(s,1,i&255); sqlite3_str_appendchar(s,1,i>>8); sqlite3_str_appendall(s,messages[i]); sqlite3_str_appendchar(s,1,0); } // End of data size=sqlite3_str_length(s); data=sqlite3_str_finish(s); if(!size || !data) fatal("Error in string builder\n"); write_lump(FIL_LEVEL,LUMP_CLASS_DEF,size,data); |
︙ | |||
131 132 133 134 135 136 137 | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | - + | draw_text(16,16,buf,0xF0,0xFF); snprintf(buf,32,"%5d",level_code); draw_text(0,24,"C",0xF0,0xF7); draw_text(16,24,buf,0xF0,0xFF); } snprintf(buf,8,"%2dx%2d",pfwidth,pfheight); draw_text(8,32,buf,0xF0,0xFD); |
︙ | |||
559 560 561 562 563 564 565 566 567 568 569 570 571 572 | 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 | + + + | if(prev) return prev; add_object_at(number&63?:64,number/64?:64,mru+curmru,0); return 0; case '^P': // Play return -2; case '^Q': // Quit return -1; case '^S': // Save level save_level(); return 1; case 'go': // Select level load_level(number); return 1; case 'lc': // Set level code level_code=number; level_changed=1; return 0; |
︙ |
Modified heromesh.h from [7378f2ea70] to [a29da74068].
︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | + | #define SVALUE(x,y) ((Value){.s=x,.t=y}) #define NVALUE(x) SVALUE(x,TY_NUMBER) #define CVALUE(x) UVALUE(x,TY_CLASS) #define MVALUE(x) UVALUE(x,TY_MESSAGE) #define ZVALUE(x) UVALUE(x,TY_STRING) #define OVALUE(x) ((x)==VOIDLINK?NVALUE(0):UVALUE(x,objects[x]->generation)) #define ValueTo64(v) (((sqlite3_int64)((v).u))|(((sqlite3_int64)((v).t))<<32)) #define ValueEq(x,y) ((x).t==(y).t && (x).u==(y).u) #define N_MESSAGES 24 extern const char*const standard_message_names[]; extern const char*const standard_sound_names[]; extern const char*const heromesh_key_names[256]; extern sqlite3*userdb; |
︙ |
Modified main.c from [310c045da5] to [1f36d14fae].
︙ | |||
129 130 131 132 133 134 135 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | - + | done: sqlite3_finalize(st); return id; } unsigned char*read_lump_or_userstate(int sol,int lvl,long*sz,char us) { // Returns a pointer to the data; must be freed using free(). |
︙ |