Hengband  2.2.1
データ構造 | マクロ定義 | 型定義 | 関数 | 変数
main-mac.c ファイル
#include "angband.h"
#include <Types.h>
#include <Gestalt.h>
#include <QuickDraw.h>
#include <Files.h>
#include <Fonts.h>
#include <Menus.h>
#include <Dialogs.h>
#include <Windows.h>
#include <Palettes.h>
#include <StandardFile.h>
#include <DiskInit.h>
#include <ToolUtils.h>
#include <Devices.h>
#include <Events.h>
#include <Resources.h>
#include <Controls.h>
#include <SegLoad.h>
#include <Memory.h>
#include <QDOffscreen.h>
#include <Sound.h>
#include <AppleEvents.h>
#include <EPPC.h>
#include <Folders.h>
main-mac.c の依存先関係図:

データ構造

struct  term_data
 
struct  FrameRec
 

マクロ定義

#define PREF_FILE_NAME   _("Hengband Preferences", "Hengband-E Preferences")
 
#define ANGBAND_CREATOR   'Heng'
 
#define MAX_TERM_DATA   8
 
#define USE_SFL_CODE
 
#define USE_ASYNC_SOUND
 
#define GRAF_MODE_NONE   0
 
#define GRAF_MODE_8X8   1
 
#define GRAF_MODE_16X16   2
 
#define GRAF_MODE_32X32   3
 
#define MAX_CHANNELS   4
 
#define SOUND_VOLUME_MIN   0 /* Default minimum sound volume */
 
#define SOUND_VOLUME_MAX   255 /* Default maximum sound volume */
 
#define VOLUME_MIN   0 /* Minimum sound volume in % */
 
#define VOLUME_MAX   100 /* Maximum sound volume in % */
 
#define VOLUME_INC   5 /* Increment sound volume in % */
 
#define SND_NON   0
 
#define SND_ATTACK   1
 
#define SND_MOVE   2
 
#define SND_TRAP   3
 
#define SND_SHOP   4
 
#define SND_ME   5
 
#define SND_CMD_ERROR   6
 
#define MENU_APPLE   128
 
#define ITEM_ABOUT   1
 
#define MENU_FILE   129
 
#define ITEM_NEW   1
 
#define ITEM_OPEN   2
 
#define ITEM_IMPORT   3
 
#define ITEM_CLOSE   4
 
#define ITEM_SAVE   5
 
#define ITEM_QUIT   7
 
#define MENU_EDIT   130
 
#define ITEM_UNDO   1
 
#define ITEM_CUT   3
 
#define ITEM_COPY   4
 
#define ITEM_PASTE   5
 
#define ITEM_CLEAR   6
 
#define MENU_FONT   131
 
#define ITEM_BOLD   1
 
#define ITEM_WIDE   2
 
#define MENU_SIZE   132
 
#define MENU_WINDOWS   133
 
#define MENU_SPECIAL   134
 
#define ITEM_SOUND   1
 
#define ITEM_GRAPH   2
 
#define ITEM_TILEWIDTH   3
 
#define ITEM_TILEHEIGHT   4
 
#define ITEM_FIDDLE   6
 
#define ITEM_WIZARD   7
 
#define SUBMENU_SOUND   143
 
#define ITEM_USE_SOUND   1
 
#define ITEM_SOUND_SETTING   2
 
#define SUBMENU_GRAPH   144
 
#define ITEM_NONE   1
 
#define ITEM_8X8   2
 
#define ITEM_16X16   3
 
#define ITEM_BIGTILE   5
 
#define SUBMENU_TILEWIDTH   145
 
#define SUBMENU_TILEHEIGHT   146
 
#define EVENT_TICKS   6
 

型定義

typedef struct term_data term_data
 
typedef struct FrameRec FrameRec
 

関数

static bool CheckEvents (bool wait)
 
static void refnum_to_name (char *buf, long refnum, short vrefnum, char *fname)
 
static void local_to_global (Rect *r)
 
static void global_to_local (Rect *r)
 
static void center_rect (Rect *r, Rect *s)
 
static void ptocstr (StringPtr src)
 
static void pstrcat (StringPtr dst, StringPtr src)
 
static void pstrinsert (StringPtr dst, StringPtr src)
 
static void PathNameFromDirID (long dirID, short vRefNum, StringPtr fullPathName)
 
static void activate (WindowPtr w)
 
static void mac_warning (concptr warning)
 
static void term_data_color (term_data *td, int a)
 
static void term_data_check_font (term_data *td)
 
static void term_data_check_size (term_data *td)
 
