OSDN Git Service

Position the splash screen prompt in relation to the assumed size of the splash scree...
[hengbandforosx/hengbandosx.git] / src / main-cocoa.m
index 86efd04..7390782 100644 (file)
@@ -114,11 +114,6 @@ static bool new_game = FALSE;
 - (id)init;
 
 /**
- * Releases the resources acquired for the catalog.
- */
-- (void)dispose;
-
-/**
  * If self.enabled is YES and the given event has one or more sounds
  * corresponding to it in the catalog, plays one of those sounds, chosen at
  * random.
@@ -146,17 +141,6 @@ static bool new_game = FALSE;
 
 @end
 
-/**
- * This is a helper function for AngbandSoundCatalog's sharedSounds and
- * clearSharedSounds.  Implement a Singleton pattern.
- */
-static __strong AngbandSoundCatalog** get_shared_sounds(void)
-{
-    static __strong AngbandSoundCatalog* catalog = nil;
-
-    return &catalog;
-}
-
 @implementation AngbandSoundCatalog
 
 - (id)init {
@@ -168,11 +152,6 @@ static __strong AngbandSoundCatalog** get_shared_sounds(void)
     return self;
 }
 
-- (void)dispose {
-    self->soundsByPath = nil;
-    self->soundArraysByEvent = nil;
-}
-
 - (void)playSound:(int)event {
     if (! self.enabled) {
        return;
@@ -3910,6 +3889,13 @@ static void hook_plog(const char * str)
  */
 static void hook_quit(const char * str)
 {
+    for (int i = ANGBAND_TERM_MAX - 1; i >= 0; --i) {
+       if (angband_term[i]) {
+           term_nuke(angband_term[i]);
+       }
+    }
+    [AngbandSoundCatalog clearSharedSounds];
+    [AngbandContext setDefaultFont:nil];
     plog(str);
     exit(0);
 }
@@ -4406,16 +4392,20 @@ static void play_sound(int event)
        /* Handle pending events (most notably update) and flush input */
        Term_flush();
 
-       /* Prompt the user */
-       int message_row = (Term->hgt - 23) / 5 + 23;
+       /*
+        * Prompt the user; assume the splash screen is 80 x 23 and position
+        * relative to that rather than center based on the full size of the
+        * window.
+        */
+       int message_row = 23;
        Term_erase(0, message_row, 255);
        put_str(
 #ifdef JP
-           "['ファイル' メニューから '新' または '開く' を選択します]",
-           message_row, (Term->wid - 57) / 2
+           "['ファイル' メニューから '新' または '開く' を選択します]",
+           message_row, (80 - 59) / 2
 #else
            "[Choose 'New' or 'Open' from the 'File' menu]",
-           message_row, (Term->wid - 45) / 2
+           message_row, (80 - 45) / 2
 #endif
        );
        Term_fresh();