Free Hero Mesh

Check-in [35acbca9ae]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Add .codepage.ignore option.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 35acbca9aec6e439e2c2e86f074e47dc22d18487
User & Date: user on 2023-01-11 06:11:14
Other Links: manifest | tags
Context
2023-01-14
22:39
Documentation improvements (no code changes). check-in: caee27e331 user: user tags: trunk
2023-01-11
06:11
Add .codepage.ignore option. check-in: 35acbca9ae user: user tags: trunk
2023-01-10
04:10
Mention the GitHub mirror in the README file. check-in: 24de865454 user: user tags: trunk
Changes

Modified config.doc from [a7e06c877f] to [bf5debb8a9].

62
63
64
65
66
67
68






69
70
71
72
73
74
75
  parameters are $LEVEL and $LEVEL_ID. Furthermore, '^E', '^Q', ':s', and
  ':x' are not valid.

.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).







.editTitle
  The window title to use in edit mode. A tilde is replaced by the name of
  the puzzle set.

.gameTitle
  The window title to use in game mode. A tilde is replaced by the name of
  the puzzle set.







>
>
>
>
>
>







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  parameters are $LEVEL and $LEVEL_ID. Furthermore, '^E', '^Q', ':s', and
  ':x' are not valid.

.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
  The window title to use in game mode. A tilde is replaced by the name of
  the puzzle set.

Modified picture.c from [3dfb2527a6] to [de04341ba7].

964
965
966
967
968
969
970








971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
  } else {
    SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,SDL_DEFAULT_REPEAT_INTERVAL);
  }
  SDL_EnableUNICODE(1);
  optionquery[1]=Q_margin;
  left_margin=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"65",0,10);
}









void set_code_page(Uint32 n) {
  int c,i,j,s;
  const char*v;
  unsigned char*d;
  Uint8 b[32];
  FILE*fp;
  if(!n) return;
  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;
    fatal("Cannot load code page %d; code page file is not configured\n",n);
  }
  fp=fopen(v,"r");
  if(!fp) {
    perror(0);
    fatal("Cannot open code page file\n");
  }
  fontdata=d=malloc(0x800);
  if(!d) fatal("Allocation failed\n");
  memcpy(d,pcfont,0x800);
  name:
  s=i=0;
  for(;;) {
    c=fgetc(fp);
    if(c<0) {
      if(n!=437) fatal("Cannot find code page %d\n",n);
      goto done;
    }
    if(!c) break;
    if(!s) {
      if(c<'0' || c>'9') s=1;
      else if(c=='0' && !i) s=1;
      else i=10*i+c-'0';







>
>
>
>
>
>
>
>













|















|







964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
  } else {
    SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,SDL_DEFAULT_REPEAT_INTERVAL);
  }
  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;
  Uint8 b[32];
  FILE*fp;
  if(!n) return;
  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 || 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);
    fatal("Cannot open code page file\n");
  }
  fontdata=d=malloc(0x800);
  if(!d) fatal("Allocation failed\n");
  memcpy(d,pcfont,0x800);
  name:
  s=i=0;
  for(;;) {
    c=fgetc(fp);
    if(c<0) {
      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;
      else if(c=='0' && !i) s=1;
      else i=10*i+c-'0';

Modified quarks from [f8b2d652ef] to [5602e2bd99].

227
228
229
230
231
232
233

234
maxTrigger
pasteCommand
codepage
replaySpeed
autoWin
listMode
listColumns









>

227
228
229
230
231
232
233
234
235
maxTrigger
pasteCommand
codepage
replaySpeed
autoWin
listMode
listColumns
ignore

Modified quarks.h from [bfbb2aaa34] to [5467f6c01b].

190
191
192
193
194
195
196

197
198
199
200
201
202
203
#define Q_maxTrigger 191
#define Q_pasteCommand 192
#define Q_codepage 193
#define Q_replaySpeed 194
#define Q_autoWin 195
#define Q_listMode 196
#define Q_listColumns 197

static const char*const global_quarks[]={
  "screenWidth",
  "screenHeight",
  "margin",
  "palette",
  "popupColors",
  "imageSize",







>







190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#define Q_maxTrigger 191
#define Q_pasteCommand 192
#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",
  "popupColors",
  "imageSize",
387
388
389
390
391
392
393

394
395
396
397
398
399
400
  "maxTrigger",
  "pasteCommand",
  "codepage",
  "replaySpeed",
  "autoWin",
  "listMode",
  "listColumns",

0};
#ifdef HEROMESH_BINDINGS
static const SDLKey quark_to_key[Q_undo+1-Q_backspace]={
SDLK_BACKSPACE,
SDLK_TAB,
SDLK_CLEAR,
SDLK_RETURN,







>







388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
  "maxTrigger",
  "pasteCommand",
  "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,
SDLK_CLEAR,
SDLK_RETURN,