static void term_data_resize (term_data *td)
 
static void term_data_redraw (term_data *td)
 
static void BenSWLockFrame (FrameRec *srcFrameP)
 
static void BenSWUnlockFrame (FrameRec *srcFrameP)
 
static OSErr BenSWCreateGWorldFromPict (GWorldPtr *pictGWorld, PicHandle pictH)
 
static errr globe_init (void)
 
static errr globe_nuke (void)
 
static SndListHandle find_sound (int num)
 
static void cleanup_sound (void)
 
static void play_sound (int num, SInt16 vol)
 
static void Term_init_mac (term *t)
 
static void Term_nuke_mac (term *t)
 
static errr Term_user_mac (int n)
 
static errr Term_xtra_mac_react (void)
 
static errr Term_xtra_mac (int n, int v)
 
static errr Term_curs_mac (int x, int y)
 
static errr Term_bigcurs_mac (int x, int y)
 
static errr Term_wipe_mac (int x, int y, int n)
 
static errr Term_text_mac (int x, int y, int n, byte a, const char *cp)
 
static errr Term_pict_mac (int x, int y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp)
 
static void term_data_link (int i)
 
static void SetupAppDir (void)
 
static int getshort (void)
 
static void putshort (int x)
 
static void save_prefs (void)
 
static void load_prefs (void)
 
static void term_data_hack (term_data *td)
 
static void init_windows (void)
 
static void init_sound (void)
 
static void init_graf (void)
 
short InevrtCheck (DialogPtr targetDlg, short check)
 
short SetCheck (DialogPtr targetDlg, short check, long result)
 
short GetCheck (DialogPtr targetDlg, short check)
 
void SoundConfigDLog (void)
 
static void save_pref_file (void)
 
static void do_menu_file_new (void)
 
static void do_menu_file_open (bool all)
 
static void handle_open_when_ready (void)
 
static void init_menubar (void)
 
static void setup_menus (void)
 
static void menu (long mc)
 
static OSErr CheckRequiredAEParams (const AppleEvent *theAppleEvent)
 
static pascal OSErr AEH_Start (const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefCon)
 
static pascal OSErr AEH_Quit (const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefCon)
 
static pascal OSErr AEH_Print (const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefCon)
 
static pascal OSErr AEH_Open (const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefCon)
 
static vptr hook_rnfree (vptr v, huge size)
 
static vptr hook_ralloc (huge size)
 
static vptr hook_rpanic (huge size)
 
static void hook_plog (concptr str)
 
static void hook_quit (concptr str)
 
static void hook_core (concptr str)
 
static void init_stuff (void)
 
int main (void)
 

変数

static short app_vol
 
static long app_dir
 
Boolean open_when_ready = FALSE
 
Boolean quit_when_ready = FALSE
 
static int game_in_progress = 0
 
static WindowPtr active = NULL
 
static term_data data [MAX_TERM_DATA]
 
static bool initialized = FALSE
 
static long mac_os_version
 
AEEventHandlerUPP AEH_Start_UPP
 
AEEventHandlerUPP AEH_Quit_UPP
 
AEEventHandlerUPP AEH_Print_UPP
 
AEEventHandlerUPP AEH_Open_UPP
 
static int pictID = 0
 
static int grafWidth = 0
 
static int grafHeight = 0
 
static int pictCols = 0
 
static int pictRows = 0
 
static int graf_mode = GRAF_MODE_NONE
 
static int graf_mode_req = GRAF_MODE_NONE
 
static FrameRecframeP = NULL
 
static SndChannelPtr channels [MAX_CHANNELS]
 
static Boolean channel_initialised = FALSE
 
static SndListHandle samples [SOUND_MAX]
 
static SInt16 sample_refs [SOUND_MAX]
 
static SInt16 sound_volume = SOUND_VOLUME_MAX
 
static short soundmode [8]
 
static int soundchoice []
 
static int ext_sound = 0
 
static int ext_graf = 0
 
static FILE * fff
 
static vptr lifeboat = NULL
 

マクロ定義詳解

◆ ANGBAND_CREATOR

#define ANGBAND_CREATOR   'Heng'

◆ EVENT_TICKS

#define EVENT_TICKS   6

◆ GRAF_MODE_16X16

#define GRAF_MODE_16X16   2

◆ GRAF_MODE_32X32

#define GRAF_MODE_32X32   3

◆ GRAF_MODE_8X8

#define GRAF_MODE_8X8   1

◆ GRAF_MODE_NONE

#define GRAF_MODE_NONE   0

◆ ITEM_16X16

#define ITEM_16X16   3

