Index: config.doc ================================================================== --- config.doc +++ config.doc @@ -64,10 +64,16 @@ .codepage The path to the code page file. If not specified, then code pages other than 437 are not available (code page 437 is built-in). +.codepage.ignore + If true, then ignore any errors loading code pages that cannot be found. + This does not affect the behaviour of the game but may result in text + being displayed incorrectly. If false (the default setting), then it is + an error if a puzzle set specifies a code page that is not available. + .editTitle The window title to use in edit mode. A tilde is replaced by the name of the puzzle set. .gameTitle Index: picture.c ================================================================== --- picture.c +++ picture.c @@ -966,10 +966,18 @@ } SDL_EnableUNICODE(1); optionquery[1]=Q_margin; left_margin=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"65",0,10); } + +static int ignore_code_page(void) { + const char*v; + optionquery[1]=Q_codepage; + optionquery[2]=Q_ignore; + v=xrm_get_resource(resourcedb,optionquery,optionquery,3)?:""; + return boolxrm(v,0); +} void set_code_page(Uint32 n) { int c,i,j,s; const char*v; unsigned char*d; @@ -979,11 +987,11 @@ if(n==367) n=437; if(fontdata && fontdata!=pcfont) fatal("Multiple code page specifications\n"); optionquery[1]=Q_codepage; v=xrm_get_resource(resourcedb,optionquery,optionquery,2); if(!v || !*v) { - if(n==437) return; + if(n==437 || ignore_code_page()) return; fatal("Cannot load code page %d; code page file is not configured\n",n); } fp=fopen(v,"r"); if(!fp) { perror(0); @@ -995,11 +1003,11 @@ name: s=i=0; for(;;) { c=fgetc(fp); if(c<0) { - if(n!=437) fatal("Cannot find code page %d\n",n); + if(n!=437 && !ignore_code_page()) fatal("Cannot find code page %d\n",n); goto done; } if(!c) break; if(!s) { if(c<'0' || c>'9') s=1; Index: quarks ================================================================== --- quarks +++ quarks @@ -229,6 +229,7 @@ codepage replaySpeed autoWin listMode listColumns +ignore Index: quarks.h ================================================================== --- quarks.h +++ quarks.h @@ -192,10 +192,11 @@ #define Q_codepage 193 #define Q_replaySpeed 194 #define Q_autoWin 195 #define Q_listMode 196 #define Q_listColumns 197 +#define Q_ignore 198 static const char*const global_quarks[]={ "screenWidth", "screenHeight", "margin", "palette", @@ -389,10 +390,11 @@ "codepage", "replaySpeed", "autoWin", "listMode", "listColumns", + "ignore", 0}; #ifdef HEROMESH_BINDINGS static const SDLKey quark_to_key[Q_undo+1-Q_backspace]={ SDLK_BACKSPACE, SDLK_TAB,