home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume6
/
ega-wanderer
/
part01
/
icon.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-02-14
|
3KB
|
145 lines
#include "wand_head.h"
#include "bitmap.h"
#ifdef EGA
extern bitmap *b48x48[];
extern char *EGAaddr;
#endif
/* this is where the pretty graphics are */
/* all defined - change them if you want.. */
static
char *backslide[] ={ "\\_ ",
" \\" },
*fwdslide[] ={ " _/",
"/ " },
*space[] ={ " ",
" " },
*whoops[] ={ "OOO",
"OOO" },
*wall[] ={ "###",
"###" },
*rarrow[] ={ "-->",
"-->" },
*larrow[] ={ "<--",
"<--" },
*rock[] ={ "/^\\",
"\\_/" },
*dirt[] ={ ". .",
" . " },
*diamond[] ={ "/$\\",
"\\$/" },
*brick[] ={ "=-=",
"-=-" },
*player[] ={ " o ",
"<|>" },
*teleport[] ={ "(*)",
"(*)" },
*wayout[] ={ "Way",
"Out" },
*landmine[] ={ " I ",
" o " },
*monster[] ={ "}o{",
"/^\\" },
*sprite[] ={ "-o-",
"/*\\" },
*balloon[] ={ "/~\\",
"\\_X" },
*timecapsule[]={" ",
"<O>" },
*cage[] ={ "TTT",
"III" },
**icons[] ={ backslide, balloon, brick, cage, diamond, dirt,
fwdslide, landmine, larrow, monster, player,
rarrow, rock, space, sprite, teleport, timecapsule,
wall, wayout, whoops,
};
void draw_symbol(x,y,ch)
int x,y;
char ch;
{
int what = symbol(ch);
#ifdef EGA
static char drawn[7][11];
extern int EGAmode;
if(EGAmode != 48) {
EGAmode = 48;
memset( drawn, 0, sizeof(drawn) );
}
if(EGAaddr) {
bitmap *map = b48x48[what];
x /= 3;
y /= 2;
if(drawn[y][x] != ch) {
drawn[y][x] = ch;
egapaint( 4 + map->width * x, 4 + map->height * y, map );
}
}
else
#endif
{
mvaddstr(++y,++x,icons[what][0]);
mvaddstr(++y,x,icons[what][1]);
}
}
int symbol( ch )
char ch;
{
switch( ch )
{
case ' ': /* space */
return( SPACE );
case '#': /* rock */
return( WALL );
case '<': /* arrows */
return( LARROW );
case '>':
return( RARROW );
case 'O': /* boulder */
return( ROCK );
case ':': /* earth */
return( DIRT );
case '/': /* slopes */
return( FWDSLIDE );
case '\\':
return( BACKSLIDE );
case '*': /* diamond */
return( DIAMOND );
case '=': /* brick */
return( BRICK );
case '@': /* YOU!!! */
return( PLAYER );
case 'T': /* teleport */
return( TELEPORT );
case 'X': /* exits */
return( WAYOUT );
case '!': /* landmine */
return( LANDMINE );
case 'M': /* big monster */
return( MONSTER );
case 'S': /* baby monster */
return( SPRITE );
case '^': /* balloon */
return( BALLOON );
case 'C': /* time capsule */
return( TIMECAPSULE );
case '+': /* cage */
return( CAGE );
case 'A': /* teleport arrival */
return( ARRIVAL );
}
/* this is what it uses if it doesn't */
/* recognise the character */
return( WHOOPS );
}