◆ ITEM_8X8

#define ITEM_8X8   2

◆ ITEM_ABOUT

#define ITEM_ABOUT   1

◆ ITEM_BIGTILE

#define ITEM_BIGTILE   5

◆ ITEM_BOLD

#define ITEM_BOLD   1

◆ ITEM_CLEAR

#define ITEM_CLEAR   6

◆ ITEM_CLOSE

#define ITEM_CLOSE   4

◆ ITEM_COPY

#define ITEM_COPY   4

◆ ITEM_CUT

#define ITEM_CUT   3

◆ ITEM_FIDDLE

#define ITEM_FIDDLE   6

◆ ITEM_GRAPH

#define ITEM_GRAPH   2

◆ ITEM_IMPORT

#define ITEM_IMPORT   3

◆ ITEM_NEW

#define ITEM_NEW   1

◆ ITEM_NONE

#define ITEM_NONE   1

◆ ITEM_OPEN

#define ITEM_OPEN   2

◆ ITEM_PASTE

#define ITEM_PASTE   5

◆ ITEM_QUIT

#define ITEM_QUIT   7

◆ ITEM_SAVE

#define ITEM_SAVE   5

◆ ITEM_SOUND

#define ITEM_SOUND   1

◆ ITEM_SOUND_SETTING

#define ITEM_SOUND_SETTING   2

◆ ITEM_TILEHEIGHT

#define ITEM_TILEHEIGHT   4

◆ ITEM_TILEWIDTH

#define ITEM_TILEWIDTH   3

◆ ITEM_UNDO

#define ITEM_UNDO   1

◆ ITEM_USE_SOUND

#define ITEM_USE_SOUND   1

◆ ITEM_WIDE

#define ITEM_WIDE   2

◆ ITEM_WIZARD

#define ITEM_WIZARD   7

◆ MAX_CHANNELS

#define MAX_CHANNELS   4

◆ MAX_TERM_DATA

#define MAX_TERM_DATA   8

◆ MENU_APPLE

#define MENU_APPLE   128

◆ MENU_EDIT

#define MENU_EDIT   130

◆ MENU_FILE

#define MENU_FILE   129

◆ MENU_FONT

#define MENU_FONT   131

◆ MENU_SIZE

#define MENU_SIZE   132

◆ MENU_SPECIAL

#define MENU_SPECIAL   134

◆ MENU_WINDOWS

#define MENU_WINDOWS   133

◆ PREF_FILE_NAME

#define PREF_FILE_NAME   _("Hengband Preferences", "Hengband-E Preferences")

◆ SND_ATTACK

#define SND_ATTACK   1

◆ SND_CMD_ERROR

#define SND_CMD_ERROR   6

◆ SND_ME

#define SND_ME   5

◆ SND_MOVE

#define SND_MOVE   2

◆ SND_NON

#define SND_NON   0

◆ SND_SHOP

#define SND_SHOP   4

◆ SND_TRAP

#define SND_TRAP   3

◆ SOUND_VOLUME_MAX

#define SOUND_VOLUME_MAX   255 /* Default maximum sound volume */

◆ SOUND_VOLUME_MIN

#define SOUND_VOLUME_MIN   0 /* Default minimum sound volume */

◆ SUBMENU_GRAPH

#define SUBMENU_GRAPH   144

◆ SUBMENU_SOUND

#define SUBMENU_SOUND   143

◆ SUBMENU_TILEHEIGHT

#define SUBMENU_TILEHEIGHT   146

◆ SUBMENU_TILEWIDTH

#define SUBMENU_TILEWIDTH   145

◆ USE_ASYNC_SOUND

#define USE_ASYNC_SOUND

◆ USE_SFL_CODE

#define USE_SFL_CODE

◆ VOLUME_INC

#define VOLUME_INC   5 /* Increment sound volume in % */

◆ VOLUME_MAX

#define VOLUME_MAX   100 /* Maximum sound volume in % */

◆ VOLUME_MIN

#define VOLUME_MIN   0 /* Minimum sound volume in % */

型定義詳解

◆ FrameRec

typedef struct FrameRec FrameRec

◆ term_data

typedef struct term_data term_data

関数詳解

◆ activate()

static void activate ( WindowPtr  w)
static
被呼び出し関係図:

◆ AEH_Open()

