5 #include <Multimedia/SDX.h>
6 #include <Multimedia/Image.h>
7 #include <Framework/ImagePack.h>
36 std::vector<unsigned int> times;
37 std::vector<int> nexts;
42 Film(
const char *ファイル名,
int 総コマ数,
int コマ割り横,
int コマ割り縦,
int 1コマの再生時間 = 1) :
45 for (
int a = 0; a < 総コマ数; ++a)
47 times.push_back(1コマの再生時間);
53 Film(
const char* ファイル名,
const char *拡張子,
int 総コマ数,
int 1コマの再生時間 = 1,
const char* 書式 =
"%03d.")
55 Load(ファイル名, 拡張子, 総コマ数, 1コマの再生時間 ,書式);
59 bool Load(
const char *ファイル名,
int 総コマ数,
int コマ割り横,
int コマ割り縦,
int 1コマの再生時間 = 1)
69 for (
int a = 0; a < 総コマ数; ++a)
71 times.push_back(1コマの再生時間);
79 bool Load(
const char* ファイル名,
const char *拡張子,
int 総コマ数,
int 1コマの再生時間 = 1,
const char* 書式 =
"%03d.")
87 for (
int a = 0; a < 総コマ数; ++a)
90 sprintf_s(fileBuf, 8, 書式, a);
91 std::string fileName = ファイル名;
95 this->
Add(
new Image(fileName.c_str()), 1コマの再生時間);
111 times.push_back(再生フレーム数);
115 void Add(
const char *ファイル名,
int 再生フレーム数 = 1)
143 for (
unsigned int a = 0; a < times.size(); ++a)
145 times[a] = フレーム時間[a];
197 nexts[コマ番号] = (int)次フレーム;
205 for (
auto it : times)
void SetType(int コマ番号, NextFrame 次フレーム)
指定コマの次フレームを設定する.
Definition: Film.h:189
void SetType(FilmType 再生方法)
全体の再生方法を指定する.
Definition: Film.h:151
virtual void Release()
Imageをメモリから開放.
Definition: ImagePack.h:175
int GetAnimeTime() const
全コマの合計フレーム時間を返す.
Definition: Film.h:201
Film(const char *ファイル名, int 総コマ数, int コマ割り横, int コマ割り縦, int 1コマの再生時間=1)
画像ファイルを分割してメモリへ読み込む.
Definition: Film.h:42
void SetType(int コマ番号, int 次フレーム)
指定コマの次フレームを設定する.
Definition: Film.h:176
NextFrame
次コマの移動先.
Definition: Film.h:13
bool Load(const char *ファイル名, int 総コマ数, int コマ割り横, int コマ割り縦, int 1コマの再生時間=1)
画像ファイルを分割してメモリへ読み込む.
Definition: Film.h:59
static bool IsLoading()
非同期読み込み登録中かどうか.
Definition: Loading.h:90
画像データを表すクラス.
Definition: Image.h:17
void Add(const char *ファイル名, int 再生フレーム数=1)
末尾にImageを追加する.
Definition: Film.h:115
bool Load(const char *ファイル名, int 総コマ数, int コマ割り横, int コマ割り縦)
1つの画像を分割して読み込む.
Definition: ImagePack.h:47
Film(const char *ファイル名, const char *拡張子, int 総コマ数, int 1コマの再生時間=1, const char *書式="%03d.")
連番ファイルを一括して読み込む.
Definition: Film.h:53
void Add(Image *追加イメージ, int 再生フレーム数=1)
末尾にImageを追加する.
Definition: Film.h:102
static void AddLoading(std::function< void(void)> &&読み込み関数)
非同期読み込み処理に追加.
Definition: Loading.h:96
bool Load(const char *ファイル名, const char *拡張子, int 総コマ数, int 1コマの再生時間=1, const char *書式="%03d.")
連番ファイルを一括して読み込む.
Definition: Film.h:79
ImagePackにコマ毎の再生時間を追加したクラス.
Definition: Film.h:32
Filmに再生状態を付与したクラス.
Definition: Anime.h:11
複数のImageをまとめるクラス.
Definition: ImagePack.h:17
void Add(Image *追加イメージ)
Imageを末尾に追加.
Definition: ImagePack.h:162
FilmType
アニメの再生方法.
Definition: Film.h:22
void SetFrameTime(const std::vector< int > &フレーム時間)
各コマのフレーム数を設定する.
Definition: Film.h:135
void Release() override
Imageを開放し初期化する.
Definition: Film.h:127