1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
|
case SDLK_5: case SDLK_KP5: n=10*n+5; break;
case SDLK_6: case SDLK_KP6: n=10*n+6; break;
case SDLK_7: case SDLK_KP7: n=10*n+7; break;
case SDLK_8: case SDLK_KP8: n=10*n+8; break;
case SDLK_9: case SDLK_KP9: n=10*n+9; break;
case SDLK_BACKSPACE: n/=10; break;
case SDLK_ESCAPE: return -1;
case SDLK_RETURN: case SDLK_KP_ENTER: if(n<nlevelstrings) return n;
case SDLK_SPACE: edit_string(levelstrings+n); break;
case SDLK_INSERT:
if(nlevelstrings<0x2000) {
levelstrings=realloc(levelstrings,(nlevelstrings+1)*sizeof(unsigned char*));
if(!levelstrings) fatal("Allocation failed\n");
levelstrings[n=nlevelstrings++]=strdup("");
if(!levelstrings[n]) fatal("Allocation failed\n");
edit_string(levelstrings+n);
|
|
|
|
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
|
case SDLK_5: case SDLK_KP5: n=10*n+5; break;
case SDLK_6: case SDLK_KP6: n=10*n+6; break;
case SDLK_7: case SDLK_KP7: n=10*n+7; break;
case SDLK_8: case SDLK_KP8: n=10*n+8; break;
case SDLK_9: case SDLK_KP9: n=10*n+9; break;
case SDLK_BACKSPACE: n/=10; break;
case SDLK_ESCAPE: return -1;
case SDLK_RETURN: case SDLK_KP_ENTER: if(n<nlevelstrings) return n; break;
case SDLK_SPACE: if(n<nlevelstrings) edit_string(levelstrings+n); break;
case SDLK_INSERT:
if(nlevelstrings<0x2000) {
levelstrings=realloc(levelstrings,(nlevelstrings+1)*sizeof(unsigned char*));
if(!levelstrings) fatal("Allocation failed\n");
levelstrings[n=nlevelstrings++]=strdup("");
if(!levelstrings[n]) fatal("Allocation failed\n");
edit_string(levelstrings+n);
|