20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "heromesh.h"
#include "cursorshapes.h"
#include "keyicons.xbm"
SDL_Surface*screen;
Uint16 picture_size;
int left_margin;
static SDL_Surface*picts;
static Uint8*curpic;
static const unsigned char*fontdata;
static const char default_palette[]=
"C020FF "
|
>
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#include "heromesh.h"
#include "cursorshapes.h"
#include "keyicons.xbm"
SDL_Surface*screen;
Uint16 picture_size;
int left_margin;
Uint32 codepage;
static SDL_Surface*picts;
static Uint8*curpic;
static const unsigned char*fontdata;
static const char default_palette[]=
"C020FF "
|
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
|
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(Uint16 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;
|
|
|
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
|
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;
|
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
|
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';
if(i>65535) s=1;
}
}
if(s || i!=n) goto skip;
i=fgetc(fp)<<16;
i|=fgetc(fp)<<24;
i|=fgetc(fp)<<0;
i|=fgetc(fp)<<8;
|
|
|
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
|
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';
if(i>0x7FFFFF) s=1;
}
}
if(s || i!=n) goto skip;
i=fgetc(fp)<<16;
i|=fgetc(fp)<<24;
i|=fgetc(fp)<<0;
i|=fgetc(fp)<<8;
|
885
886
887
888
889
890
891
892
893
894
895
896
897
898
|
i=fgetc(fp)<<16;
i|=fgetc(fp)<<24;
i|=fgetc(fp)<<0;
i|=fgetc(fp)<<8;
fseek(fp,i,SEEK_CUR);
goto name;
done:
fclose(fp);
}
// Widgets
static void draw_scrollbar(int*cur,int page,int max,int x0,int y0,int x1,int y1) {
Uint8*pix=screen->pixels;
|
>
|
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
|
i=fgetc(fp)<<16;
i|=fgetc(fp)<<24;
i|=fgetc(fp)<<0;
i|=fgetc(fp)<<8;
fseek(fp,i,SEEK_CUR);
goto name;
done:
codepage=n;
fclose(fp);
}
// Widgets
static void draw_scrollbar(int*cur,int page,int max,int x0,int y0,int x1,int y1) {
Uint8*pix=screen->pixels;
|