From 94f7ee280e87617ae43f683b822bc66d6a781892 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 18 Jun 2022 18:00:37 +0300 Subject: [PATCH] Cleanup movie_effect.h See #42 --- src/movie_effect.cc | 38 +++++++++++++++++++++++++++++++------- src/movie_effect.h | 29 ----------------------------- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/src/movie_effect.cc b/src/movie_effect.cc index fc6ce73..9b783a7 100644 --- a/src/movie_effect.cc +++ b/src/movie_effect.cc @@ -11,17 +11,41 @@ #include #include +typedef enum MovieEffectType { + MOVIE_EFFECT_TYPE_NONE = 0, + MOVIE_EFFECT_TYPE_FADE_IN = 1, + MOVIE_EFFECT_TYPE_FADE_OUT = 2, +} MovieEffectFadeType; + +typedef struct MovieEffect { + int startFrame; + int endFrame; + int steps; + unsigned char fadeType; + // range 0-63 + unsigned char r; + // range 0-63 + unsigned char g; + // range 0-63 + unsigned char b; + struct MovieEffect* next; +} MovieEffect; + +static void _moviefx_callback_func(int frame); +static void _moviefx_palette_func(unsigned char* palette, int start, int end); +static void movieEffectsClear(); + // 0x5195F0 -bool gMovieEffectsInitialized = false; +static bool gMovieEffectsInitialized = false; // 0x5195F4 -MovieEffect* gMovieEffectHead = NULL; +static MovieEffect* gMovieEffectHead = NULL; // 0x638EC4 -unsigned char _source_palette[768]; +static unsigned char _source_palette[768]; // 0x6391C4 -bool _inside_fade; +static bool _inside_fade; // 0x487CC0 int movieEffectsInit() @@ -215,7 +239,7 @@ void _moviefx_stop() } // 0x488144 -void _moviefx_callback_func(int frame) +static void _moviefx_callback_func(int frame) { MovieEffect* movieEffect = gMovieEffectHead; while (movieEffect != NULL) { @@ -250,7 +274,7 @@ void _moviefx_callback_func(int frame) } // 0x4882AC -void _moviefx_palette_func(unsigned char* palette, int start, int end) +static void _moviefx_palette_func(unsigned char* palette, int start, int end) { memcpy(_source_palette + 3 * start, palette, 3 * (end - start + 1)); @@ -260,7 +284,7 @@ void _moviefx_palette_func(unsigned char* palette, int start, int end) } // 0x488310 -void movieEffectsClear() +static void movieEffectsClear() { MovieEffect* movieEffect = gMovieEffectHead; while (movieEffect != NULL) { diff --git a/src/movie_effect.h b/src/movie_effect.h index ac872f7..621d90c 100644 --- a/src/movie_effect.h +++ b/src/movie_effect.h @@ -1,39 +1,10 @@ #ifndef MOVIE_EFFECT_H #define MOVIE_EFFECT_H -typedef enum MovieEffectType { - MOVIE_EFFECT_TYPE_NONE = 0, - MOVIE_EFFECT_TYPE_FADE_IN = 1, - MOVIE_EFFECT_TYPE_FADE_OUT = 2, -} MovieEffectFadeType; - -typedef struct MovieEffect { - int startFrame; - int endFrame; - int steps; - unsigned char fadeType; - // range 0-63 - unsigned char r; - // range 0-63 - unsigned char g; - // range 0-63 - unsigned char b; - struct MovieEffect* next; -} MovieEffect; - -extern bool gMovieEffectsInitialized; -extern MovieEffect* gMovieEffectHead; - -extern unsigned char _source_palette[768]; -extern bool _inside_fade; - int movieEffectsInit(); void movieEffectsReset(); void movieEffectsExit(); int movieEffectsLoad(const char* fileName); void _moviefx_stop(); -void _moviefx_callback_func(int frame); -void _moviefx_palette_func(unsigned char* palette, int start, int end); -void movieEffectsClear(); #endif /* MOVIE_EFFECT_H */