Overview
Comment: | Implement CONFIG_NO_STATUS |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
89cc6486f65f15788d7d54998dc3dcb0 |
User & Date: | user on 2022-08-10 05:45:57 |
Other Links: | manifest | tags |
Context
2022-08-11
| ||
04:25 | Implement CONFIG_EXTRA_SCREEN_INIT check-in: 831a8baa13 user: user tags: trunk | |
2022-08-10
| ||
05:45 | Implement CONFIG_NO_STATUS check-in: 89cc6486f6 user: user tags: trunk | |
2022-08-06
| ||
07:47 | Implement CONFIG_OMIT_SOUND check-in: c8c053656e user: user tags: trunk | |
Changes
Modified bindings.c from [59715bfb2c] to [dcc38ad60c].
︙ | |||
116 117 118 119 120 121 122 | 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 | - + - + | static void*cb_1(xrm_db*db,void*usr) { xrm_enumerate(db,cb_2,usr); return 0; } void load_key_bindings(void) { |
︙ |
Modified class.c from [7edc77ca68] to [fe260125ee].
︙ | |||
2558 2559 2560 2561 2562 2563 2564 | 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 | - + | void load_classes(void) { int i; int gloptr=0; Hash*glolocalhash; char*nam=sqlite3_mprintf("%s.class",basefilename); sqlite3_stmt*vst=0; |
︙ | |||
2778 2779 2780 2781 2782 2783 2784 | 2778 2779 2780 2781 2782 2783 2784 2785 2786 | - + | if(macros) for(i=0;i<MAX_MACRO;i++) if(macros[i]) free_macro(macros[i]); free(macros); if(array_size) { array_data=malloc(array_size*sizeof(Value)); if(!array_data) fatal("Array allocation failed\n"); } if(norders) set_class_orders(); |
Modified comconfig.doc from [0c26897a26] to [06f1d3453e].
︙ | |||
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | + + + + | Size of local hash table when reading class definition file. This must be less than 65535. CONFIG_NO_PORTABLE If defined, then portable mode by checking argv[0] is disabled. (It is still possible to use portable mode by HEROMESH_PREFIX) CONFIG_NO_STATUS If defined, then most status output is omitted unless -v is specified. (Some status output, such as most error messages, are still displayed.) CONFIG_OMIT_SOUND If defined, omit all sound capabilities (including music). (Even if it is not defined, it can still be disabled at runtime.) CONFIG_USING_32BIT_TIMESTAMPS If defined, force use of 32-bit timestamps. (This is needed in order to avoid compiler warnings on some systems, such as some versions of the |
︙ | |||
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 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 | + + + + + + + + - + + + + + + + + + + + - + - - - - - + + + + + + + + | === Unimplemented options === The below options are not implemented and are subject to being changed in future when they are implemented. CONFIG_DOUBLE_PRECISION_AUDIO If defined, use double precision for some math calculations in audio processing. Some calculations are not affected by this option. CONFIG_ERROR_CHECKING Define error checking level, where 9 is maximum. Lower numbers might improve speed but may make the program crash in some cases and may also cause security vulnerabilities. CONFIG_EXTRA_SCREEN_INIT Can be a C code to be executed after the video mode is set, but before any other screen initialization is done. CONFIG_LAUNCHER_PATH If defined, then it is the full path to a file to execute if Free Hero Mesh has been invoked with no command-line arguments, or if it is given the flag to run the launcher program instead. CONFIG_MULTIUSER_SCORES (Meant for storing scores on a multiuser system, somehow) CONFIG_OMIT_EDITOR |
︙ | |||
103 104 105 106 107 108 109 110 111 112 113 114 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + + + + + | some parts of the program to improve compatibility.) CONFIG_USING_X86_BMI2 If defined, use PDEP and PEXT instructions. This only works on x86 and only on some processor models. (Apparently this is fast on Intel but slow on AMD, so it should not be used on AMD, even if it is available.) CONFIG_WITH_NETWORK If defined, include code for network/internet access. Even if this is defined, it must still be enabled by the end user; it will not connect to any remote services unless the user explicitly commands it to do so. CONFIG_WITH_VIDEO_RECORDING If defined, then include code to implement video recording, which will override some of the SDL functions (and some other functions), and might make them more slowly even if the video recording is not enabled. |
Modified commandline.doc from [0d7234c266] to [91980e1714].
︙ | |||
127 128 129 130 131 132 133 134 | 127 128 129 130 131 132 133 134 135 136 137 | + + + | not end with a slash, it will be a prefix to the file name too). 3. If argv[0] contains a forward slash, use portable mode; it will use files "current.heromeshrc" and "current.heromeshsession" in the directory where the executable file is allegedly found. 4. Otherwise, home mode is used. Determining portable mode by argv[0] can be disabled at compile-time. Even if it is disabled, HEROMESH_PREFIX environment variable can still be used. |
Modified function.c from [793458f469] to [311098a0c7].
︙ | |||
1714 1715 1716 1717 1718 1719 1720 | 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 | - + | const unsigned char*d; unsigned char*p; int i,j; long n; int txn=sqlite3_get_autocommit(userdb)?sqlite3_exec(userdb,"BEGIN;",0,0,0):1; if(!levels_schema) return SQLITE_CORRUPT_VTAB; if(screen) set_cursor(XC_coffee_mug); |
︙ | |||
1773 1774 1775 1776 1777 1778 1779 | 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 | - + | sqlite3_bind_int(st2,2,level_index[j]); while((i=sqlite3_step(st2))==SQLITE_ROW); if(i!=SQLITE_DONE) goto err; } sqlite3_finalize(st2); sqlite3_exec(userdb,"CREATE UNIQUE INDEX `LEVELS_ORD` ON `LEVELS`(`ORD`) WHERE `ORD` NOT NULL;",0,0,0); if(!txn) sqlite3_exec(userdb,"COMMIT;",0,0,0); |
︙ |
Modified heromesh.h from [8560862773] to [fb2fb6b1fb].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | + + + + + + | /* This file is part of Free Hero Mesh and is public domain. */ #include "comconfig.h" // == main == #ifdef CONFIG_NO_STATUS #define printStatus(...) do{ if(main_options['v']) fprintf(stderr,__VA_ARGS__); }while(0) #else #define printStatus(...) fprintf(stderr,__VA_ARGS__) #endif #define fatal(...) do{ fprintf(stderr,"FATAL: " __VA_ARGS__); exit(1); }while(0) #define boolxrm(a,b) (*a=='1'||*a=='y'||*a=='t'||*a=='Y'||*a=='T'?1:*a=='0'||*a=='n'||*a=='f'||*a=='N'||*a=='F'?0:b) #define TY_NUMBER 0 #define TY_CLASS 1 #define TY_MESSAGE 2 |
︙ |
Modified main.c from [d5598f7687] to [71b6e89339].
︙ | |||
564 565 566 567 568 569 570 | 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | - + - + - + | if(e!=SQLITE_DONE) fatal("SQL error (%d): %s\n",e,sqlite3_errmsg(userdb)); sqlite3_finalize(st); } static void flush_usercache(void) { int e; if(main_options['r']) return; |
︙ | |||
624 625 626 627 628 629 630 | 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 | - + - + | sqlite3_free(p); } if(z=sqlite3_prepare_v3(userdb,"SELECT `OFFSET`, CASE WHEN ?3 THEN `USERSTATE` ELSE `DATA` END " "FROM `USERCACHEDATA` WHERE `FILE` = ?1 AND `LEVEL` = ?2;",-1,SQLITE_PREPARE_PERSISTENT,&readusercachest,0)) { fatal("SQL error (%d): %s\n",z,sqlite3_errmsg(userdb)); } if(z=sqlite3_exec(userdb,"COMMIT;",0,0,0)) fatal("SQL error (%d): %s\n",z,sqlite3_errmsg(userdb)); |
︙ | |||
687 688 689 690 691 692 693 | 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 | - + | free(nam2); free(nam3); if(z=sqlite3_prepare_v3(userdb,"SELECT `OFFSET`, CASE WHEN ?3 THEN `USERSTATE` ELSE `DATA` END " "FROM `USERCACHEDATA` WHERE `FILE` = ?1 AND `LEVEL` = ?2;",-1,SQLITE_PREPARE_PERSISTENT,&readusercachest,0)) { fatal("SQL error (%d): %s\n",z,sqlite3_errmsg(userdb)); } if(z=sqlite3_exec(userdb,"COMMIT;",0,0,0)) fatal("SQL error (%d): %s\n",z,sqlite3_errmsg(userdb)); |
︙ | |||
1089 1090 1091 1092 1093 1094 1095 | 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 | - + | while(argc>optind && argv[optind][0]=='-') { int i; const char*s=argv[optind++]; if(s[1]=='-' && !s[2]) break; for(i=1;s[i];i++) main_options[s[i]&127]=1; } setbuf(stderr,0); |
︙ | |||
1177 1178 1179 1180 1181 1182 1183 | 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 | - + | if(main_options['f']) flush_usercache(); return 0; } else if(main_options['f']) { if(main_options['r']) fatal("Cannot flush user cache; puzzle set is read-only\n"); flush_usercache(); return 0; } |
Modified picedit.c from [583dab5e00] to [e191836d4c].
︙ | |||
209 210 211 212 213 214 215 | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - + | "BEGIN;" "CREATE TEMPORARY TABLE `PICEDIT`(`ID` INTEGER PRIMARY KEY,`NAME` TEXT NOT NULL COLLATE NOCASE,`TYPE` INT,`DATA` BLOB);" "CREATE INDEX `PICEDIT_I1` ON `PICEDIT`(`NAME`,`TYPE`);" ,0,0,0); if(i) fatal("SQL error (%d): %s\n",i,sqlite3_errmsg(userdb)); nam=sqlite3_mprintf("%s.xclass",basefilename); if(!nam) fatal("Allocation failed\n"); |
︙ | |||
255 256 257 258 259 260 261 | 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 287 288 289 | - + - + | if(i!=SQLITE_DONE) fatal("SQL error (%d): %s\n",i,sqlite3_errmsg(userdb)); } done: if(st) sqlite3_finalize(st); if(fp) fclose(fp); free(nam); free(buf); |
︙ | |||
297 298 299 300 301 302 303 | 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | - + | fputc(i>>8,fp); if(i) fwrite(buf,1,i,fp); } if(i!=SQLITE_DONE) fprintf(stderr,"SQL error (%d): %s\n",i,sqlite3_errmsg(userdb)); done: if(st) sqlite3_finalize(st); if(fp) fclose(fp); |
︙ |
Modified picture.c from [292dc50f72] to [e253fa7409].
︙ | |||
774 775 776 777 778 779 780 | 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 | - + | Uint8 altImage; Uint8 havesize1[256]; Uint16 havesize[256]; char*nam=sqlite3_mprintf("%s.xclass",basefilename); const char*v; int i,j,n; if(!nam) fatal("Allocation failed\n"); |
︙ | |||
894 895 896 897 898 899 900 | 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 | - + | } } sqlite3_finalize(st); fclose(fp); SDL_SetColorKey(picts,SDL_SRCCOLORKEY|SDL_RLEACCEL,0); done: if(n=sqlite3_exec(userdb,"COMMIT;",0,0,0)) fatal("SQL error (%d): %s\n",n,sqlite3_errmsg(userdb)); |
︙ |
Modified sound.c from [feb9ba4e2f] to [f2bb0c2e49].
︙ | |||
247 248 249 250 251 252 253 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | - + | if(!v) return; spec.freq=strtol(v,0,10); optionquery[2]=Q_buffer; v=xrm_get_resource(resourcedb,optionquery,optionquery,3); if(!v) return; spec.samples=strtol(v,0,10); if(!spec.freq || !spec.samples) return; |
︙ | |||
283 284 285 286 287 288 289 | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | - + | for(i=0;i<190;i++) mmltuning[i]=f*pow(2.0,(i-96)/24.0); for(i=0;i<64;i++) mmltuning[i+190]=(((long long)(i+2))<<37)/spec.freq; optionquery[2]=Q_mmlTempo; if(v=xrm_get_resource(resourcedb,optionquery,optionquery,3)) i=strtol(v,0,10); else i=120; // Convert quarter notes per minute to samples per sixty-fourth note mmltempo=(spec.freq*60)/(i*16); } |
︙ |