- Added windows .exe for version 1.7c

- Fixed bug with { and } commands (unicode support added in v1.7b broke this)
This commit is contained in:
Rob Pearce 2006-01-20 05:45:50 +00:00
parent ef16be4174
commit 31696e0575
3 changed files with 24 additions and 11 deletions

View File

@ -1,4 +1,4 @@
#define VERSION "1.7a" #define VERSION "1.7c"
/* variable sizes */ /* variable sizes */
#define SMALLBUFLEN 64 /* small text buffer */ #define SMALLBUFLEN 64 /* small text buffer */

View File

@ -150,6 +150,7 @@ int autoload = FALSE;
int main (int argc, char **argv) { int main (int argc, char **argv) {
int done; int done;
int c; int c;
int c2;
int mod; int mod;
int tmod; int tmod;
int o; int o;
@ -193,6 +194,8 @@ int main (int argc, char **argv) {
} }
atexit(cleanup); atexit(cleanup);
SDL_EnableUNICODE(1);
if (autoload) { if (autoload) {
loadmap(); loadmap();
@ -1513,7 +1516,8 @@ int main (int argc, char **argv) {
drawscreen(); drawscreen();
break; break;
case SDL_KEYDOWN: case SDL_KEYDOWN:
c = event.key.keysym.sym; c = event.key.keysym.unicode & 0x7F;
c2 = event.key.keysym.sym;
mod = SDL_GetModState(); mod = SDL_GetModState();
/* state independant */ /* state independant */
if (mod & KMOD_SHIFT) { if (mod & KMOD_SHIFT) {
@ -1564,14 +1568,14 @@ int main (int argc, char **argv) {
sprintf(temptext, "%c", c); sprintf(temptext, "%c", c);
strcat(text, temptext); strcat(text, temptext);
updatetextcursor(); updatetextcursor();
} else if (c == SDLK_ESCAPE) { } else if (c2 == SDLK_ESCAPE) {
sprintf(statustext, "Aborted."); sprintf(statustext, "Aborted.");
changestate(S_NONE); changestate(S_NONE);
drawmap(); drawmap();
} else if (c == ' ') { } else if (c == ' ') {
strcat(text, " "); strcat(text, " ");
updatetextcursor(); updatetextcursor();
} else if (c == SDLK_BACKSPACE) { } else if (c2 == SDLK_BACKSPACE) {
text[strlen(text)-1] = '\0'; text[strlen(text)-1] = '\0';
updatetextcursor(); updatetextcursor();
} else if (c == 13) { /* enter */ } else if (c == 13) { /* enter */
@ -1643,7 +1647,7 @@ int main (int argc, char **argv) {
changestate(S_ADDTEXT); changestate(S_ADDTEXT);
} }
} }
if ((c == 'e') || (c == SDLK_F2)) { /* edit current text */ if ((c == 'e') || (c2 == SDLK_F2)) { /* edit current text */
if (state == S_NONE) { if (state == S_NONE) {
if ( (map[curmap].selecteditemtype == T_TEXT) && if ( (map[curmap].selecteditemtype == T_TEXT) &&
(map[curmap].selecteditem != -1) ){ (map[curmap].selecteditem != -1) ){
@ -1807,16 +1811,16 @@ int main (int argc, char **argv) {
drawobox(); drawobox();
} }
} }
if (c == SDLK_BACKSPACE) { if (c2 == SDLK_BACKSPACE) {
goback(); goback();
} }
if (c == SDLK_PAGEUP) { if (c2 == SDLK_PAGEUP) {
scrollobox(-OBOXPAGESIZE); scrollobox(-OBOXPAGESIZE);
} }
if (c == SDLK_PAGEDOWN) { if (c2 == SDLK_PAGEDOWN) {
scrollobox(OBOXPAGESIZE); scrollobox(OBOXPAGESIZE);
} }
if (c == SDLK_DELETE) { if (c2 == SDLK_DELETE) {
if (map[curmap].selecteditem != -1) { if (map[curmap].selecteditem != -1) {
if (map[curmap].selecteditemtype == T_LINKPOINT) { if (map[curmap].selecteditemtype == T_LINKPOINT) {
int i; int i;
@ -1849,7 +1853,7 @@ int main (int argc, char **argv) {
int amt; int amt;
tmod = SDL_GetModState(); tmod = SDL_GetModState();
if ((mod & KMOD_SHIFT)) { if ((tmod & KMOD_SHIFT)) {
amt = (map[curmap].numthings / MULTIRAISENUM); amt = (map[curmap].numthings / MULTIRAISENUM);
} else amt = 1; } else amt = 1;
@ -1860,13 +1864,21 @@ int main (int argc, char **argv) {
int amt; int amt;
tmod = SDL_GetModState(); tmod = SDL_GetModState();
if ((mod & KMOD_SHIFT)) { if ((tmod & KMOD_SHIFT)) {
amt = (map[curmap].numthings / MULTIRAISENUM); amt = (map[curmap].numthings / MULTIRAISENUM);
} else amt = 1; } else amt = 1;
/* lower the selected map[curmap].object */ /* lower the selected map[curmap].object */
lowerselected(amt); lowerselected(amt);
} }
if (c == '{') { /* lower by lots */
int amt = (map[curmap].numthings / MULTIRAISENUM);
lowerselected(amt);
}
if (c == '}') { /* raise by lots */
int amt = (map[curmap].numthings / MULTIRAISENUM);
raiseselected(amt);
}
} }
} }
break; break;
@ -2106,6 +2118,7 @@ void cleanup(void) {
TTF_CloseFont(font[i]); TTF_CloseFont(font[i]);
} }
TTF_Quit(); TTF_Quit();
SDL_EnableUNICODE(0);
SDL_Quit(); SDL_Quit();
} }

Binary file not shown.