00001 #ifndef _PA_Gif
00002 #define _PA_Gif
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00015 #include <PA9.h>
00016
00017 #include "PA_Interrupt.h"
00018 #include "PA_Palette.h"
00019 #include "PA_Draw.h"
00020 #include "gif/gif_lib.h"
00021
00022 extern GifFileType* gifinfo;
00023 extern s16 gifwidth, gifheight;
00024 extern u8 PA_nBit[2];
00025 extern s32 GifCurrentLine;
00026
00027 typedef struct{
00028 s32 StartFrame;
00029 s32 EndFrame;
00030 s32 CurrentFrame;
00031 float Speed;
00032 u8 Play;
00033 } PA_GifInfos;
00034 extern PA_GifInfos PA_GifInfo;
00035
00036
00037
00038
00039
00040
00041
00042 void PA_Load16bitGif(u8 screen, s16 x, s16 y, void *gif);
00043
00044 int DecodeGif(const u8 *userData, u8 *ScreenBuff, u16* Palette, u8 nBits, s16 SWidth);
00045
00046
00047
00066 extern inline u16 PA_GetGifWidth(void* gif){
00067 u16 *temp = (u16*)gif;
00068 temp += 3;
00069 return *temp;
00070 }
00071
00072
00073
00082 extern inline u16 PA_GetGifHeight(void* gif){
00083 u16 *temp = (u16*)gif;
00084 temp += 4;
00085 return *temp;
00086 }
00087
00088
00089
00090
00108 extern inline void PA_LoadGifXY(u8 screen, s16 x, s16 y, void *gif){
00109 if (PA_nBit[screen]) DecodeGif((const u8*)gif, (u8*)(PA_DrawBg[screen] + x + (y<<8)), (u16*)0x05000000, 1, 256);
00110 else DecodeGif((const u8*)gif, (u8*)(PA_DrawBg[screen] + ((x + (y<<8))<<1)), (u16*)(0x05000000+(0x400*screen)), 0, 256);
00111 }
00112
00113
00114
00126 extern inline void PA_LoadGif(u8 screen, void *gif){
00127 PA_LoadGifXY(screen, 0, 0, gif);
00128 }
00129
00130
00131
00132
00141 extern inline void PA_GifAnimSpeed(float speed){
00142 PA_GifInfo.Speed = speed;
00143 }
00144
00145
00151 extern inline void PA_GifAnimStop(void){
00152 PA_GifInfo.Play = 0;
00153 }
00154
00155
00156
00157
00163 extern inline void PA_GifAnimPause(void){
00164 PA_GifInfo.Play = 2;
00165 }
00166
00167
00173 extern inline void PA_GifAnimPlay(void){
00174 PA_GifInfo.Play = 1;
00175 }
00176
00185 extern inline void PA_GifSetStartFrame(s32 StartFrame){
00186 PA_GifInfo.StartFrame = StartFrame;
00187 }
00188
00189
00190
00199 extern inline void PA_GifSetEndFrame(s32 EndFrame){
00200 PA_GifInfo.EndFrame = EndFrame;
00201 }
00202
00203
00209 extern inline s32 PA_GifGetFrame(void){
00210 return PA_GifInfo.CurrentFrame;
00211 }
00212
00213
00214
00228 u8* PA_GifToTiles(void *gif, u16 *temppal);
00229
00230
00232
00233
00234
00235
00236
00237 #ifdef __cplusplus
00238 }
00239 #endif
00240
00241
00242
00243
00244
00245
00246
00247
00248 #endif
00249
00250