Overview
Comment: | Split picture reading codes into a separate file |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
016ea5365e4ce59c21ddf976994712c1 |
User & Date: | user on 2018-04-02 18:22:32 |
Other Links: | manifest | tags |
Context
2018-04-02
| ||
23:54 | Fix a mistake check-in: 1e31248216 user: user tags: trunk | |
18:22 | Split picture reading codes into a separate file check-in: 016ea5365e user: user tags: trunk | |
2018-03-31
| ||
02:14 | Add key bindings and some other stuff check-in: c1ad4ad8cc user: user tags: trunk | |
Changes
Added heromesh.h version [81301118dc].
|
Modified main.c from [ab2178c197] to [d2f05c125d].
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + + - + | #if 0 |
︙ | |||
41 42 43 44 45 46 47 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | - + - - + - - + + + + - - - + + | static const char schema[]= "PRAGMA APPLICATION_ID(1296388936);" "PRAGMA RECURSIVE_TRIGGERS(1);" "CREATE TABLE IF NOT EXISTS `USERCACHEINDEX`(`ID` INTEGER PRIMARY KEY, `NAME` TEXT, `LVLTIME` INT, `SOLTIME` INT, `VERSION` INT);" "CREATE TEMPORARY TABLE `PICTURES`(`ID` INTEGER PRIMARY KEY, `NAME` TEXT, `OFFSET` INT);" ; |
︙ | |||
128 129 130 131 132 133 134 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | } if(sqlite3_exec(userdb,schema,0,0,&s)) fatal("Failed to initialize database schema (%s)\n",s?:"unknown error"); optionquery[1]=Q_sqlInit; v=xrm_get_resource(resourcedb,optionquery,optionquery,2); if(v && sqlite3_exec(userdb,v,0,0,&s)) fatal("Failed to execute user-defined SQL statements (%s)\n",s?:"unknown error"); } |
︙ | |||
324 325 326 327 328 329 330 331 332 333 334 335 336 337 | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | + + + + + + | #define SetKeyBinding(n,m) do { \ optionquery[1]=Q_editKey; \ if(s=xrm_get_resource(resourcedb,optionquery,optionquery,n)) set_key_binding(editor_bindings+quark_to_key[q-FirstKeyQuark],m,s); \ optionquery[1]=Q_gameKey; \ if(s=xrm_get_resource(resourcedb,optionquery,optionquery,n)) set_key_binding(game_bindings+quark_to_key[q-FirstKeyQuark],m,s); \ } while(0) #define SetMouseBinding(o,n,m) do { \ optionquery[1]=Q_editClick; \ if(s=xrm_get_resource(resourcedb,optionquery,optionquery,n)) set_key_binding(editor_mouse_bindings+o,m,s); \ optionquery[1]=Q_gameClick; \ if(s=xrm_get_resource(resourcedb,optionquery,optionquery,n)) set_key_binding(game_mouse_bindings+o,m,s); \ } while(0) static void load_key_bindings(void) { xrm_quark q; const char*s; for(q=FirstKeyQuark;q<=LastKeyQuark;q++) { optionquery[2]=optionquery[3]=optionquery[4]=q; SetKeyBinding(3,0); optionquery[2]=Q_shift; |
︙ | |||
351 352 353 354 355 356 357 358 359 360 361 362 363 364 | 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | SetKeyBinding(5,MOD_ALT|MOD_SHIFT); optionquery[2]=Q_ctrl; SetKeyBinding(5,MOD_CTRL|MOD_SHIFT); optionquery[2]=Q_meta; SetKeyBinding(5,MOD_META|MOD_SHIFT); #endif } optionquery[2]=optionquery[3]=Q_left; SetMouseBinding(SDL_BUTTON_LEFT,3,0); optionquery[2]=Q_shift; SetMouseBinding(SDL_BUTTON_LEFT,4,MOD_SHIFT); optionquery[2]=Q_ctrl; SetMouseBinding(SDL_BUTTON_LEFT,4,MOD_CTRL); optionquery[2]=Q_alt; SetMouseBinding(SDL_BUTTON_LEFT,4,MOD_ALT); optionquery[2]=Q_meta; SetMouseBinding(SDL_BUTTON_LEFT,4,MOD_META); optionquery[2]=optionquery[3]=Q_middle; SetMouseBinding(SDL_BUTTON_MIDDLE,3,0); optionquery[2]=Q_shift; SetMouseBinding(SDL_BUTTON_MIDDLE,4,MOD_SHIFT); optionquery[2]=Q_ctrl; SetMouseBinding(SDL_BUTTON_MIDDLE,4,MOD_CTRL); optionquery[2]=Q_alt; SetMouseBinding(SDL_BUTTON_MIDDLE,4,MOD_ALT); optionquery[2]=Q_meta; SetMouseBinding(SDL_BUTTON_MIDDLE,4,MOD_META); optionquery[2]=optionquery[3]=Q_right; SetMouseBinding(SDL_BUTTON_RIGHT,3,0); optionquery[2]=Q_shift; SetMouseBinding(SDL_BUTTON_RIGHT,4,MOD_SHIFT); optionquery[2]=Q_ctrl; SetMouseBinding(SDL_BUTTON_RIGHT,4,MOD_CTRL); optionquery[2]=Q_alt; SetMouseBinding(SDL_BUTTON_RIGHT,4,MOD_ALT); optionquery[2]=Q_meta; SetMouseBinding(SDL_BUTTON_RIGHT,4,MOD_META); } int main(int argc,char**argv) { if(argc<2) fatal("usage: %s basename [options...]\n",argc?argv[0]:"heromesh"); if(xrm_init(realloc)) fatal("Failed to initialize resource manager\n"); if(xrm_init_quarks(global_quarks)) fatal("Failed to initialize resource manager\n"); resourcedb=xrm_create(); |
︙ |
Added picture.c version [55b874cfd0].