static pascal OSErr AEH_Open ( const AppleEvent *  theAppleEvent,
AppleEvent *  reply,
long  handlerRefCon 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ AEH_Print()

static pascal OSErr AEH_Print ( const AppleEvent *  theAppleEvent,
AppleEvent *  reply,
long  handlerRefCon 
)
static
被呼び出し関係図:

◆ AEH_Quit()

static pascal OSErr AEH_Quit ( const AppleEvent *  theAppleEvent,
AppleEvent *  reply,
long  handlerRefCon 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ AEH_Start()

static pascal OSErr AEH_Start ( const AppleEvent *  theAppleEvent,
AppleEvent *  reply,
long  handlerRefCon 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ BenSWCreateGWorldFromPict()

static OSErr BenSWCreateGWorldFromPict ( GWorldPtr *  pictGWorld,
PicHandle  pictH 
)
static
被呼び出し関係図:

◆ BenSWLockFrame()

static void BenSWLockFrame ( FrameRec srcFrameP)
static
被呼び出し関係図:

◆ BenSWUnlockFrame()

static void BenSWUnlockFrame ( FrameRec srcFrameP)
static
被呼び出し関係図:

◆ center_rect()

static void center_rect ( Rect *  r,
Rect *  s 
)
static
被呼び出し関係図:

◆ CheckEvents()

static bool CheckEvents ( bool  wait)
static
呼び出し関係図:
被呼び出し関係図:

◆ CheckRequiredAEParams()

static OSErr CheckRequiredAEParams ( const AppleEvent *  theAppleEvent)
static
被呼び出し関係図:

◆ cleanup_sound()

static void cleanup_sound ( void  )
static
被呼び出し関係図:

◆ do_menu_file_new()

static void do_menu_file_new ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ do_menu_file_open()

static void do_menu_file_open ( bool  all)
static
呼び出し関係図:
被呼び出し関係図:

◆ find_sound()

static SndListHandle find_sound ( int  num)
static
呼び出し関係図:
被呼び出し関係図:

◆ GetCheck()

short GetCheck ( DialogPtr  targetDlg,
short  check 
)
被呼び出し関係図:

◆ getshort()

static int getshort ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ global_to_local()

static void global_to_local ( Rect *  r)
static
被呼び出し関係図:

◆ globe_init()

static errr globe_init ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ globe_nuke()

static errr globe_nuke ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ handle_open_when_ready()

static void handle_open_when_ready ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ hook_core()

static void hook_core ( concptr  str)
static
呼び出し関係図:
被呼び出し関係図:

◆ hook_plog()

static void hook_plog ( concptr  str)
static
呼び出し関係図:
被呼び出し関係図:

◆ hook_quit()

static void hook_quit ( concptr  str)
static
呼び出し関係図:
被呼び出し関係図:

◆ hook_ralloc()

static vptr hook_ralloc ( huge  size)
static
被呼び出し関係図:

◆ hook_rnfree()

static vptr hook_rnfree ( vptr  v,
huge  size 
)
static
被呼び出し関係図:

◆ hook_rpanic()

static vptr hook_rpanic ( huge  size)
static
呼び出し関係図:
被呼び出し関係図:

◆ InevrtCheck()

short InevrtCheck ( DialogPtr  targetDlg,
short  check 
)
被呼び出し関係図:

◆ init_graf()

static void init_graf ( void  )
static
被呼び出し関係図:

◆ init_menubar()

static void init_menubar ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ init_sound()

static void init_sound ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ init_stuff()

static void init_stuff ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ init_windows()

static void init_windows ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ load_prefs()

static void load_prefs ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ local_to_global()

static void local_to_global ( Rect *  r)
static
被呼び出し関係図:

◆ mac_warning()

static void mac_warning ( concptr  warning)
static
被呼び出し関係図:

◆ main()

int main ( void  )
呼び出し関係図:

◆ menu()

static void menu ( long  mc)
static
呼び出し関係図:
被呼び出し関係図:

◆ PathNameFromDirID()

static void PathNameFromDirID ( long  dirID,
short  vRefNum,
StringPtr  fullPathName 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ play_sound()

static void play_sound ( int  num,
SInt16  vol 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ pstrcat()

static void pstrcat ( StringPtr  dst,
StringPtr  src 
)
static
被呼び出し関係図:

◆ pstrinsert()

static void pstrinsert ( StringPtr  dst,
StringPtr  src 
)
static
被呼び出し関係図:

◆ ptocstr()

static void ptocstr ( StringPtr  src)
static
被呼び出し関係図:

◆ putshort()

static void putshort ( int  x)
static
被呼び出し関係図:

◆ refnum_to_name()

static void refnum_to_name ( char *  buf,
long  refnum,
short  vrefnum,
char *  fname 
)
static
被呼び出し関係図:

◆ save_pref_file()

static void save_pref_file ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ save_prefs()

static void save_prefs ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ SetCheck()

short SetCheck ( DialogPtr  targetDlg,
short  check,
long  result 
)
被呼び出し関係図:

◆ setup_menus()

static void setup_menus ( void  )
static
被呼び出し関係図:

◆ SetupAppDir()

static void SetupAppDir ( void  )
static
呼び出し関係図:
被呼び出し関係図:

◆ SoundConfigDLog()

void SoundConfigDLog ( void  )
呼び出し関係図:
被呼び出し関係図:

◆ Term_bigcurs_mac()

static errr Term_bigcurs_mac ( int  x,
int  y 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ Term_curs_mac()

static errr Term_curs_mac ( int  x,
int  y 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ term_data_check_font()

static void term_data_check_font ( term_data td)
static
呼び出し関係図:
被呼び出し関係図:

◆ term_data_check_size()

static void term_data_check_size ( term_data td)
static
被呼び出し関係図:

◆ term_data_color()

static void term_data_color ( term_data td,
int  a 
)
static
被呼び出し関係図:

◆ term_data_hack()

static void term_data_hack ( term_data td)
static
被呼び出し関係図:

◆ term_data_link()

static void term_data_link ( int  i)
static
呼び出し関係図:
被呼び出し関係図:

◆ term_data_redraw()

static void term_data_redraw ( term_data td)
static
呼び出し関係図:
被呼び出し関係図:

◆ term_data_resize()

static void term_data_resize ( term_data td)
static
被呼び出し関係図:

◆ Term_init_mac()

static void Term_init_mac ( term t)
static
呼び出し関係図:
被呼び出し関係図:

◆ Term_nuke_mac()

static void Term_nuke_mac ( term t)
static
被呼び出し関係図:

◆ Term_pict_mac()

static errr Term_pict_mac ( int  x,
int  y,
int  n,
const byte ap,
const char *  cp,
const byte tap,
const char *  tcp 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ Term_text_mac()

static errr Term_text_mac ( int  x,
int  y,
int  n,
byte  a,
const char *  cp 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ Term_user_mac()

static errr Term_user_mac ( int  n)
static
被呼び出し関係図:

◆ Term_wipe_mac()

static errr Term_wipe_mac ( int  x,
int  y,
int  n 
)
static
被呼び出し関係図:

◆ Term_xtra_mac()

static errr Term_xtra_mac ( int  n,
int  v 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ Term_xtra_mac_react()

static errr Term_xtra_mac_react ( void  )
static
呼び出し関係図:
被呼び出し関係図:

変数詳解

◆ active

WindowPtr active = NULL
static

◆ AEH_Open_UPP

AEEventHandlerUPP AEH_Open_UPP

◆ AEH_Print_UPP

AEEventHandlerUPP AEH_Print_UPP

◆ AEH_Quit_UPP

AEEventHandlerUPP AEH_Quit_UPP

◆ AEH_Start_UPP

AEEventHandlerUPP AEH_Start_UPP

◆ app_dir

long app_dir
static

◆ app_vol

short app_vol
static

◆ channel_initialised

Boolean channel_initialised = FALSE
static

◆ channels

SndChannelPtr channels[MAX_CHANNELS]
static

◆ data

term_data data[MAX_TERM_DATA]
static

◆ ext_graf

int ext_graf = 0
static

◆ ext_sound

int ext_sound = 0
static

◆ fff

FILE* fff
static

◆ frameP

FrameRec* frameP = NULL
static

◆ game_in_progress

int game_in_progress = 0
static

◆ graf_mode

int graf_mode = GRAF_MODE_NONE
static

◆ graf_mode_req

int graf_mode_req = GRAF_MODE_NONE
static

◆ grafHeight

int grafHeight = 0
static

◆ grafWidth

int grafWidth = 0
static

◆ initialized

bool initialized = FALSE
static

◆ lifeboat

vptr lifeboat = NULL
static

◆ mac_os_version

long mac_os_version
static

◆ open_when_ready

Boolean open_when_ready = FALSE

◆ pictCols

int pictCols = 0
static

◆ pictID

int pictID = 0
static

◆ pictRows

int pictRows = 0
static

◆ quit_when_ready

Boolean quit_when_ready = FALSE

◆ sample_refs

SInt16 sample_refs[SOUND_MAX]
static

◆ samples

SndListHandle samples[SOUND_MAX]
static

◆ sound_volume

SInt16 sound_volume = SOUND_VOLUME_MAX
static

◆ soundchoice

int soundchoice[]
static

◆ soundmode

short soundmode[8]
static