-/* CVS: Last edit by $Author$ on $Date$ */
/* File: main-mac.c */
/* Purpose: Simple support for MACINTOSH Angband */
#endif
/*
+ * Cleaning up a couple of things to make these easier to change --AR
+ */
+#ifdef JP
+#define PREF_FILE_NAME "Hengband Preferences"
+#else
+#define PREF_FILE_NAME "Hengband-E Preferences"
+#endif
+
+/*
* Use "malloc()" instead of "NewPtr()"
*/
/* #define USE_MALLOC */
#endif
+
/*
* Globals for MPW compilation
*/
#ifdef MAC_MPW
/* Globals needed */
+ QDGlobals qd;
u32b _ftype;
u32b _fcreator;
#endif
#endif /* ANGBAND_LITE_MAC */
-#ifdef JP
GWorldPtr bufferPort;
PixMapHandle bufferPixHndl;
PixMapPtr bufferPix;
-#endif
Str15 title;
/*
Extra Sound Mode
*/
-#ifdef JP
+
static int ext_sound = 0;
#define SND_NON 0
static int soundmode[8];
-
-#endif
-
+static int ext_graf = 0;
* Store this filename in 'buf' (make sure it is long enough)
* Note that 'fname' looks to be a "pascal" string
*/
+#if TARGET_API_MAC_CARBON
static void refnum_to_name(char *buf, long refnum, short vrefnum, char *fname)
{
DirInfo pb;
vref = vrefnum;
dirID = refnum;
-
-/* pb.ioCompletion=NULL;
- pb.ioNamePtr=name;
- pb.ioVRefNum=vrefnum;
- pb.ioDrParID=refnum;
- pb.ioFDirIndex=-1;*/
while (1)
{
pb.ioDrDirID=pb.ioDrParID;
-// err = PBGetCatInfo((CInfoPBPtr)&pb, FALSE);
err = FSMakeFSSpec( vref, dirID, "\p", &spec );
if( err != noErr )
i -= spec.name[0];
dirID = spec.parID;
-// if (pb.ioDrDirID == fsRtDirID) break;
}
/* Extract the result */
for (j = 0, i++; res[i]; j++, i++) buf[j] = res[i];
buf[j] = 0;
}
+#else
+static void refnum_to_name(char *buf, long refnum, short vrefnum, char *fname)
+{
+ DirInfo pb;
+ Str255 name;
+ int err;
+ int i, j;
+
+ char res[1000];
+
+ i=999;
+
+ res[i]=0; i--;
+ for (j=1; j<=fname[0]; j++)
+ {
+ res[i-fname[0]+j] = fname[j];
+ }
+ i-=fname[0];
+
+ pb.ioCompletion=NULL;
+ pb.ioNamePtr=name;
+ pb.ioVRefNum=vrefnum;
+ pb.ioDrParID=refnum;
+ pb.ioFDirIndex=-1;
+
+ while (1)
+ {
+ pb.ioDrDirID=pb.ioDrParID;
+ err = PBGetCatInfo((CInfoPBPtr)&pb, FALSE);
+ res[i] = ':'; i--;
+ for (j=1; j<=name[0]; j++)
+ {
+ res[i-name[0]+j] = name[j];
+ }
+ i -= name[0];
+
+ if (pb.ioDrDirID == fsRtDirID) break;
+ }
+
+ /* Extract the result */
+ for (j = 0, i++; res[i]; j++, i++) buf[j] = res[i];
+ buf[j] = 0;
+}
+#endif
+#if TARGET_API_MAC_CARBON
pascal OSErr FSpLocationFromFullPath(short fullPathLength,
const void *fullPath,
FSSpec *spec)
}
return ( result );
}
-
+#endif
#if 0
r->bottom = temp.v;
}
+
/*
* Center a rectangle inside another rectangle
*/
#endif
-static OSType GetProcessSignature( void )
-{
- ProcessSerialNumber thePSN;
- ProcessInfoRec info;
- OSErr err;
-
- thePSN.highLongOfPSN = 0;
- thePSN.lowLongOfPSN = kCurrentProcess;
-
- info.processInfoLength = sizeof(ProcessInfoRec);
- info.processName = nil;
- info.processAppSpec = nil;
-
- err = GetProcessInformation(&thePSN, &info);
-
- if( err != noErr )
- quit( "Internal System Error. Process Information could not be found." );
-
- return info.processSignature;
-}
-
static OSErr ChooseFile( StringPtr filename, FSSpec selfld )
{
NavReplyRecord reply;
return err;
}
+
/*
* Activate a given window, if necessary
*/
*/
static void term_data_color(term_data *td, int a)
{
-#ifdef JP
u16b rv, gv, bv;
RGBColor color;
/* Memorize color */
td->last = a;
-#else
- /* Activate the color */
- if (td->last != a)
- {
- u16b rv, gv, bv;
-
- RGBColor color;
-
- /* Extract the R,G,B data */
- rv = angband_color_table[a][1];
- gv = angband_color_table[a][2];
- bv = angband_color_table[a][3];
-
- /* Set the color */
- color.red = (rv | (rv << 8));
- color.green = (gv | (gv << 8));
- color.blue = (bv | (bv << 8));
-
- /* Activate the color */
- RGBForeColor(&color);
-
- /* Memorize color */
- td->last = a;
- }
-#endif
}
#endif /* ANGBAND_LITE_MAC */
td->tile_o_y = td->font_o_y;
/* Set default tile size */
-#ifdef JP
if( td->tile_wid == 0 && td->tile_hgt == 0 ){
td->tile_wid = td->font_wid;
td->tile_hgt = td->font_hgt;
}
-#else
- td->tile_wid = td->font_wid;
- td->tile_hgt = td->font_hgt;
-#endif
/* Re-activate the old window */
activate(old);
BitMap screen;
#if TARGET_API_MAC_CARBON
-
GetQDGlobalsScreenBits( &screen );
#else
screen = qd.screenBits;
#endif
-
/* Minimal window size */
- if (td->cols < 1) td->cols = 1;
- if (td->rows < 1) td->rows = 1;
+ if (td == &data[0])
+ {
+ /* Enforce minimal size */
+ if (td->cols < 80) td->cols = 80;
+ if (td->rows < 24) td->rows = 24;
+ }
+
+ /* Allow small windows for the rest */
+ else
+ {
+ if (td->cols < 1) td->cols = 1;
+ if (td->rows < 1) td->rows = 1;
+ }
/* Minimal tile size */
if (td->tile_wid < 4) td->tile_wid = 4;
td->r.bottom = td->r.top + td->size_hgt;
/* Assume no graphics */
+ td->t->higher_pict = FALSE;
td->t->always_pict = FALSE;
#ifdef ANGBAND_LITE_MAC
#else /* ANGBAND_LITE_MAC */
/* Handle graphics */
- if (use_graphics && (td == &data[0]))
+ if (use_graphics)
{
- td->t->always_pict = TRUE;
+ /* Use higher_pict whenever possible */
+ if (td->font_mono) td->t->higher_pict = TRUE;
+
+ /* Use always_pict only when necessary */
+ else td->t->always_pict = TRUE;
}
#endif /* ANGBAND_LITE_MAC */
/* Fake mono-space */
if (!td->font_mono ||
(td->font_wid != td->tile_wid) ||
- (td->font_hgt != td->tile_hgt))
+ (td->font_hgt != td->tile_hgt))
{
- /* Handle fake monospace */
+ /* Handle fake monospace -- this is SLOW */
+ if (td->t->higher_pict) td->t->higher_pict = FALSE;
td->t->always_pict = TRUE;
}
}
+static OSErr XDDSWUpDateGWorldFromPict( term_data *td );
/*
* Hack -- resize a term_data
*
{
/* Actually resize the window */
SizeWindow(td->w, td->size_wid, td->size_hgt, 0);
+
+ XDDSWUpDateGWorldFromPict( td );
}
/* Restore the old term */
Term_activate(old);
-
+
/* No need to redraw */
#if TARGET_API_MAC_CARBON
{
DisposeRgn( theRgn );
}
#else
- ValidRect( &(td->w->portRect) );
+ ValidRect(&td->w->portRect);
#endif
}
* Constants
*/
-#define kPictID 1001 /* Graf 'pict' resource */
+static int pictID = 1001; /* 8x8 tiles; 16x16 tiles are 1002 */
-#define kGrafWidth 8 /* Graf Size (X) */
-#define kGrafHeight 8 /* Graf Size (Y) */
+static int grafWidth = 8; /* Always equal to grafHeight */
+static int grafHeight = 8; /* Either 8 or 16 */
+static bool arg_newstyle_graphics;
+static bool use_newstyle_graphics;
/*
* Forward Declare
(void)LockPixels(pixMapH);
HLockHi((Handle)pixMapH);
srcFrameP->framePixHndl = pixMapH;
+#if TARGET_API_MAC_CARBON
srcFrameP->framePix = (PixMapPtr)*(Handle)pixMapH;
+#else
+ srcFrameP->framePix = (PixMapPtr)StripAddress(*(Handle)pixMapH);
+#endif
}
-#ifdef JP
/*
* Lock a frame
*/
td->bufferPixHndl = pixMapH;
td->bufferPix = (PixMapPtr)*(Handle)pixMapH;
}
-#endif
/*
}
-#ifdef JP
/*
* Unlock a frame
*/
td->bufferPix = NULL;
}
-#endif
static OSErr BenSWCreateGWorldFromPict(
GWorldPtr *pictGWorld,
return (0);
}
-#ifdef JP
static OSErr XDDSWCreateGWorldFromPict(
GWorldPtr *pictGWorld,
GDHandle theGDH;
tempGWorld = NULL;
-
+
/* Reset */
*pictGWorld = NULL;
/* Activate */
SetGWorld(tempGWorld, nil);
- /* Dump the pict into the GWorld */
+ /* Dump the pict into the GWorld
(void)LockPixels(GetGWorldPixMap(tempGWorld));
EraseRect(&pictRect);
- //DrawPicture(pictH, &pictRect);
+// DrawPicture(pictH, &pictRect);
UnlockPixels(GetGWorldPixMap(tempGWorld));
/* Restore GWorld */
SetGWorld(saveGWorld, saveGDevice);
-
+
return (0);
}
+static OSErr XDDSWUpDateGWorldFromPict( term_data *td )
+{
+ GWorldPtr saveGWorld;
+ GDHandle saveGDevice;
+ Rect pictRect;
+ short depth;
+ GDHandle theGDH;
+
+ GWorldFlags errflag;
+
+ /* */
+
+ if( td->bufferPort == NULL )
+ return;
+ /* Get depth */
+ depth = td->pixelDepth;
+
+ /* Get GDH */
+ theGDH = td->theGDH;
+
+ /* Obtain size rectangle */
+ pictRect.top = 0;
+ pictRect.left = 0;
+ pictRect.right = td->size_wid;
+ pictRect.bottom = td->tile_hgt;
+
+ XDDSWUnlockFrame(td);
+
+ errflag = UpdateGWorld( &td->bufferPort, depth, &pictRect, 0, 0, 0);
+ XDDSWLockFrame(td);
+ if( errflag & gwFlagErr ){
+ //SysBeep(0);
+ return;
+ }
+
+#if 0
+ /* Save GWorld */
+ GetGWorld(&saveGWorld, &saveGDevice);
+
+ /* Activate */
+ SetGWorld(td->bufferPort, nil);
+
+ /* Dump the pict into the GWorld */
+ (void)LockPixels(GetGWorldPixMap(td->bufferPort));
+ EraseRect(&td->bufferPort->portRect);
+
+ UnlockPixels(GetGWorldPixMap(td->bufferPort));
+
+ /* Restore GWorld */
+ SetGWorld(saveGWorld, saveGDevice);
#endif
+
+}
/*
* Init the global "frameP"
SetPort(data[0].w);
#endif
+
/* Get the pict resource */
- newPictH = GetPicture(kPictID);
+ newPictH = GetPicture(pictID);
/* Analyze result */
err = (newPictH ? 0 : -1);
-
+
/* Oops */
if (err == noErr)
{
-
+
/* Create GWorld */
err = BenSWCreateGWorldFromPict(&tempPictGWorldP, newPictH);
{
/* Create the frame */
frameP = (FrameRec*)NewPtrClear((Size)sizeof(FrameRec));
-
+
/* Analyze result */
err = (frameP ? 0 : -1);
{
/* Save GWorld */
frameP->framePort = tempPictGWorldP;
-
+
/* Lock it */
BenSWLockFrame(frameP);
}
static RGBColor black = {0x0000,0x0000,0x0000};
static RGBColor white = {0xFFFF,0xFFFF,0xFFFF};
-
- WindowAttributes wattrs;
-
#ifdef ANGBAND_LITE_MAC
/* Make the window */
#else /* ANGBAND_LITE_MAC */
/* Make the window */
-// td->w = NewCWindow(0, &td->r, td->title, 0, documentProc, (WindowPtr)-1, 1, 0L);
- wattrs = kWindowCloseBoxAttribute |
- kWindowCollapseBoxAttribute |
- kWindowResizableAttribute;
- /* Make the window */
- CreateNewWindow(
- kDocumentWindowClass,
- wattrs,
- &td->r,
- &td->w);
-
- MoveWindow(td->w, td->r.left, td->r.top, 0 );
+ td->w = NewCWindow(0, &td->r, td->title, 0, documentProc, (WindowPtr)-1, 1, 0L);
#endif /* ANGBAND_LITE_MAC */
GetWindowBounds( (WindowRef)td->w, kWindowContentRgn, &globalRect );
#else
globalRect = td->w->portRect;
- local_to_global( &globalRect );
+ LocalToGlobal((Point*)&globalRect.top);
+ LocalToGlobal((Point*)&globalRect.bottom);
#endif
/* Obtain the proper GDH */
}
#endif /* ANGBAND_LITE_MAC */
+
{
Rect portRect;
-
+
#if TARGET_API_MAC_CARBON
GetWindowBounds( (WindowRef)td->w, kWindowContentRgn, &portRect );
global_to_local( &portRect );
#else
portRect = td->w->portRect;
#endif
-
/* Clip to the window */
ClipRect(&portRect);
#if TARGET_API_MAC_CARBON
InvalWindowRect((WindowRef)(td->w), (const Rect *)(&portRect));
#else
- InvalRect( &portRect );
+ InvalRect(&portRect);
#endif
+
/* Display the window if needed */
- if (td->mapped)ShowWindow(td->w);
+ if (td->mapped) ShowWindow(td->w);
/* Hack -- set "mapped" flag */
t->mapped_flag = td->mapped;
/* Forget color */
td->last = -1;
-/*#ifdef JP
- XDDSWCreateGWorldFromPict( &td->bufferPort , td );
+ XDDSWCreateGWorldFromPict( &td->bufferPort, td );
XDDSWLockFrame( td );
-#endif*/
+
}
+ /* Oops */
+/* if (err == noErr)
+ {
+
+ }*/
}
use_sound = arg_sound;
}
+
+ /* Handle transparency */
+ if (use_newstyle_graphics != arg_newstyle_graphics)
+ {
+ globe_nuke();
+
+ if (globe_init() != 0)
+ {
+ plog("Cannot initialize graphics!");
+ arg_graphics = FALSE;
+ arg_newstyle_graphics = FALSE;
+ }
+
+ /* Apply request */
+ use_newstyle_graphics = arg_newstyle_graphics;
+
+ /* Apply and Verify */
+ term_data_check_size(td);
+
+ /* Resize the window */
+ term_data_resize(td);
+
+ /* Reset visuals */
+ reset_visuals();
+ }
+
/* Handle graphics */
- if ((td == &data[0]) && (use_graphics != arg_graphics))
+ if (use_graphics != arg_graphics)
{
/* Initialize graphics */
-
+
if (!use_graphics && !frameP && (globe_init() != 0))
{
- #ifdef JP
+#ifdef JP
plog("¥°¥é¥Õ¥£¥Ã¥¯¤Î½é´ü²½¤Ï½ÐÍè¤Þ¤»¤ó¤Ç¤·¤¿.");
- #else
+#else
plog("Cannot initialize graphics!");
- #endif
+#endif
arg_graphics = FALSE;
}
term_data *td = (term_data*)(Term->data);
Rect r;
-
+
/* Analyze */
switch (n)
{
sound[0] = strlen((char*)sound + 1);
/* Obtain resource XXX XXX XXX */
-#ifdef JP
handle = Get1NamedResource('snd ', sound);
if( handle == NULL || ext_sound )
handle = GetNamedResource('snd ', sound);
HUnlock(handle);
ReleaseResource(handle);
}
-#else
- handle = GetNamedResource('snd ', sound);
-
- /* Oops */
- if (handle)
- {
- /* Load and Lock */
- LoadResource(handle);
- HLock(handle);
-
- /* Play sound (wait for completion) */
- SndPlay(nil, (SndListHandle)handle, true);
-
- /* Unlock and release */
- HUnlock(handle);
- ReleaseResource(handle);
- }
-#endif
-
/* Success */
return (0);
}
}
}
-
/* Oops */
return (1);
}
r.right = r.left + td->tile_wid;
r.top = y * td->tile_hgt + td->size_oh1;
r.bottom = r.top + td->tile_hgt;
+
+#ifdef JP
+ if (x + 1 < Term->wid &&
+ ((use_bigtile && Term->old->a[y][x+1] == 255)
+ || (iskanji(Term->old->c[y][x]) && !(Term->old->a[y][x] & 0x80))))
+#else
+ if (use_bigtile && x + 1 < Term->wid && Term->old->a[y][x+1] == 255)
+#endif
+ r.right += td->tile_wid;
+
FrameRect(&r);
/* Success */
int xp, yp;
term_data *td = (term_data*)(Term->data);
-
+
/* Set the color */
term_data_color(td, (a & 0x0F));
/* Draw the string */
else DrawText(cp, 0, n);
-// QDFlushPortBuffer( GetQDGlobalsThePort(), NULL );
-
/* Success */
return (0);
}
*
* Erase "n" characters starting at (x,y)
*/
- static errr Term_pict_mac(int x, int y, int n, const byte *ap, const char *cp)
+#ifdef USE_TRANSPARENCY
+static errr Term_pict_mac(int x, int y, int n, const byte *ap, const char *cp,
+ const byte *tap, const char *tcp)
+#else
+static errr Term_pict_mac(int x, int y, int n, const byte *ap, const char *cp)
+#endif
{
int i;
+ Rect r2;
+ bool use_buffer = false;
+ term_data *td = (term_data*)(Term->data);
+ GDHandle saveGDevice;
+ GWorldPtr saveGWorld;
+
+ PixMapHandle PortPix;
+
-#ifdef JP
- Rect KnjRec;
+ /* Save GWorld */
+ GetGWorld(&saveGWorld, &saveGDevice);
+
+ if( n > 1 )
+ {
+ Rect portRect;
+
+#if TARGET_API_MAC_CARBON
+ GetPortBounds( (CGrafPtr)td->bufferPort, &portRect );
+#else
+ portRect = td->bufferPort->portRect;
#endif
- Rect r2;
-
- term_data *td = (term_data*)(Term->data);
+ /* Destination rectangle */
+ r2.left = x * td->tile_wid + td->size_ow1;
+ r2.right = r2.left + td->tile_wid;
+ r2.top = 0;
+ r2.bottom = r2.top + td->tile_hgt;
- /* Destination rectangle */
- r2.left = x * td->tile_wid + td->size_ow1;
- r2.right = r2.left + td->tile_wid;
- r2.top = y * td->tile_hgt + td->size_oh1;
- r2.bottom = r2.top + td->tile_hgt;
+ /* Activate */
+ SetGWorld(td->bufferPort, nil);
+ PortPix = GetGWorldPixMap(td->bufferPort );
+ LockPixels( PortPix );
+
+ /* Instantiate font */
+ TextFont(td->font_id);
+ TextSize(td->font_size);
+ TextFace(td->font_face);
+
+ /* Restore colors */
+ BackColor(blackColor);
+ ForeColor(whiteColor);
+
+ /* Erase */
+ EraseRect(&portRect);
+ use_buffer = true;
+ }
+ else
+ {
+ /* Destination rectangle */
+ r2.left = x * td->tile_wid + td->size_ow1;
+ r2.top = y * td->tile_hgt + td->size_oh1;
+ r2.bottom = r2.top + td->tile_hgt;
+
+ /* no buffering, so we use the normal current port */
+
+ use_buffer = false;
+ }
+
/* Scan the input */
for (i = 0; i < n; i++)
{
byte a = ap[i];
char c = cp[i];
-#ifdef ANGBAND_LITE_MAC
+ /* Second byte of bigtile */
+ if (use_bigtile && a == 255)
+ {
+ /* Advance */
+ r2.left += td->tile_wid;
- /* Nothing */
+ continue;
+ }
+
+ /* Prepare right of rectangle now */
+ r2.right = r2.left + td->tile_wid;
+
+#ifdef ANGBAND_LITE_MAC
+
+ /* No graphics */
#else /* ANGBAND_LITE_MAC */
/* Graphics -- if Available and Needed */
- if (use_graphics && (td == &data[0]) &&
- ((byte)a & 0x80) && ((byte)c & 0x80))
+ if (use_graphics && ((byte)a & 0x80) && ((byte)c & 0x80))
{
+#if TARGET_API_MAC_CARBON
+ PixMapHandle srcBitMap = GetGWorldPixMap(frameP->framePort);
+ PixMapHandle destBitMap;
+#else
+ BitMapPtr srcBitMap = (BitMapPtr)(frameP->framePix);
+ BitMapPtr destBitMap;
+#endif
+
int col, row;
-
Rect r1;
+#ifdef USE_TRANSPARENCY
+ Rect terrain_r;
+ bool terrain_flag = FALSE;
+ byte ta = tap[i];
+ char tc = tcp[i];
+
+ if ((a != ta || c != tc) &&
+ ((byte)ta & 0x80) && ((byte)tc & 0x80))
+ {
+ /* Row and Col */
+ row = ((byte)ta & 0x7F);
+ col = ((byte)tc & 0x7F);
+
+ /* Terrain Source rectangle */
+ terrain_r.left = col * grafWidth;
+ terrain_r.top = row * grafHeight;
+ terrain_r.right = terrain_r.left + grafWidth;
+ terrain_r.bottom = terrain_r.top + grafHeight;
+
+ terrain_flag = TRUE;
+ }
+#endif
+
/* Row and Col */
row = ((byte)a & 0x7F);
col = ((byte)c & 0x7F);
-
+
/* Source rectangle */
- r1.left = col * kGrafWidth;
- r1.top = row * kGrafHeight;
- r1.right = r1.left + kGrafWidth;
- r1.bottom = r1.top + kGrafHeight;
+ r1.left = col * grafWidth;
+ r1.top = row * grafHeight;
+ r1.right = r1.left + grafWidth;
+ r1.bottom = r1.top + grafHeight;
/* Hardwire CopyBits */
BackColor(whiteColor);
ForeColor(blackColor);
-{
-
-#if TARGET_API_MAC_CARBON
-
- PixMapHandle srcBitMap;
- PixMapHandle destBitMap;
-
- srcBitMap = GetGWorldPixMap(frameP->framePort);
- destBitMap = GetPortPixMap(GetWindowPort( td->w ));
+
/* Draw the picture */
- CopyBits( (BitMap *) *srcBitMap, (BitMap *) *destBitMap, &r1, &r2, srcCopy, NULL);
+
+ if (use_buffer)
+ destBitMap = (BitMapPtr)(td->bufferPix);
+ else
+#if TARGET_API_MAC_CARBON
+ destBitMap = GetPortPixMap(GetWindowPort( td->w ));
#else
- BitMapPtr srcBitMap = (BitMapPtr)(frameP->framePix);
- BitMapPtr destBitMap = (BitMapPtr)&(td->w->portBits);
+ destBitMap = (BitMapPtr)&(td->w->portBits);
+#endif
+ if (use_bigtile) r2.right += td->tile_wid;
- /* Draw the picture */
- CopyBits( srcBitMap, destBitMap, &r1, &r2, srcCopy, NULL);
+#ifdef USE_TRANSPARENCY
+ if (terrain_flag)
+ {
+ /*
+ * Source mode const = srcCopy:
+ *
+ * determine how close the color of the source
+ * pixel is to black, and assign this relative
+ * amount of foreground color to the
+ * destination pixel; determine how close the
+ * color of the source pixel is to white, and
+ * assign this relative amount of background
+ * color to the destination pixel
+ */
+ CopyBits( srcBitMap, destBitMap, &terrain_r, &r2, srcCopy, NULL );
+
+ /*
+ * Draw transparent tile
+ * BackColor is ignored and the destination is
+ * left untouched
+ */
+ BackColor(blackColor);
+ CopyBits( srcBitMap, destBitMap, &r1, &r2, transparent, NULL );
+ }
+ else
+#endif /* USE_TRANSPARENCY */
+ {
+#if TARGET_API_MAC_CARBON
+ CopyBits( (BitMap *) *srcBitMap, (BitMap *) *destBitMap, &r1, &r2, srcCopy, NULL);
+#else
+ CopyBits( srcBitMap, destBitMap, &r1, &r2, srcCopy, NULL );
#endif
+ }
-}
/* Restore colors */
BackColor(blackColor);
ForeColor(whiteColor);
if (!done)
{
int xp, yp;
-#ifndef JP
- /* Erase */
- EraseRect(&r2);
/* Set the color */
term_data_color(td, (a & 0x0F));
-
+
/* Starting pixel */
xp = r2.left + td->tile_o_x;
yp = r2.top + td->tile_o_y;
-
+
/* Move to the correct location */
MoveTo(xp, yp);
-#endif
+
#ifdef JP
- if(iskanji(c)){
-
- KnjRec.top = r2.top;
- KnjRec.left = r2.left;
- KnjRec.bottom = r2.bottom;
- KnjRec.right = r2.right + td->tile_wid;
+ if (iskanji(c))
+ {
+ /* Double width rectangle */
+ r2.right += td->tile_wid;
/* Erase */
- EraseRect(&KnjRec);
-
- term_data_color(td, a-0x10);
-
- /* Starting pixel */
- xp = r2.left + td->tile_o_x;
- yp = r2.top + td->tile_o_y;
+ EraseRect(&r2);
- /* Move to the correct location */
- MoveTo(xp, yp);
-
+ /* Draw the character */
DrawText(cp, i, 2);
i++;
r2.left += td->tile_wid;
- r2.right += td->tile_wid;
- } else {
+ }
+ else
+#endif
+ {
/* Erase */
EraseRect(&r2);
-
- /* Set the color */
- term_data_color(td, a & 0x0F);
-
- /* Starting pixel */
- xp = r2.left + td->tile_o_x;
- yp = r2.top + td->tile_o_y;
- /* Move to the correct location */
- MoveTo(xp, yp);
-
/* Draw the character */
DrawChar(c);
}
-#else
- /* Draw the character */
- DrawChar(c);
-#endif
}
/* Advance */
r2.left += td->tile_wid;
- r2.right += td->tile_wid;
}
+
+ if( use_buffer )
+ {
+ /* Now we blast the buffer pixmap onto the screen in the right place */
+ BitMapPtr srcBitMap = (BitMapPtr)(td->bufferPix);
+#if TARGET_API_MAC_CARBON
+ BitMapPtr destBitMap = GetPortPixMap(GetWindowPort( td->w ));
+#else
+ BitMapPtr destBitMap = (BitMapPtr)&(td->w->portBits);
+#endif
+ Rect srcRect;
+ Rect destRect;
+
+
+ srcRect.left = x * td->tile_wid + td->size_ow1;
+ srcRect.top = 0;
+ srcRect.right = srcRect.left + (td->tile_wid * n);
+ srcRect.bottom = td->tile_hgt;
+
+ destRect.left = x * td->tile_wid + td->size_ow1;
+ destRect.right = destRect.left + (td->tile_wid * n);
+ destRect.top = y * td->tile_hgt + td->size_oh1;
+ destRect.bottom = destRect.top + td->tile_hgt;
+
+ /* Double width rectangle */
+ if (use_bigtile)
+ {
+ srcRect.right += td->tile_wid * n;
+ destRect.right += td->tile_wid * n;
+ }
+
+ UnlockPixels( PortPix );
+
+ /* Restore GWorld */
+ SetGWorld(saveGWorld, saveGDevice);
+
+ /* Hardwire CopyBits */
+ BackColor(whiteColor);
+ ForeColor(blackColor);
+
+ CopyBits( srcBitMap, destBitMap, &srcRect, &destRect, srcCopy, NULL );
+
+ /* Restore colors */
+ BackColor(blackColor);
+ ForeColor(whiteColor);
+ }
+
/* Success */
return (0);
}
+
+
+
+
+
/*
* Create and initialize window number "i"
*/
putshort(arg_sound);
putshort(arg_graphics);
+ putshort(arg_newstyle_graphics);
+ putshort(arg_bigtile);
/* SoundMode */
for( i = 0 ; i < 7 ; i++ )
putshort(td->font_size);
putshort(td->font_face);
-#ifdef JP
putshort(td->tile_wid);
putshort(td->tile_hgt);
-#endif
putshort(td->cols);
putshort(td->rows);
{
int i;
- int old_major, old_minor, old_patch, old_extra;
+ int old_version, old_major, old_minor, old_patch;
term_data *td;
MenuHandle m;
/*** Version information ***/
/* Preferences version */
+ old_version = getshort();
old_major = getshort();
old_minor = getshort();
old_patch = getshort();
- old_extra = getshort();
/* Hack -- Verify or ignore */
if ((old_version != FAKE_VERSION) ||
arg_sound = getshort();
arg_graphics = getshort();
+ arg_newstyle_graphics = getshort();
+ use_newstyle_graphics = arg_newstyle_graphics;
+
+ if (use_newstyle_graphics == true)
+ {
+ ANGBAND_GRAF = "new";
+ arg_newstyle_graphics = true;
+ grafWidth = grafHeight = 16;
+ pictID = 1002;
+ }
+ else
+ {
+ ANGBAND_GRAF = "old";
+ arg_newstyle_graphics = false;
+ grafWidth = grafHeight = 8;
+ pictID = 1001;
+ }
+
+ arg_bigtile = getshort();
+ use_bigtile = arg_bigtile;
/* SoundMode */
for( i = 0 ; i < 7 ; i++ )
/* Special menu */
m = GetMenuHandle(134); //m = GetMHandle(134);
-
+
+#if TARGET_API_MAC_CARBON
/* Item "arg_sound" */
CheckMenuItem(m, 1, arg_sound);
/* Item "arg_graphics" */
CheckMenuItem(m, 2, arg_graphics);
+
+ /* Item "arg_newstyle_graphics"*/
+ CheckMenuItem(m, 8, arg_newstyle_graphics);
+#else
+ /* Item "arg_sound" */
+ CheckItem(m, 1, arg_sound);
+
+ /* Item "arg_graphics" */
+ CheckItem(m, 2, arg_graphics);
+
+ /* Item "arg_newstyle_graphics"*/
+ CheckItem(m, 8, arg_newstyle_graphics);
+#endif
/* Windows */
for (i = 0; i < MAX_TERM_DATA; i++)
td->font_size = getshort();
td->font_face = getshort();
-#ifdef JP
td->tile_wid = getshort();
td->tile_hgt = getshort();
-#endif
td->cols = getshort();
td->rows = getshort();
#ifdef JP
#if TARGET_API_MAC_CARBON
- /* Default to Monaco font */
+ /* Default to Osaka font (Japanese) */
fid = FMGetFontFamilyFromName( "\pOsaka¡ÝÅùÉý" );
#else
- GetFNum( "\pÅùÉýÌÀÄ«", &fid); /* ¥Õ¥©¥ó¥È̾¤«¤éIDÈÖ¹æ¤òÄ´¤Ù¤ë */
+ GetFNum( "\pÅùÉýÌÀÄ«", &fid);
SetFScaleDisable( true );
#endif
-
#else
/* Default to Monaco font */
GetFNum("\pmonaco", &fid);
#endif
+
/* Wipe it */
WIPE(td, term_data);
ptocstr((StringPtr)foo);
/* Append the preference file name */
-#ifdef JP
- strcat(foo, "Hengband Preferences");
-#else
- strcat(foo, "Angband Preferences");
-#endif
+ strcat(foo, PREF_FILE_NAME);
+
/* Open the preference file */
fff = fopen(foo, "r");
- if( fff )
- {
- /* Success */
- oops = FALSE;
- }
- else
- {
- oops = TRUE;
- }
+ /* Success */
+ oops = FALSE;
}
}
#endif /* USE_SFL_CODE */
+#if TARGET_API_MAC_CARBON
+#else
+ /* Oops */
+ if (oops)
+ {
+ /* Save */
+ HGetVol(0, &savev, &saved);
+
+ /* Go to the "system" folder */
+ SysEnvirons(curSysEnvVers, &env);
+ SetVol(0, env.sysVRefNum);
+
+ /* Open the file */
+ fff = fopen(PREF_FILE_NAME, "r");
+
+ /* Restore */
+ HSetVol(0, savev, saved);
+ }
+#endif
+
/* Load preferences */
if (fff)
{
Term_activate(td->t);
}
-#ifdef JP
static void init_sound( void )
{
int err, i;
pb.ioVRefNum = app_vol;
pb.ioDrDirID = app_dir;
pb.ioFDirIndex = 0;
-
- for( i = 0 ; i < 7 ; i++ )
- soundmode[i] = true;
-
+
/* Check for errors */
err = PBGetCatInfo((CInfoPBPtr)&pb, FALSE);
ext_sound = 1;
for( i = 0 ; i < 7 ; i++ )
- soundmode[i] = false;
+ soundmode[i] = false;
for( i = 1 ; i < SOUND_MAX ; i++ ){
/* Get the proper sound name */
}
}
+static void init_graf( void )
+{
+ int err, i;
+ DirInfo pb;
+ SignedByte permission = fsRdPerm;
+ pascal short ret;
+
+ Handle handle;
+ Str255 graf;
+
+ /* Descend into "lib" folder */
+ pb.ioCompletion = NULL;
+ pb.ioNamePtr = "\plib";
+ pb.ioVRefNum = app_vol;
+ pb.ioDrDirID = app_dir;
+ pb.ioFDirIndex = 0;
+
+ /* Check for errors */
+ err = PBGetCatInfo((CInfoPBPtr)&pb, FALSE);
+
+ /* Success */
+ if ((err == noErr) && (pb.ioFlAttrib & 0x10))
+ {
+ /* Descend into "lib/xtra" folder */
+ pb.ioCompletion = NULL;
+ pb.ioNamePtr = "\pxtra";
+ pb.ioVRefNum = app_vol;
+ pb.ioDrDirID = pb.ioDrDirID;
+ pb.ioFDirIndex = 0;
+
+ /* Check for errors */
+ err = PBGetCatInfo((CInfoPBPtr)&pb, FALSE);
+
+ /* Success */
+ if ((err == noErr) && (pb.ioFlAttrib & 0x10))
+ {
+ /* Descend into "lib/xtra/graf" folder */
+ pb.ioCompletion = NULL;
+ pb.ioNamePtr = "\pgraf";
+ pb.ioVRefNum = app_vol;
+ pb.ioDrDirID = pb.ioDrDirID;
+ pb.ioFDirIndex = 0;
+
+ /* Check for errors */
+ err = PBGetCatInfo((CInfoPBPtr)&pb, FALSE);
+
+ /* Success */
+ if ((err == noErr) && (pb.ioFlAttrib & 0x10))
+ {
+ ret = HOpenResFile( app_vol , pb.ioDrDirID , "\pgraf.rsrc" , permission );
+ if (ret != -1)
+ {
+ ext_graf = 1;
+
+ /* Obtain resource XXX XXX XXX */
+ handle = Get1NamedResource('PICT', graf);
+ if ( handle == NULL || ext_graf )
+ handle = GetNamedResource('PICT', "\pgraf.rsrc");
+ }
+ }
+ }
+ }
+}
+
#ifdef CHUUKEI
/*
case 'c':
{
- if (!tmp[2]) break;
chuukei_client = TRUE;
connect_chuukei_server(&tmp[2]);
play_game(FALSE);
for( i = 1 ; i < 7 ; i++ )
SetCheck( dialog, i+2 , soundmode[i] );
-// ShowWindow(dialog);
+ ShowWindow(dialog);
for( item_hit = 100 ; cancel < item_hit ; ){
ModalDialog(0, &item_hit);
}
-#endif
/*
* Exit the program
/* Assume failure */
fff = NULL;
-#if defined(MACINTOSH) && !defined(applec)
/* Text file */
_ftype = 'TEXT';
-#endif
#ifdef USE_SFL_CODE
ptocstr((StringPtr)foo);
/* Append the preference file name */
-#ifdef JP
- strcat(foo, "Hengband Preferences");
-#else
- strcat(foo, "Angband Preferences");
-#endif
+ strcat(foo, PREF_FILE_NAME);
+
/* Open the preference file */
- fff = fopen(foo, "w");
+ /* my_fopen set file type and file creator for MPW */
+ fff = my_fopen(foo, "w");
/* Success */
oops = FALSE;
#endif /* USE_SFL_CODE */
+#if TARGET_API_MAC_CARBON
+#else
+ /* Oops */
+ if (oops)
+ {
+ /* Save */
+ HGetVol(0, &savev, &saved);
+
+ /* Go to "system" folder */
+ SysEnvirons(curSysEnvVers, &env);
+ SetVol(0, env.sysVRefNum);
+
+ /* Open the preference file */
+ /* my_fopen set file type and file creator for MPW */
+ fff = fopen(PREF_FILE_NAME, "w");
+
+ /* Restore */
+ HSetVol(0, savev, saved);
+ }
+#endif
+
/* Save preferences */
if (fff)
{
/*
* Handle menu: "File" + "Open"
*/
+#if TARGET_API_MAC_CARBON
static void do_menu_file_open(bool all)
{
int err;
/* Hack -- quit */
quit(NULL);
}
+#else
+static void do_menu_file_open(bool all)
+{
+ int err;
+ short vrefnum;
+ long drefnum;
+ long junk;
+ DirInfo pb;
+ SFTypeList types;
+ SFReply reply;
+ Point topleft;
+
+
+ /* XXX XXX XXX */
+
+ /* vrefnum = GetSFCurVol(); */
+ vrefnum = -*((short*)0x214);
+
+ /* drefnum = GetSFCurDir(); */
+ drefnum = *((long*)0x398);
+
+ /* Descend into "lib" folder */
+ pb.ioCompletion = NULL;
+ pb.ioNamePtr = "\plib";
+ pb.ioVRefNum = vrefnum;
+ pb.ioDrDirID = drefnum;
+ pb.ioFDirIndex = 0;
+
+ /* Check for errors */
+ err = PBGetCatInfo((CInfoPBPtr)&pb, FALSE);
+
+ /* Success */
+ if ((err == noErr) && (pb.ioFlAttrib & 0x10))
+ {
+ /* Descend into "lib/save" folder */
+ pb.ioCompletion = NULL;
+ pb.ioNamePtr = "\psave";
+ pb.ioVRefNum = vrefnum;
+ pb.ioDrDirID = pb.ioDrDirID;
+ pb.ioFDirIndex = 0;
+
+ /* Check for errors */
+ err = PBGetCatInfo((CInfoPBPtr)&pb, FALSE);
+
+ /* Success */
+ if ((err == noErr) && (pb.ioFlAttrib & 0x10))
+ {
+ /* SetSFCurDir(pb.ioDrDirID); */
+ *((long*)0x398) = pb.ioDrDirID;
+ }
+ }
+
+ /* Window location */
+ topleft.h = (qd.screenBits.bounds.left+qd.screenBits.bounds.right)/2-344/2;
+ topleft.v = (2*qd.screenBits.bounds.top+qd.screenBits.bounds.bottom)/3-188/2;
+
+ /* Allow "all" files */
+ if (all)
+ {
+ /* Get any file */
+ SFGetFile(topleft, "\p", NULL, -1, types, NULL, &reply);
+ }
+
+ /* Allow "save" files */
+ else
+ {
+ /* Legal types */
+ types[0] = 'SAVE';
+
+ /* Get a file */
+ SFGetFile(topleft, "\p", NULL, 1, types, NULL, &reply);
+ }
+
+ /* Allow cancel */
+ if (!reply.good) return;
+
+ /* Extract textual file name for save file */
+ GetWDInfo(reply.vRefNum, &vrefnum, &drefnum, &junk);
+ refnum_to_name(savefile, drefnum, vrefnum, (char*)reply.fName);
+
+ /* Hack */
+ HiliteMenu(0);
+
+ /* Game is in progress */
+ game_in_progress = 1;
+
+ /* Flush input */
+ flush();
+
+ /* Play a game */
+ play_game(FALSE);
+
+ /* Hack -- quit */
+ quit(NULL);
+}
+#endif
/*
Rect r;
WindowPtr tmpw;
- long response;
+
MenuHandle m;
OSErr err;
+ long response;
/* Get the "apple" menu */
m = GetMenu(128);
InsertMenu(m, 0);
/* Add the DA's to the "apple" menu */
-// AppendResMenu (m, 'DRVR'); //AddResMenu(m, 'DRVR');
-
+#if TARGET_API_MAC_CARBON
+#else
+ AppendResMenu (m, 'DRVR');
+#endif
/* Get the "File" menu */
#if TARGET_API_MAC_CARBON
#else
m = GetMenu(129);
#endif
+
/* Insert the menu */
InsertMenu(m, 0);
/* Make the "Font" menu */
-#ifdef JP
+ #ifdef JP
m = NewMenu(131, "\p¥Õ¥©¥ó¥È");
-#else
+ #else
m = NewMenu(131, "\pFont");
-#endif
+ #endif
/* Insert the menu */
InsertMenu(m, 0);
AppendResMenu(m, 'FONT'); //AddResMenu(m, 'FONT');
/* Size of menu */
+#if TARGET_API_MAC_CARBON
n = CountMenuItems(m);
+#else
+ n = CountMItems(m);
+#endif
/* Scan the menu */
for (i = n; i >= 4; i--)
AppendMenu(m, "\parg_wizard");
AppendMenu(m, "\p-");
AppendMenu(m, "\p¥µ¥¦¥ó¥ÉÀßÄê...");
+ AppendMenu(m, "\p16X16¥°¥é¥Õ¥£¥Ã¥¯");
+ AppendMenu(m, "\p£²ÇÜÉý¥¿¥¤¥ëɽ¼¨");
#else
AppendMenu(m, "\parg_sound");
AppendMenu(m, "\parg_graphics");
AppendMenu(m, "\p-");
AppendMenu(m, "\parg_fiddle");
AppendMenu(m, "\parg_wizard");
+ AppendMenu(m, "\p-");
+ AppendMenu(m, "\pSound config");
+ AppendMenu(m, "\pAdam Bolt tile");
+ AppendMenu(m, "\pBigtile Mode");
#endif
/* Make the "TileWidth" menu */
/* File menu */
- m = GetMenuHandle(129); //m = GetMHandle(129);
+ m = GetMenuHandle(129);
/* Get menu size */
+#if TARGET_API_MAC_CARBON
n = CountMenuItems(m);
+#else
+ n = CountMItems(m);
+#endif
/* Reset menu */
for (i = 1; i <= n; i++)
{
/* Reset */
+#if TARGET_API_MAC_CARBON
DisableMenuItem(m, i);
CheckMenuItem(m, i, FALSE);
+#else
+ DisableItem(m, i);
+ CheckItem(m, i, FALSE);
+#endif
}
/* Enable "new"/"open..."/"import..." */
if (initialized && !game_in_progress)
{
+#if TARGET_API_MAC_CARBON
EnableMenuItem(m, 1);
EnableMenuItem(m, 2);
EnableMenuItem(m, 3);
+#else
+ EnableItem(m, 1);
+ EnableItem(m, 2);
+ EnableItem(m, 3);
+#endif
}
/* Enable "close" */
if (initialized)
{
+#if TARGET_API_MAC_CARBON
EnableMenuItem(m, 4);
+#else
+ EnableItem(m, 4);
+#endif
}
/* Enable "save" */
if (initialized && character_generated)
{
+#if TARGET_API_MAC_CARBON
EnableMenuItem(m, 5);
+#else
+ EnableItem(m, 5);
+#endif
}
/* Enable "quit" */
if (TRUE)
{
+#if TARGET_API_MAC_CARBON
EnableMenuItem(m, 7);
+#else
+ EnableItem(m, 7);
+#endif
}
m = GetMenuHandle(130); //m = GetMHandle(130);
/* Get menu size */
+#if TARGET_API_MAC_CARBON
n = CountMenuItems(m);
+#else
+ n = CountMItems(m);
+#endif
/* Reset menu */
for (i = 1; i <= n; i++)
{
/* Reset */
+#if TARGET_API_MAC_CARBON
DisableMenuItem(m, i);
CheckMenuItem(m, i, FALSE);
+#else
+ DisableItem(m, i);
+ CheckItem(m, i, FALSE);
+#endif
}
/* Enable "edit" options if "needed" */
if (!td)
{
+#if TARGET_API_MAC_CARBON
EnableMenuItem(m, 1);
EnableMenuItem(m, 3);
EnableMenuItem(m, 4);
EnableMenuItem(m, 5);
EnableMenuItem(m, 6);
+#else
+ EnableItem(m, 1);
+ EnableItem(m, 3);
+ EnableItem(m, 4);
+ EnableItem(m, 5);
+ EnableItem(m, 6);
+#endif
}
m = GetMenuHandle(131); //m = GetMHandle(131);
/* Get menu size */
+#if TARGET_API_MAC_CARBON
n = CountMenuItems(m);
+#else
+ n = CountMItems(m);
+#endif
/* Reset menu */
for (i = 1; i <= n; i++)
{
/* Reset */
+#if TARGET_API_MAC_CARBON
DisableMenuItem(m, i);
CheckMenuItem(m, i, FALSE);
+#else
+ DisableItem(m, i);
+ CheckItem(m, i, FALSE);
+#endif
}
/* Hack -- look cute XXX XXX */
/* Active window */
if (td)
{
+#if TARGET_API_MAC_CARBON
/* Enable "bold" */
EnableMenuItem(m, 1);
/* Analyze font */
/* GetMenuItemText(m,i,s); */
GetMenuItemText(m, i, s); //GetItem(m, i, s);
-#if TARGET_API_MAC_CARBON
- value = FMGetFontFamilyFromName( s );
-#else
GetFNum(s, &value);
-#endif
/* Check active font */
if (td->font_id == value) CheckMenuItem(m, i, TRUE);
}
+#else
+ /* Enable "bold" */
+ EnableItem(m, 1);
+
+ /* Enable "extend" */
+ EnableItem(m, 2);
+
+ /* Check the appropriate "bold-ness" */
+ if (td->font_face & bold) CheckItem(m, 1, TRUE);
+
+ /* Check the appropriate "wide-ness" */
+ if (td->font_face & extend) CheckItem(m, 2, TRUE);
+
+ /* Analyze fonts */
+ for (i = 4; i <= n; i++)
+ {
+ /* Enable it */
+ EnableItem(m, i);
+
+ /* Analyze font */
+ /* GetMenuItemText(m,i,s); */
+ GetMenuItemText(m, i, s); //GetItem(m, i, s);
+ GetFNum(s, &value);
+
+ /* Check active font */
+ if (td->font_id == value) CheckItem(m, i, TRUE);
+ }
+#endif
}
m = GetMenuHandle(132); //m = GetMHandle(132);
/* Get menu size */
+#if TARGET_API_MAC_CARBON
n = CountMenuItems(m);
+#else
+ n = CountMItems(m);
+#endif
/* Reset menu */
for (i = 1; i <= n; i++)
{
/* Reset */
+#if TARGET_API_MAC_CARBON
DisableMenuItem(m, i);
CheckMenuItem(m, i, FALSE);
+#else
+ DisableItem(m, i);
+ CheckItem(m, i, FALSE);
+#endif
}
/* Active window */
/* Analyze sizes */
for (i = 1; i <= n; i++)
{
+#if TARGET_API_MAC_CARBON
/* Analyze size */
/* GetMenuItemText(m,i,s); */
- GetMenuItemText(m, i, s); //GetItem(m, i, s);
+ GetMenuItemText(m, i, s);
s[s[0]+1] = '\0';
value = atoi((char*)(s+1));
/* Check the current size */
if (td->font_size == value) CheckMenuItem(m, i, TRUE);
+#else
+ /* Analyze size */
+ /* GetMenuItemText(m,i,s); */
+ GetMenuItemText(m, i, s); //GetItem(m, i, s);
+ s[s[0]+1] = '\0';
+ value = atoi((char*)(s+1));
+
+ /* Enable the "real" sizes */
+ if (RealFont(td->font_id, value)) EnableItem(m, i);
+
+ /* Check the current size */
+ if (td->font_size == value) CheckItem(m, i, TRUE);
+#endif
}
}
m = GetMenuHandle(133); //m = GetMHandle(133);
/* Get menu size */
+#if TARGET_API_MAC_CARBON
n = CountMenuItems(m);
+#else
+ n = CountMItems(m);
+#endif
/* Check active windows */
for (i = 1; i <= n; i++)
{
/* Check if needed */
+#if TARGET_API_MAC_CARBON
CheckMenuItem(m, i, data[i-1].mapped);
+#else
+ CheckItem(m, i, data[i-1].mapped);
+#endif
}
m = GetMenuHandle(134); //m = GetMHandle(134);
/* Get menu size */
+#if TARGET_API_MAC_CARBON
n = CountMenuItems(m);
+#else
+ n = CountMItems(m);
+#endif
/* Reset menu */
for (i = 1; i <= n; i++)
{
/* Reset */
+#if TARGET_API_MAC_CARBON
DisableMenuItem(m, i);
CheckMenuItem(m, i, FALSE);
+#else
+ DisableItem(m, i);
+ CheckItem(m, i, FALSE);
+#endif
}
+#if TARGET_API_MAC_CARBON
/* Item "arg_sound" */
EnableMenuItem(m, 1);
CheckMenuItem(m, 1, arg_sound);
EnableMenuItem(m, 5);
CheckMenuItem(m, 5, arg_wizard);
-#ifdef JP
/* Item "SoundSetting" */
EnableMenuItem(m, 7);
-#endif
- /* Item "Hack" */
- /* EnableItem(m, 9); */
+ /* Item NewStyle Graphics */
+ EnableMenuItem(m, 8);
+ CheckMenuItem(m, 8, use_newstyle_graphics);
+
+ /* Item Bigtile Mode */
+ EnableMenuItem(m, 9);
+ CheckMenuItem(m, 9, arg_bigtile);
+#else
+ /* Item "arg_sound" */
+ EnableItem(m, 1);
+ CheckItem(m, 1, arg_sound);
+
+ /* Item "arg_graphics" */
+ EnableItem(m, 2);
+ CheckItem(m, 2, arg_graphics);
+
+ /* Item "arg_fiddle" */
+ EnableItem(m, 4);
+ CheckItem(m, 4, arg_fiddle);
+
+ /* Item "arg_wizard" */
+ EnableItem(m, 5);
+ CheckItem(m, 5, arg_wizard);
+
+ /* Item "SoundSetting" */
+ EnableItem(m, 7);
+
+ /* Item NewStyle Graphics */
+ EnableItem(m, 8);
+ CheckItem(m, 8, use_newstyle_graphics);
+
+ /* Item Bigtile Mode */
+ EnableItem(m, 9);
+ CheckItem(m, 9, arg_bigtile);
+#endif
/* TileWidth menu */
m = GetMenuHandle(135); //m = GetMHandle(135);
/* Get menu size */
+#if TARGET_API_MAC_CARBON
n = CountMenuItems(m);
+#else
+ n = CountMItems(m);
+#endif
/* Reset menu */
for (i = 1; i <= n; i++)
{
/* Reset */
+#if TARGET_API_MAC_CARBON
DisableMenuItem(m, i);
CheckMenuItem(m, i, FALSE);
+#else
+ DisableItem(m, i);
+ CheckItem(m, i, FALSE);
+#endif
}
/* Active window */
s[s[0]+1] = '\0';
value = atoi((char*)(s+1));
+#if TARGET_API_MAC_CARBON
/* Enable */
EnableMenuItem(m, i);
/* Check the current size */
if (td->tile_wid == value) CheckMenuItem(m, i, TRUE);
+#else
+ /* Enable */
+ EnableItem(m, i);
+
+ /* Check the current size */
+ if (td->tile_wid == value) CheckItem(m, i, TRUE);
+#endif
}
}
m = GetMenuHandle(136); //m = GetMHandle(136);
/* Get menu size */
+#if TARGET_API_MAC_CARBON
n = CountMenuItems(m);
+#else
+ n = CountMItems(m);
+#endif
/* Reset menu */
for (i = 1; i <= n; i++)
{
/* Reset */
+#if TARGET_API_MAC_CARBON
DisableMenuItem(m, i);
CheckMenuItem(m, i, FALSE);
+#else
+ DisableItem(m, i);
+ CheckItem(m, i, FALSE);
+#endif
}
/* Active window */
s[s[0]+1] = '\0';
value = atoi((char*)(s+1));
+#if TARGET_API_MAC_CARBON
/* Enable */
EnableMenuItem(m, i);
/* Check the current size */
if (td->tile_hgt == value) CheckMenuItem(m, i, TRUE);
+#else
+ /* Enable */
+ EnableItem(m, i);
+
+ /* Check the current size */
+ if (td->tile_hgt == value) CheckItem(m, i, TRUE);
+#endif
}
}
}
case 128:
{
/* About Angband... */
+#if TARGET_API_MAC_CARBON
+ if (selection == 1)
+ {
+ DialogPtr dialog;
+ short item_hit;
+
+ /* Get the about dialogue */
+ dialog=GetNewDialog(128, 0, (WindowPtr)-1);
+
+ /* Move it to the middle of the screen */
+ RepositionWindow(
+ GetDialogWindow(dialog),
+ NULL,
+ kWindowCenterOnMainScreen);
+
+ /* Show the dialog */
+ TransitionWindow(GetDialogWindow(dialog),
+ kWindowZoomTransitionEffect,
+ kWindowShowTransitionAction,
+ NULL);
+
+ /* Wait for user to click on it */
+ ModalDialog(0, &item_hit);
+
+ /* Free the dialogue */
+ DisposeDialog(dialog);
+ break;
+ }
+#else
if (selection == 1)
{
- GrafPtr savePort;
- DialogPtr dialog;
- short item_hit;
- WindowPtr window;
- char errString[100];
+ DialogPtr dialog;
Rect r;
- InitCursor( );
- dialog = GetNewDialog(128, 0, (WindowPtr)-1);
- // GetPortBounds( dialog->portRect, kWindowContentRgn, &r );
- // r=dialog->portRect;
- // center_rect(&r, &qd.screenBits.bounds);
- // MoveWindow(dialog, r.left, r.top, 1);
- // ShowWindow(dialog);
- // GetPort(&savePort);
-
- // window = GetDialogWindow( dialog );
- // SetPort( (GrafPtr)GetWindowPort( window ));
+ short item_hit;
- // for(;;){
- ModalDialog(0, &item_hit);
-
- /* sprintf(errString, "%d", item_hit);
- if( 1000 > item_hit )
- mac_warning(errString);
- if( item_hit == 128 )
- break;
- }
- SetPort(savePort);*/
- DisposeDialog(dialog); //DisposDialog(dialog);
+ dialog=GetNewDialog(128, 0, (WindowPtr)-1);
+
+ r=dialog->portRect;
+ center_rect(&r, &qd.screenBits.bounds);
+ MoveWindow(dialog, r.left, r.top, 1);
+ ShowWindow(dialog);
+ ModalDialog(0, &item_hit);
+ DisposeDialog(dialog);
break;
}
-#if TARGET_API_MAC_CARBON
-#else
/* Desk accessory */
- GetMenuItemText(GetMenuHandle(128),selection,s);
- /* GetMenuItem(GetMenuHandle(128), selection, s); */
+ /* GetMenuItemText(GetMHandle(128),selection,s); */
+ GetMenuItemText(GetMenuHandle(128), selection, s);
OpenDeskAcc(s);
-#endif
break;
+#endif
}
/* File Menu */
#endif
break;
}
-
/* Hack -- Forget messages */
msg_flag = FALSE;
/* Save the game */
+#if 0
do_cmd_save_game(FALSE);
+#endif
+ Term_key_push(SPECIAL_KEY_QUIT);
+ break;
}
/* Quit */
td->font_face |= bold;
}
-#ifdef JP
/* Tile Width Hight Init */
td->tile_wid = td->tile_hgt = 0;
-#endif
+
/* Apply and Verify */
term_data_check_font(td);
term_data_check_size(td);
td->font_face |= extend;
}
-#ifdef JP
/* Tile Width Hight Init */
td->tile_wid = td->tile_hgt = 0;
-#endif
+
/* Apply and Verify */
term_data_check_font(td);
term_data_check_size(td);
/* Get a new font name */
/* GetMenuItemText(GetMHandle(131), selection, s); */
GetMenuItemText(GetMenuHandle(131), selection, s); //GetItem(GetMHandle(131), selection, s);
-#if TARGET_API_MAC_CARBON
- fid = FMGetFontFamilyFromName( s );
-#else
GetFNum(s, &fid);
-#endif
/* Save the new font id */
td->font_id = fid;
}
}
-#ifdef JP
/* Tile Width Hight Init */
td->tile_wid = td->tile_hgt = 0;
-#endif
+
/* Apply and Verify */
term_data_check_font(td);
term_data_check_size(td);
s[s[0]+1]=0;
td->font_size = atoi((char*)(s+1));
-#ifdef JP
/* Tile Width Hight Init */
td->tile_wid = td->tile_hgt = 0;
-#endif
+
/* Apply and Verify */
term_data_check_font(td);
term_data_check_size(td);
/* Show the window */
ShowWindow(td->w);
-
+
/* Bring to the front */
SelectWindow(td->w);
arg_wizard = !arg_wizard;
break;
}
-#ifdef JP
+
case 7:
{
SoundConfigDLog();
+ break;
+ }
+ case 8:
+ {
+ if (streq(ANGBAND_GRAF, "old"))
+ {
+ ANGBAND_GRAF = "new";
+ arg_newstyle_graphics = true;
+ grafWidth = grafHeight = 16;
+ pictID = 1002;
+ }
+ else
+ {
+ ANGBAND_GRAF = "old";
+ arg_newstyle_graphics = false;
+ grafWidth = grafHeight = 8;
+ pictID = 1001;
+ }
+
+ /* Hack -- Force redraw */
+ Term_key_push(KTRL('R'));
+ break;
}
+
+ case 9: /* bigtile mode */
+ {
+ term_data *td = &data[0];
+
+ if (!can_save){
+#ifdef JP
+ plog("º£¤ÏÊѹ¹½ÐÍè¤Þ¤»¤ó¡£");
+#else
+ plog("You may not do that right now.");
#endif
+ break;
+ }
+
+ /* Toggle "arg_bigtile" */
+ arg_bigtile = !arg_bigtile;
+
+ /* Activate */
+ Term_activate(td->t);
+
+ /* Resize the term */
+ Term_resize(td->cols, td->rows);
+
+ break;
+ }
+
}
break;
* Apple Event Handler -- Open Application
*/
static pascal OSErr AEH_Start(const AppleEvent *theAppleEvent,
- AppleEvent *reply, long handlerRefCon)
+ const AppleEvent *reply, long handlerRefCon)
{
#pragma unused(reply, handlerRefCon)
* Apple Event Handler -- Quit Application
*/
static pascal OSErr AEH_Quit(const AppleEvent *theAppleEvent,
- AppleEvent *reply, long handlerRefCon)
+ const AppleEvent *reply, long handlerRefCon)
{
#pragma unused(reply, handlerRefCon)
#if TARGET_API_MAC_CARBON
+
/* Save the game (if necessary) */
if (game_in_progress && character_generated)
{
- /* Hack -- Forget messages */
- msg_flag = FALSE;
-
- /* Save the game */
- do_cmd_save_game(FALSE);
- }
+ if (!can_save){
+#ifdef JP
+ plog("º£¤Ï¥»¡¼¥Ö¤¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£");
+#else
+ plog("You may not do that right now.");
+#endif
+ return;
+ }
+ /* Hack -- Forget messages */
+ msg_flag = FALSE;
- /* Quit */
- quit(NULL);
+ /* Save the game */
+#if 0
+ do_cmd_save_game(FALSE);
#endif
+ Term_key_push(SPECIAL_KEY_QUIT);
+ return;
+ }
+
+ /* Quit */
+ quit(NULL);
+#else
/* Quit later */
quit_when_ready = TRUE;
-
+
/* Check arguments */
return (CheckRequiredAEParams(theAppleEvent));
+#endif
}
* Apple Event Handler -- Print Documents
*/
static pascal OSErr AEH_Print(const AppleEvent *theAppleEvent,
- AppleEvent *reply, long handlerRefCon)
+ const AppleEvent *reply, long handlerRefCon)
{
#pragma unused(theAppleEvent, reply, handlerRefCon)
* snippet from Think Reference 2.0. (The prior sentence could read
* "shamelessly swiped & hacked")
*/
-static pascal OSErr AEH_Open(const AppleEvent *theAppleEvent,
+static pascal OSErr AEH_Open(AppleEvent *theAppleEvent,
AppleEvent* reply, long handlerRefCon)
{
#pragma unused(reply, handlerRefCon)
#endif
/* Get an event (or null) */
- WaitNextEvent( everyEvent, &event, 1L, 0L );
- //GetNextEvent(everyEvent, &event);
+ GetNextEvent(everyEvent, &event);
/* Hack -- Nothing is ready yet */
if (event.what == nullEvent) return (FALSE);
/* Hack -- Prepare the menus */
setup_menus();
- /* Mega-Hack -- allow easy exit if nothing to save */
-// if (!character_generated && (ch=='Q' || ch=='q')) ch = 'e';
-
/* Run the Menu-Handler */
menu(MenuKey(ch));
break;
}
#endif
+
case inDrag:
{
Point p;
WindowPtr old_win;
-
BitMap screen;
Rect portRect;
-
-#if TARGET_API_MAC_CARBON
-
+#if TARGET_API_MAC_CARBON
GetQDGlobalsScreenBits( &screen );
#else
screen = qd.screenBits;
#endif
-
r = screen.bounds;
r.top += 20; /* GetMBarHeight() XXX XXX XXX */
InsetRect(&r, 4, 4);
s16b x, y;
term *old = Term;
-
+ BitMap screen;
+
+#if TARGET_API_MAC_CARBON
+ GetQDGlobalsScreenBits( &screen );
+#else
+ screen = qd.screenBits;
+#endif
/* Oops */
if (!td) break;
/* Fake rectangle */
r.left = 20 * td->tile_wid + td->size_ow1;
- r.right = 80 * td->tile_wid + td->size_ow1 + td->size_ow2 + 1;
+ r.right = screen.bounds.right;
r.top = 1 * td->tile_hgt + td->size_oh1;
- r.bottom = 24 * td->tile_hgt + td->size_oh1 + td->size_oh2 + 1;
+ r.bottom = screen.bounds.bottom;
/* Grow the rectangle */
newsize = GrowWindow(w, event.where, &r);
/* Apply and Verify */
term_data_check_size(td);
-
/* Activate */
Term_activate(td->t);
/* Disk Event -- From "Maarten Hazewinkel" */
case diskEvt:
{
- /* check for error when mounting the disk */
-
+
#if TARGET_API_MAC_CARBON
#else
+ /* check for error when mounting the disk */
if (HiWord(event.message) != noErr)
{
Point p =
/* Resuming: activate the front window */
if (event.message & resumeFlag)
{
-
#if TARGET_API_MAC_CARBON
- {
- Cursor arrow;
+ Cursor arrow;
- SetPortWindowPort( FrontWindow() );
-
- GetQDGlobalsArrow( &arrow );
- SetCursor(&arrow);
- }
+ SetPortWindowPort( FrontWindow() );
+
+ GetQDGlobalsArrow( &arrow );
+ SetCursor(&arrow);
#else
SetPort(FrontWindow());
-
- SetCursor( &qd.arrow );
+ SetCursor(&qd.arrow);
#endif
}
/* Process apple events */
if (AEProcessAppleEvent(&event) != noErr)
{
-#ifdef JP
+ #ifdef JP
plog("Apple Event Handler¤Î¥¨¥é¡¼¤Ç¤¹.");
-#else
+ #else
plog("Error in Apple Event Handler!");
-#endif
+ #endif
}
/* Handle "quit_when_ready" */
/* Handle "open_when_ready" */
handle_open_when_ready();
#endif
+
break;
}
*/
static void init_stuff(void)
{
+ int i;
+
+ short vrefnum;
+ long drefnum;
+ long junk;
+
+ SFTypeList types;
+ SFReply reply;
+
Rect r;
- BitMap tBitMap;
- Rect screenRect;
Point topleft;
char path[1024];
+ BitMap screen;
+ Rect screenRect;
+
+#if TARGET_API_MAC_CARBON
OSErr err = noErr;
NavDialogOptions dialogOptions;
FSSpec theFolderSpec;
NavReplyRecord theReply;
-
-
+#endif
/* Fake rectangle */
r.left = 0;
r.top = 0;
r.bottom = 188;
/* Center it */
- screenRect = GetQDGlobalsScreenBits(&tBitMap)->bounds;
+#if TARGET_API_MAC_CARBON
+ screenRect = GetQDGlobalsScreenBits(&screen)->bounds;
+#else
+ screenRect = qd.screenBits.bounds;
+#endif
center_rect(&r, &screenRect);
/* Extract corner */
init_file_paths(path);
/* Build the filename */
- #ifdef JP
- path_build(path, sizeof(path), ANGBAND_DIR_FILE, "news_j.txt");
- #else
- path_build(path, sizeof(path), ANGBAND_DIR_FILE, "news.txt");
- #endif
+#ifdef JP
+ path_build(path, sizeof(path), ANGBAND_DIR_FILE, "news_j.txt");
+#else
+ path_build(path, sizeof(path), ANGBAND_DIR_FILE, "news.txt");
+#endif
/* Attempt to open and close that file */
if (0 == fd_close(fd_open(path, O_RDONLY))) break;
/* Warning */
- #ifdef JP
- plog_fmt("'%s' ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó½ÐÍè¤Þ¤»¤ó.", path);
- #else
- plog_fmt("Unable to open the '%s' file.", path);
- #endif
+#ifdef JP
+ plog_fmt("'%s' ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó½ÐÍè¤Þ¤»¤ó.", path);
+#else
+ plog_fmt("Unable to open the '%s' file.", path);
+#endif
/* Warning */
- #ifdef JP
- plog("Hengband¥Õ¥©¥ë¥ÀÆâ¤Î'lib'¥Õ¥©¥ë¥À¤¬Â¸ºß¤·¤Ê¤¤¤«Àµ¤·¤¯Ìµ¤¤²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹.");
- #else
- plog("The Angband 'lib' folder is probably missing or misplaced.");
- #endif
+#ifdef JP
+ plog("Hengband¤Î'lib'¥Õ¥©¥ë¥À¤¬Â¸ºß¤·¤Ê¤¤¤«Àµ¤·¤¯Ìµ¤¤²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹.");
+#else
+ plog("The Angband 'lib' folder is probably missing or misplaced.");
+#endif
+ /* Warning */
+#ifdef JP
+ plog("Please 'open' any file in any sub-folder of the 'lib' folder.");
+#else
+ plog("Please 'open' any file in any sub-folder of the 'lib' folder.");
+#endif
+
+#if TARGET_API_MAC_CARBON
/* Ask the user to choose the lib folder */
err = NavGetDefaultDialogOptions(&dialogOptions);
theFolderSpec.parID,
theFolderSpec.vRefNum,
(char *)theFolderSpec.name);
+#else
+ /* Allow "text" files */
+ types[0] = 'TEXT';
+
+ /* Allow "save" files */
+ types[1] = 'SAVE';
+
+ /* Allow "data" files */
+ types[2] = 'DATA';
+
+ /* Get any file */
+ SFGetFile(topleft, "\p", NULL, 3, types, NULL, &reply);
+
+ /* Allow cancel */
+ if (!reply.good) quit(NULL);
+
+ /* Extract textual file name for given file */
+ GetWDInfo(reply.vRefNum, &vrefnum, &drefnum, &junk);
+ refnum_to_name(path, drefnum, vrefnum, (char*)reply.fName);
+#endif
+
+ /* Hack -- Remove the "filename" */
+ i = strlen(path) - 1;
+ while ((i > 0) && (path[i] != ':')) i--;
+ if (path[i] == ':') path[i+1] = '\0';
+
+ /* Hack -- allow "lib" folders */
+ if (suffix(path, "lib:")) continue;
+
+ /* Hack -- Remove the "sub-folder" */
+ i = i - 1;
+ while ((i > 1) && (path[i] != ':')) i--;
+ if (path[i] == ':') path[i+1] = '\0';
}
}
#ifndef TARGET_API_MAC_CARBON
/* Increase stack space by 64K */
- SetApplLimit(GetApplLimit() - 65536L);
+ SetApplLimit(GetApplLimit() - 131072L);//65536L);
/* Stretch out the heap to full size */
MaxApplZone();
#ifdef JP
KeyScript(smRoman);
#endif
-
+
/* Flush events */
FlushEvents(everyEvent, 0);
# else
-#ifndef TARGET_API_MAC_CARBON
/* Block */
if (TRUE)
{
#endif
}
}
-#endif /* !Carbon */
# endif
#endif /* ANGBAND_LITE_MAC */
-
+
#ifdef USE_SFL_CODE
+#if TARGET_API_MAC_CARBON
/* Obtain a "Universal Procedure Pointer" */
-// AEH_Start_UPP = NewAEEventHandlerProc(AEH_Start);
AEH_Start_UPP = NewAEEventHandlerUPP(AEH_Start);
/* Install the hook (ignore error codes) */
AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, AEH_Start_UPP,
0L, FALSE);
/* Obtain a "Universal Procedure Pointer" */
-// AEH_Quit_UPP = NewAEEventHandlerProc(AEH_Quit);
AEH_Quit_UPP = NewAEEventHandlerUPP(AEH_Quit);
/* Install the hook (ignore error codes) */
AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, AEH_Quit_UPP,
0L, FALSE);
/* Obtain a "Universal Procedure Pointer" */
-// AEH_Print_UPP = NewAEEventHandlerProc(AEH_Print);
AEH_Print_UPP = NewAEEventHandlerUPP(AEH_Print);
/* Install the hook (ignore error codes) */
AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, AEH_Print_UPP,
0L, FALSE);
/* Obtain a "Universal Procedure Pointer" */
-// AEH_Open_UPP = NewAEEventHandlerProc(AEH_Open);
AEH_Open_UPP = NewAEEventHandlerUPP(AEH_Open);
/* Install the hook (ignore error codes) */
AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, AEH_Open_UPP,
0L, FALSE);
+#else
+ /* Obtain a "Universal Procedure Pointer" */
+ AEH_Start_UPP = NewAEEventHandlerProc(AEH_Start);
+
+ /* Install the hook (ignore error codes) */
+ AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, AEH_Start_UPP,
+ 0L, FALSE);
+
+ /* Obtain a "Universal Procedure Pointer" */
+ AEH_Quit_UPP = NewAEEventHandlerProc(AEH_Quit);
+
+ /* Install the hook (ignore error codes) */
+ AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, AEH_Quit_UPP,
+ 0L, FALSE);
+
+ /* Obtain a "Universal Procedure Pointer" */
+ AEH_Print_UPP = NewAEEventHandlerProc(AEH_Print);
+
+ /* Install the hook (ignore error codes) */
+ AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, AEH_Print_UPP,
+ 0L, FALSE);
+
+ /* Obtain a "Universal Procedure Pointer" */
+ AEH_Open_UPP = NewAEEventHandlerProc(AEH_Open);
+ /* Install the hook (ignore error codes) */
+ AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, AEH_Open_UPP,
+ 0L, FALSE);
+#endif
#endif
SetupAppDir();
-#if defined(MACINTOSH) && !defined(applec)
-
/* Mark ourself as the file creator */
_fcreator = 'Heng';
/* Default to saving a "text" file */
_ftype = 'TEXT';
-#endif
-
#if defined(__MWERKS__)
/* Obtian a "Universal Procedure Pointer" */
- //ynfilterUPP = NewModalFilterProc(ynfilter);
+#if TARGET_API_MAC_CARBON
ynfilterUPP = NewModalFilterUPP(ynfilter);
+#else
+ ynfilterUPP = NewModalFilterProc(ynfilter);
+#endif
+
#endif
quit_aux = hook_quit;
core_aux = hook_core;
-BackColor(blackColor);
- ForeColor(whiteColor);
+ BackColor(blackColor);
+ ForeColor(whiteColor);
/* Show the "watch" cursor */
SetCursor(*(GetCursor(watchCursor)));
-
+
/* Prepare the menubar */
init_menubar();
-
+
/* Prepare the windows */
init_windows();
-
-#ifdef JP
+
init_sound();
-#endif
+
+ init_graf();
/* Hack -- process all events */
while (CheckEvents(TRUE)) /* loop */;
/* Note the "system" */
ANGBAND_SYS = "mac";
- ANGBAND_GRAF = "new";
-
+
/* Initialize */
init_stuff();
-
+
/* Initialize */
init_angband();
-
+
+
/* Hack -- process all events */
while (CheckEvents(TRUE)) /* loop */;
#endif
/* Prompt the user */
-#ifdef JP
+ #ifdef JP
prt("'¥Õ¥¡¥¤¥ë'¥á¥Ë¥å¡¼¤è¤ê'¿·µ¬'¤Þ¤¿¤Ï'³«¤¯...'¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£", 23, 10);
-#else
+ #else
prt("[Choose 'New' or 'Open' from the 'File' menu]", 23, 15);
-#endif
+ #endif
/* Flush the prompt */
Term_fresh();