Files
player/Project/Src/MyWinApp/mywin_user_animation.h

45 lines
1.2 KiB
C
Raw Permalink Normal View History

2025-06-27 00:32:57 +08:00
#ifndef MYWIN_USER_ANIMATION_H__
#define MYWIN_USER_ANIMATION_H__
#include "ff.h"
#include "gif.h"
#include "mywin_inc.h"
2025-06-27 00:32:57 +08:00
// <20><><EFBFBD><EFBFBD><E5B6AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1>
2025-06-27 00:32:57 +08:00
#define WIN_ANIMATION_FRAMERATE 14
typedef struct {
WIN_WindowStruct win;
WIN_PicStruct pic;
GIF_DecodeStruct *gif;
int frameNow; // <20><>ǰ֡<C7B0><D6A1>
int timerId; // <20><><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>ʹ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ʱ<EFBFBD><CAB1>ʱ<EFBFBD><CAB1>
int timerIdReturn; // <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>ʱ<EFBFBD><EFBFBD>ȵĶ<C8B5>ʱ<EFBFBD><CAB1>
int once; // ֻ<><D6BB><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
int x_off;
int y_off;
} WIN_AnimationStruct;
2025-06-27 00:32:57 +08:00
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);
2025-06-27 00:32:57 +08:00
void WIN_DeleteAnimation(WIN_AnimationStruct *animation);
2025-06-27 00:32:57 +08:00
// <20><>Ϣ<EFBFBD><CFA2><EFBFBD>Ļ<EFBFBD><C4BB>ƺ<EFBFBD><C6BA><EFBFBD>
void ANIMATION_DefaultPaint(WIN_AnimationStruct *animation);
2025-06-27 00:32:57 +08:00
// <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void ANIMATION_defaultMsgLoop(WIN_AnimationStruct *animation,
WIN_MsgStruct *msg);
2025-06-27 00:32:57 +08:00
// <20><>ʾһ<CABE><D2BB>ͼƬ
WIN_AnimationStruct *ANIMATION_ShowGif(WIN_WindowStruct *base, char *name);
2025-06-27 00:32:57 +08:00
// <20><>ʾһ<CABE><D2BB>ͼƬָ<C6AC><D6B8>ʱ<EFBFBD><CAB1>
WIN_AnimationStruct *ANIMATION_ShowGifTime(WIN_WindowStruct *base, char *name,
uint32_t ms);
2025-06-27 00:32:57 +08:00
#endif