Reformat all C files.
I'll push a formatting guide at some point. There may still be outstanding changes, but please feel free to resolve those as you arrive a them. To the best of my knowledge, there is no changes to the actual code content, but the formatter does have the occasional bug. If you run into an issue, please fix it!
This commit is contained in:
+44
-56
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 winkey.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
|
||||
/* NetHack 3.6 winkey.c $NHDT-Date: 1431192783 2015/05/09 17:33:03 $ $NHDT-Branch: master $:$NHDT-Revision: 1.6 $ */
|
||||
/* NetHack 3.6 winkey.c $Date: 2009/05/06 10:48:37 $ $Revision: 1.3 $ */
|
||||
/* SCCS Id: @(#)winkey.c 3.5 1993/04/02 */
|
||||
/* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
|
||||
@@ -8,58 +8,49 @@
|
||||
#include "NH:sys/amiga/winext.h"
|
||||
#include "NH:sys/amiga/winproto.h"
|
||||
|
||||
amii_nh_poskey(x, y, mod)
|
||||
int*x, *y, *mod;
|
||||
amii_nh_poskey(x, y, mod) int *x, *y, *mod;
|
||||
{
|
||||
struct amii_WinDesc *cw;
|
||||
WETYPE type;
|
||||
struct RastPort *rp;
|
||||
struct Window *w;
|
||||
|
||||
if( cw = amii_wins[WIN_MESSAGE] )
|
||||
{
|
||||
cw->wflags &= ~FLMAP_SKIP;
|
||||
if( scrollmsg )
|
||||
cw->wflags |= FLMSG_FIRST;
|
||||
cw->disprows = 0;
|
||||
if (cw = amii_wins[WIN_MESSAGE]) {
|
||||
cw->wflags &= ~FLMAP_SKIP;
|
||||
if (scrollmsg)
|
||||
cw->wflags |= FLMSG_FIRST;
|
||||
cw->disprows = 0;
|
||||
}
|
||||
|
||||
if( WIN_MAP != WIN_ERR && (cw = amii_wins[ WIN_MAP ]) && ( w = cw->win ) )
|
||||
{
|
||||
cursor_on( WIN_MAP );
|
||||
}
|
||||
else
|
||||
panic( "no MAP window opened for nh_poskey\n" );
|
||||
if (WIN_MAP != WIN_ERR && (cw = amii_wins[WIN_MAP]) && (w = cw->win)) {
|
||||
cursor_on(WIN_MAP);
|
||||
} else
|
||||
panic("no MAP window opened for nh_poskey\n");
|
||||
|
||||
rp = w->RPort;
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
type = WindowGetevent( );
|
||||
if( type == WEMOUSE )
|
||||
{
|
||||
*mod = CLICK_1;
|
||||
if( lastevent.un.mouse.qual )
|
||||
*mod = 0;
|
||||
while (1) {
|
||||
type = WindowGetevent();
|
||||
if (type == WEMOUSE) {
|
||||
*mod = CLICK_1;
|
||||
if (lastevent.un.mouse.qual)
|
||||
*mod = 0;
|
||||
|
||||
/* X coordinates are 1 based, Y are 1 based. */
|
||||
*x = ( (lastevent.un.mouse.x - w->BorderLeft) / mxsize ) + 1;
|
||||
*y = ( ( lastevent.un.mouse.y - w->BorderTop - MAPFTBASELN ) /
|
||||
mysize ) + 1;
|
||||
#ifdef CLIPPING
|
||||
if( clipping )
|
||||
{
|
||||
*x += clipx;
|
||||
*y += clipy;
|
||||
}
|
||||
/* X coordinates are 1 based, Y are 1 based. */
|
||||
*x = ((lastevent.un.mouse.x - w->BorderLeft) / mxsize) + 1;
|
||||
*y = ((lastevent.un.mouse.y - w->BorderTop - MAPFTBASELN)
|
||||
/ mysize) + 1;
|
||||
#ifdef CLIPPING
|
||||
if (clipping) {
|
||||
*x += clipx;
|
||||
*y += clipy;
|
||||
}
|
||||
#endif
|
||||
return( 0 );
|
||||
}
|
||||
else if( type == WEKEY )
|
||||
{
|
||||
lastevent.type = WEUNK;
|
||||
return( lastevent.un.key );
|
||||
}
|
||||
return (0);
|
||||
} else if (type == WEKEY) {
|
||||
lastevent.type = WEUNK;
|
||||
return (lastevent.un.key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,17 +58,16 @@ int
|
||||
amii_nhgetch()
|
||||
{
|
||||
int ch;
|
||||
struct amii_WinDesc *cw=amii_wins[WIN_MESSAGE];
|
||||
struct amii_WinDesc *cw = amii_wins[WIN_MESSAGE];
|
||||
|
||||
if( WIN_MAP != WIN_ERR && amii_wins[ WIN_MAP ] )
|
||||
{
|
||||
cursor_on( WIN_MAP );
|
||||
if (WIN_MAP != WIN_ERR && amii_wins[WIN_MAP]) {
|
||||
cursor_on(WIN_MAP);
|
||||
}
|
||||
if(cw)
|
||||
cw->wflags &= ~FLMAP_SKIP;
|
||||
if (cw)
|
||||
cw->wflags &= ~FLMAP_SKIP;
|
||||
|
||||
ch = WindowGetchar();
|
||||
return( ch );
|
||||
return (ch);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -91,18 +81,16 @@ amii_getret()
|
||||
{
|
||||
register int c;
|
||||
|
||||
raw_print( "" );
|
||||
raw_print( "Press Return..." );
|
||||
raw_print("");
|
||||
raw_print("Press Return...");
|
||||
|
||||
c = 0;
|
||||
|
||||
while( c != '\n' && c != '\r' )
|
||||
{
|
||||
if( HackPort )
|
||||
c = WindowGetchar();
|
||||
else
|
||||
c = getchar();
|
||||
while (c != '\n' && c != '\r') {
|
||||
if (HackPort)
|
||||
c = WindowGetchar();
|
||||
else
|
||||
c = getchar();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user