5 #include <Multimedia/SDX.h>
6 #include <Multimedia/Image.h>
7 #include <Multimedia/Loading.h>
24 ImagePack(
const char *ファイル名,
int 総コマ数,
int コマ割り横,
int コマ割り縦)
32 ImagePack(
const char *ファイル名,
const char *拡張子,
int 総コマ数,
const char* 書式 =
"%03d.")
34 Load(ファイル名, 拡張子, 総コマ数, 書式);
44 bool Load(
const char *ファイル名,
int 総コマ数,
int コマ割り横,
int コマ割り縦)
46 if (Loading::isLoading)
52 int x = 0, y = 0, count = 0;
55 const int width = image.
GetWidth() / コマ割り横;
56 const int height = image.
GetHeight() / コマ割り縦;
58 for (
int a = 0; a < コマ割り縦; ++a)
61 for (
int b = 0; b < コマ割り横; ++b)
63 if (count >= 総コマ数)
break;
64 this->
Add(
new Image(image, { x, y, width, height }));
77 bool Load(
const char *ファイル名,
const char *拡張子,
int 総コマ数,
const char* 書式 =
"%03d.")
79 if (Loading::isLoading)
85 for (
int a = 0; a < 総コマ数; ++a)
88 sprintf_s(fileBuf, 8, 書式, a);
90 std::string fileName = ファイル名;
94 this->
Add(
new Image(fileName.c_str()));
107 void Add(
const char *ファイル名)
126 return (
int)
imageS.size();
155 if (Loading::isLoading)
161 for (
unsigned int a = 0; a < 幅.size();++a)
163 imageS[a]->part.w -= 幅[a];
int widthMax
最大幅
Definition: ImagePack.h:18
Image * operator[](int index) const
オペレータ.
Definition: ImagePack.h:174
ImagePack(const char *ファイル名, const char *拡張子, int 総コマ数, const char *書式="%03d.")
連番ファイルを一括して読み込む.
Definition: ImagePack.h:32
virtual void Release()
Imageをメモリから開放.
Definition: ImagePack.h:113
int GetWidth() const
最大幅を取得.
Definition: ImagePack.h:130
std::vector< Image * > imageS
保持するImage
Definition: ImagePack.h:17
auto end() -> decltype(imageS.end())
イテレータ用.
Definition: ImagePack.h:186
bool Load(const char *ファイル名, const char *拡張子, int 総コマ数, const char *書式="%03d.")
連番ファイルを一括して読み込む.
Definition: ImagePack.h:77
画像データを表すクラス.
Definition: Image.h:17
Image * operator[](int index)
オペレータ.
Definition: ImagePack.h:168
色を表すクラス.
Definition: Color.h:11
void Add(const char *ファイル名)
Imageを末尾に追加.
Definition: ImagePack.h:107
bool Load(const char *ファイル名, int 総コマ数, int コマ割り横, int コマ割り縦)
1つの画像を分割して読み込む.
Definition: ImagePack.h:44
static void AddLoading(std::function< void(void)> &&読み込み関数)
非同期読み込み処理に追加.
Definition: Loading.h:96
int GetHeight() const
高さを取得.
Definition: Image.h:310
int GetWidth() const
幅を取得.
Definition: Image.h:304
void AdjustWidth(std::vector< int > 幅)
先頭からimageの幅を差分修正.
Definition: ImagePack.h:153
int GetSize() const
要素数を取得.
Definition: ImagePack.h:124
auto end() const -> decltype(imageS.end())
イテレータ用.
Definition: ImagePack.h:198
auto begin() -> decltype(imageS.begin())
イテレータ用.
Definition: ImagePack.h:180
int GetHeight() const
最大高さを取得.
Definition: ImagePack.h:136
ImagePack(const char *ファイル名, int 総コマ数, int コマ割り横, int コマ割り縦)
1つの画像を分割して読み込む.
Definition: ImagePack.h:24
複数のImageをまとめるクラス.
Definition: ImagePack.h:14
void Add(Image *追加イメージ)
Imageを末尾に追加.
Definition: ImagePack.h:100
int heightMax
最大高さ
Definition: ImagePack.h:19
void SetColor(const Color &描画色)
描画色をまとめて変更.
Definition: ImagePack.h:142
auto begin() const -> decltype(imageS.begin())
イテレータ用.
Definition: ImagePack.h:192