forked from YutaTachibana0310/SankouGoudou2019Summer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnemyBulletChargeController.cpp
59 lines (51 loc) · 1.73 KB
/
EnemyBulletChargeController.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
55
56
57
58
59
//=====================================
//
//エネミーバレットチャージコントローラ処理[EnemyBulletChargeController.cpp]
//Author:GP12A332 21 立花雄太
//
//=====================================
#include "EnemyBulletChargeController.h"
#include "EnemyBulletCharge.h"
/**************************************
マクロ定義
***************************************/
#define ENEMYBULLETCHARGE_TEX_NAME "data/TEXTURE/EFFECT/EnemyBulletCharge.png"
#define ENEMYBULLETCHARGE_NUM_MAX (1024)
#define ENEMYBULLETCHARGE_EMITTER_MAX (64)
#define ENEMYBULLETCHARGE_EMIT_NUM (2)
typedef BaseParticleController Base;
/**************************************
初期化処理
***************************************/
void EnemyBulletChargeController::Init()
{
D3DXVECTOR2 ENEMYBULLETCHARGE_SIZE = D3DXVECTOR2(2.0f, 2.0f);
D3DXVECTOR2 ENEMYBULLETCHARGE_TEX_DIV = D3DXVECTOR2(8.0f, 8.0f);
//単位頂点バッファ作成、テクスチャ読み込み
Base::LoadTexture(ENEMYBULLETCHARGE_TEX_NAME);
Base::MakeUnitBuffer(&ENEMYBULLETCHARGE_SIZE,&ENEMYBULLETCHARGE_TEX_DIV);
//パーティクルコンテナ作成
particleContainer.resize(ENEMYBULLETCHARGE_NUM_MAX);
for (auto& particle : particleContainer)
{
particle = new EnemyBulletCharge();
static_cast<EnemyBulletCharge*>(particle)->SetAnimParameter(&ENEMYBULLETCHARGE_TEX_DIV);
}
//エミッターコンテナ作成
emitterContainer.resize(ENEMYBULLETCHARGE_EMITTER_MAX);
for (auto& emitter : emitterContainer)
{
emitter = new EnemyBulletChargeEmitter();
}
}
/**************************************
放出処理
***************************************/
void EnemyBulletChargeController::Emit()
{
ForEachEmitter(ENEMYBULLETCHARGE_EMIT_NUM, [](BaseEmitter *emitter, BaseParticle *particle)
{
particle->transform = emitter->transform;
particle->Init();
});
}