static int myminchar(SFONT *s){ return 32;}
static int mymaxchar(SFONT *s){ return 126;}
static int myhasglyph(SFONT *s, word c, int allowdef)
- { if (c >= 32 && c <= 126) return 1; if (allowdef) return 1;}
+{
+ return (c >= 32 && c <= 126) || allowdef;
+}
static SF_glyph * mygetglyph(SFONT *s, word c, int allowdef)
{
byte *src;
void sf_initfonts()
{
int i, j, size=0;
- int w,h,nby,m,nocc;
byte *cfont, *bmp; SF_glyph *g;
- SF_bdffont *b, *norm, *emph, *bold, *bemp;
+ SF_bdffont *norm, *emph, *bold, *bemp;
SFONT *Norm, *Emph=NULL, *Bold=NULL, *Bemp=NULL;
norm = SF_defaultfont;
// emphasize (underline)...
cfont = (byte *)emph;
for (i = norm->minchar;i <= norm->maxchar;i++){
- m = norm->glyphs[i-norm->minchar];
+ int m = norm->glyphs[i-norm->minchar];
if (!m) continue;
g = (SF_glyph *)(cfont + m);
- w = g->dx;
- h = g->h; nby = (g->w+7)/8;
bmp = (byte *)(&(g->bitmap[0]));
- bmp[h-2] = 0xff;
+ bmp[g->h - 2] = 0xff;
}
// make a copy for bold
bold = malloc(size);
// boldify...
cfont = (byte *)bold;
for (i = norm->minchar;i <= norm->maxchar;i++){
- int c;
- m = norm->glyphs[i-norm->minchar];
+ int h, m = norm->glyphs[i-norm->minchar];
if (!m) continue;
g = (SF_glyph *)(cfont + m);
- w = g->dx;
- h = g->h; nby = (g->w+7)/8;
+ h = g->h;
bmp = (byte *)(&(g->bitmap[0]));
for (j=0;j<h;j++){
- c = bmp[j];
+ int c = bmp[j];
bmp[j] = (c) | (c >> 1);
}
}
// emphasize (underline)...
cfont = (byte *)bemp;
for (i = norm->minchar;i <= norm->maxchar;i++){
- m = norm->glyphs[i-norm->minchar];
+ int m = norm->glyphs[i-norm->minchar];
if (!m) continue;
g = (SF_glyph *)(cfont + m);
- w = g->dx;
- h = g->h; nby = (g->w+7)/8;
bmp = (byte *)(&(g->bitmap[0]));
- bmp[h-2] = 0xff;
+ bmp[g->h - 2] = 0xff;
}
myfonts[0] = myfonts[4] = Norm;
if (ttfontsdone) ttfontsdone();
// now set the graphics font
- if (!myfonts[8])
+ if (!myfonts[8]) {
if (myfonts[4]->height(myfonts[4]) < 16)
myfonts[8] = SF_font3;
else
myfonts[8] = SF_font3double;
+ }
//for (i=0;i<8;i++){ SFONT *s = myfonts[i]; printf("%d %p %d %d %d %d %d\n",
//i,s,s->minchar(s),s->maxchar(s),s->ascent(s),s->descent(s),s->height(s));}
{
if (s)
{
- int i; MYFONT *f = (MYFONT *)s;
+ MYFONT *f = (MYFONT *)s;
if (c < f->minchar || c > f->maxchar)
{
if (allowdef) c = 0;
int mode = FT_RENDER_MODE_MONO;
SF_glyph *res;
FT_GlyphSlot slot = face->glyph;
- int i,j, nbypr, pitch;
- unsigned char *s;
+ int i,j, nbypr;
FT_Bitmap *bitmap;
if (m_aafonts) mode = FT_RENDER_MODE_NORMAL;
\r
STATIC void drawit( int x, int y, ENTRY *e, int w, int issub)\r
{\r
- int i,j,n,sw,dy,color;\r
+ int i, j, n, color;\r
unsigned char *bmp;\r
char *s = e->value;\r
bmp = (issub ? folderbmp : docbmp);\r
// (lib does not guarantee correct behaviour in that case)\r
static void mystrcpy( char *d, const char *s)\r
{\r
- while (*d++ = *s++);\r
+ while ((*d++ = *s++));\r
}\r
\r
STATIC zword Zentry( int x, int y)\r
void *secret) {
void *trace[16];
- char **messages = (char **)NULL;
char *nam;
int i, trace_size = 0;
ucontext_t *uc = (ucontext_t *)secret;
printf("\nInterpreter bug!\nSignal %d ", sig);
if ((nam = getsigname(sig))) printf("[%s] ",nam);
- printf("from %p", uc->uc_mcontext.gregs[_PROG_COUNTER]);
+ printf("from %p", (void *)uc->uc_mcontext.gregs[_PROG_COUNTER]);
if (sig == SIGSEGV)
printf(" [faulty address is %p]",info->si_addr);
// the higher it is, the more FPS shown and CPU needed
static int audio_buffers=512;
static Uint16 audio_format;
-static int volume = SDL_MIX_MAXVOLUME;
+//static int volume = SDL_MIX_MAXVOLUME;
static int bits;
static void finishaudio()
return res;
}
-static EFFECT *geteffect( num)
+static EFFECT *geteffect(int num)
{
myresource res;
EFFECT *result = NULL;
static const char *progname = NULL;
-extern char script_name[];
-extern char command_name[];
-extern char save_name[];
-extern char auxilary_name[];
-
char stripped_story_name[100];
extern char *optarg;
void os_process_arguments (int argc, char *argv[])
{
char *p;
- int i;
-
- // install signal handlers
sf_installhandlers();
-
- /* Parse command line options */
-
parse_options(argc, argv);
if (optind != argc - 1)
usage();
exit (EXIT_FAILURE);
}
-
- /* Set the story file name */
-
f_setup.story_file = strdup(argv[optind]);
- // load resources
- // it's useless to test the retval, as in case of error it does not return
+ // it's useless to test the retval, as in case of error it does not return
sf_load_resources( f_setup.story_file);
/* Strip path and extension off the story file name */
{
int st;
const char *initname = default_name;
- char *ext = ".aux";
if (newfile(flag))
{
if (strncmp(r,sect,ns)) continue;
return (r+ns);
}
+ return NULL;
}
static char * findid( const char *sect, const char *id)
{
int nid = strlen(id);
- char *p, *r, *sav, *rq, *fnd = NULL;
+ char *r, *sav, *rq, *fnd = NULL;
r = findsect(sect);
//printf("findsect(%s) %p\n",sect,r);
if (!r) return NULL;
int sf_pkread( FILE *f, int foffs, void ** out, int *size)
{
- byte hd[30], *dest;
+ byte hd[30];
byte *data, *cdata;
int csize, usize, cmet, skip, st;