55 lines
1.2 KiB
C
55 lines
1.2 KiB
C
|
#ifndef MYWIN_USER_ANIMATION_H__
|
||
|
#define MYWIN_USER_ANIMATION_H__
|
||
|
|
||
|
|
||
|
|
||
|
#include "mywin_inc.h"
|
||
|
#include "ff.h"
|
||
|
#include "gif.h"
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
//定义动画的最高帧率
|
||
|
#define WIN_ANIMATION_FRAMERATE 14
|
||
|
|
||
|
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
WIN_WindowStruct win;
|
||
|
WIN_PicStruct pic;
|
||
|
GIF_DecodeStruct *gif;
|
||
|
int frameNow; //当前帧数
|
||
|
int timerId; //播放动画使用的延时定时器
|
||
|
int timerIdReturn; //播放指定时间长度的定时器
|
||
|
int once; //只播放一次
|
||
|
int x_off;
|
||
|
int y_off;
|
||
|
}WIN_AnimationStruct;
|
||
|
|
||
|
|
||
|
WIN_AnimationStruct *WIN_CreatAnimation (WIN_WindowStruct *base,
|
||
|
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
|
||
|
int x,int y,int x_size,int y_size);
|
||
|
|
||
|
void WIN_DeleteAnimation (WIN_AnimationStruct *animation);
|
||
|
|
||
|
|
||
|
//消息框的绘制函数
|
||
|
void ANIMATION_DefaultPaint (WIN_AnimationStruct *animation);
|
||
|
|
||
|
//消息框的消息处理函数
|
||
|
void ANIMATION_defaultMsgLoop (WIN_AnimationStruct *animation,WIN_MsgStruct *msg);
|
||
|
|
||
|
|
||
|
//显示一个图片
|
||
|
WIN_AnimationStruct *ANIMATION_ShowGif (WIN_WindowStruct *base,char *name);
|
||
|
|
||
|
//显示一个图片指定时间
|
||
|
WIN_AnimationStruct *ANIMATION_ShowGifTime (WIN_WindowStruct *base,char *name,u32 ms);
|
||
|
|
||
|
|
||
|
#endif
|
||
|
|