瀏覽代碼

rewrite text animator to use variable and array instead of hard wired map bank

SBird1337 7 年之前
父節點
當前提交
0a0169c2f9
共有 1 個檔案被更改,包括 4 行新增14 行删除
  1. 4
    14
      src/overworld/tileset_animation/text_animator.c

+ 4
- 14
src/overworld/tileset_animation/text_animator.c 查看文件

@@ -9,6 +9,8 @@
9 9
 #define CANVAS_FIRST (u8 *)(574 * 0x20 + 0x06000000)
10 10
 #define CANVAS_SECOND (u8 *)(592 * 0x20 + 0x06000000)
11 11
 
12
+static const char *map_texts[] = {"--------","< Carun City", "Route 2 >", NULL};
13
+
12 14
 s16 char_to_tile_index(char chr) {
13 15
     if (chr >= 'A' && chr <= 'P')
14 16
         return chr - 'A';
@@ -87,18 +89,6 @@ void anim_init_text(void) {
87 89
     blockset_one_current_tile = 0;
88 90
     blockset_one_max_tile = 0x280;
89 91
     blockset_one_animator = text_animator;
90
-
91
-    switch (saveblock1->location.bank) {
92
-    case 3: {
93
-        switch (saveblock1->location.map) {
94
-        case 0:
95
-            draw_text_on_canvas("    < Carun City");
96
-            break;
97
-        case 1:
98
-            draw_text_on_canvas("    < Route 3");
99
-        }
100
-    } break;
101
-    default:
102
-        break;
103
-    }
92
+    if(var_8000 != 0)
93
+        draw_text_on_canvas(map_texts[var_8000]);
104 94
 }