home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d130
/
hp.lha
/
Hp
/
hp_user_inputs.include
< prev
next >
Wrap
Text File
|
1988-03-13
|
2KB
|
88 lines
/*--------------------------------------------*/
/* */
/* Filename: hp_user_inputs.include */
/* */
/* Contains C source code for routines */
/* TweakDisplay, BeepHpDisplay, KeyCode */
/* and GadgetPoked, which are used by */
/* routine hp.c */
/* */
/*--------------------------------------------*/
TweakDisplay()
{
if ( inkey == 61 ) display_red = (display_red + 1) % 16;
if ( inkey == 62 ) display_green = (display_green + 1) % 16;
if ( inkey == 63 ) display_blue = (display_blue + 1) % 16;
SetRGB4( vp, SCREENCOLOR, display_red, display_green, display_blue );
}
/*-------------------------------------------------------------------*/
BeepHpDisplay()
{ int timer, nothing;
SetRGB4( vp, SCREENCOLOR, 15, 9, 0 );
for( timer = 1; timer <= 5000; timer++) nothing = 0;
SetRGB4( vp, SCREENCOLOR, display_red, display_green, display_blue );
}
/*-------------------------------------------------------------------*/
KeyCode()
{
int row, col, hue, x, y, key;
x = hp_window -> MouseX;
y = hp_window -> MouseY;
hue = ReadPixel( rp, x, y );
if ( hue == 0 ) return(0);
row = (y - 73) / 17;
if ( (row >= 0) && (row <= 2) && (x >= 390) && (x <= 593) ) {
col = (x - 390) / 56;
key = row * 4 + col + 1;
return(key); }
if ( (row >= 0) && (row <= 5) && (x >= 46) && (x <= 361) ) {
col = (x - 46) / 56;
key = row * 6 + col + 13;
return(key); }
if ( row == 3 ) {
if ( (x >= 414) && (x <= 449) ) return(49);
if ( (x >= 477) && (x <= 512) ) return(50);
if ( (x >= 558) && (x <= 593) ) return(51); }
if ( (row == 4) && (x >= 446) && (x <= 514) ) return(52);
if ( (row == 5) && (x >= 429) && (x <= 464) ) return(53);
if ( (row == 5) && (x >= 494) && (x <= 529) ) return(54);
if ( (row == 5) && (x >= 558) && (x <= 593) ) return(64);
if (row == 6) {
col = (x-46) / 97;
key = 55 + col;
return(key); }
if ( hue == 6 ) return(61);
if ( hue == 7 ) return(62);
if ( hue == 4 ) return(63);
return(0);
}
/*--------------------------------------------------------*/
BOOL GadgetPoked()
{
message = GetMsg( hp_window -> UserPort );
if ( message == NULL ) return(FALSE);
if ( message -> Class == CLOSEWINDOW )
return(TRUE);
else
return(FALSE);
}