-
Notifications
You must be signed in to change notification settings - Fork 2
/
BomberFireController.cpp
55 lines (49 loc) · 1.46 KB
/
BomberFireController.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//=====================================
//
//ボンバーファイアコントローラ処理[BomberFireController.cpp]
//Author:GP12A332 21 立花雄太
//
//=====================================
#include "BomberFireController.h"
#include "BomberFire.h"
/**************************************
マクロ定義
***************************************/
#define BOBMERFIRE_TEXTURE_NAME "data/TEXTURE/Effect/BomberFire.png"
#define BOMBERFIRE_TEXTURE_DIV (&D3DXVECTOR2(8.0f, 8.0f))
#define BOMBERFIRE_SIZE (&D3DXVECTOR2(5.0f, 5.0f))
#define BOMBERFIRE_NUM_MAX (512)
#define BOMBERFIRE_EMITTER_NUM (1)
#define BOMBERFIRE_EMIT_NUM (170)
/**************************************
初期化処理
***************************************/
void BomberFireController::Init()
{
//単位頂点バッファ作成、テクスチャロード
MakeUnitBuffer(BOMBERFIRE_SIZE, BOMBERFIRE_TEXTURE_DIV);
LoadTexture(BOBMERFIRE_TEXTURE_NAME);
//パラメータコンテナ作成
particleContainer.resize(BOMBERFIRE_NUM_MAX);
for (auto& particle : particleContainer)
{
particle = new BomberFire();
}
//エミッタコンテナ作成
emitterContainer.resize(BOMBERFIRE_EMITTER_NUM);
for (auto& emitter : emitterContainer)
{
emitter = new BomberFireEmitter();
}
}
/**************************************
放出処理
***************************************/
void BomberFireController::Emit()
{
ForEachEmitter(BOMBERFIRE_EMIT_NUM, [](BaseEmitter* emitter, BaseParticle* particle)
{
particle->transform.pos = emitter->transform.pos;
particle->Init();
});
}