Browse Source

some refractoring and optimization

SBird1337 7 years ago
parent
commit
c473022e21
4 changed files with 8 additions and 4 deletions
  1. 1
    1
      g3headers
  2. 1
    1
      sots-private
  3. 1
    0
      src/include/config.h
  4. 5
    2
      src/overworld/tileset_animation/text_animator.c

+ 1
- 1
g3headers

1
-Subproject commit 04e8a122f208ca1ee8052fef39f2dca51dcffe10
1
+Subproject commit 3934c9b2ba672863275d517403a558278e549786

+ 1
- 1
sots-private

1
-Subproject commit c1c7449630ff2756ff7ce11339a850ae79e6821f
1
+Subproject commit 71c2436a1f5ed193506491e9a70aea2fa696461f

+ 1
- 0
src/include/config.h View File

40
 #define HEALING_BANK_MAP_VAR    0x500E
40
 #define HEALING_BANK_MAP_VAR    0x500E
41
 #define HEALING_X_VAR           0x500F
41
 #define HEALING_X_VAR           0x500F
42
 #define HEALING_Y_VAR           0x5010
42
 #define HEALING_Y_VAR           0x5010
43
+#define TEXT_ANIMATION_VAR      0x8000
43
 
44
 
44
 /*Variables to control the music overrides*/
45
 /*Variables to control the music overrides*/
45
 #define VAR_FROM_1              0x51FA
46
 #define VAR_FROM_1              0x51FA

+ 5
- 2
src/overworld/tileset_animation/text_animator.c View File

60
     if (x % 2 == 0)
60
     if (x % 2 == 0)
61
         *addr = (*addr & 0xFF00) | (pixel);
61
         *addr = (*addr & 0xFF00) | (pixel);
62
     else
62
     else
63
-        *addr = (*addr & 0x00FF) | (pixel << 8);
63
+        *addr = (*((u8*)addr)) | (pixel << 8);
64
 }
64
 }
65
 
65
 
66
+#define ANIMATION_FRAME_SPEED 2
67
+
66
 void text_animator(u16 current_frame) {
68
 void text_animator(u16 current_frame) {
67
-    if ((current_frame % 7) == 0) {
69
+    if ((current_frame % ANIMATION_FRAME_SPEED) == 0) {
68
         u8 outer_pixels[16] = {
70
         u8 outer_pixels[16] = {
69
             *(CANVAS_FIRST + 0),   *(CANVAS_FIRST + 4),   *(CANVAS_FIRST + 8),   *(CANVAS_FIRST + 12),
71
             *(CANVAS_FIRST + 0),   *(CANVAS_FIRST + 4),   *(CANVAS_FIRST + 8),   *(CANVAS_FIRST + 12),
70
             *(CANVAS_FIRST + 16),  *(CANVAS_FIRST + 20),  *(CANVAS_FIRST + 24),  *(CANVAS_FIRST + 28),
72
             *(CANVAS_FIRST + 16),  *(CANVAS_FIRST + 20),  *(CANVAS_FIRST + 24),  *(CANVAS_FIRST + 28),
89
     blockset_one_current_tile = 0;
91
     blockset_one_current_tile = 0;
90
     blockset_one_max_tile = 0x280;
92
     blockset_one_max_tile = 0x280;
91
     blockset_one_animator = text_animator;
93
     blockset_one_animator = text_animator;
94
+    dprintf("%d\n", var_8000);
92
     if(var_8000 != 0)
95
     if(var_8000 != 0)
93
         draw_text_on_canvas(map_texts[var_8000]);
96
         draw_text_on_canvas(map_texts[var_8000]);
94
 }
97
 }