MCPcopy Create free account
hub / github.com/axmolengine/axmol / init

Method init

core/2d/ParticleSystem.cpp:105–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105bool ParticleData::init(int count)
106{
107 maxCount = count;
108
109 posx = (float*)malloc(count * sizeof(float));
110 posy = (float*)malloc(count * sizeof(float));
111 startPosX = (float*)malloc(count * sizeof(float));
112 startPosY = (float*)malloc(count * sizeof(float));
113 colorR = (float*)malloc(count * sizeof(float));
114 colorG = (float*)malloc(count * sizeof(float));
115 colorB = (float*)malloc(count * sizeof(float));
116 colorA = (float*)malloc(count * sizeof(float));
117 deltaColorR = (float*)malloc(count * sizeof(float));
118 deltaColorG = (float*)malloc(count * sizeof(float));
119 deltaColorB = (float*)malloc(count * sizeof(float));
120 deltaColorA = (float*)malloc(count * sizeof(float));
121
122 size = (float*)malloc(count * sizeof(float));
123 deltaSize = (float*)malloc(count * sizeof(float));
124 rotation = (float*)malloc(count * sizeof(float));
125 staticRotation = (float*)malloc(count * sizeof(float));
126 deltaRotation = (float*)malloc(count * sizeof(float));
127 totalTimeToLive = (float*)malloc(count * sizeof(float));
128 timeToLive = (float*)malloc(count * sizeof(float));
129 atlasIndex = (unsigned int*)malloc(count * sizeof(unsigned int));
130
131 modeA.dirX = (float*)malloc(count * sizeof(float));
132 modeA.dirY = (float*)malloc(count * sizeof(float));
133 modeA.radialAccel = (float*)malloc(count * sizeof(float));
134 modeA.tangentialAccel = (float*)malloc(count * sizeof(float));
135
136 modeB.angle = (float*)malloc(count * sizeof(float));
137 modeB.degreesPerSecond = (float*)malloc(count * sizeof(float));
138 modeB.deltaRadius = (float*)malloc(count * sizeof(float));
139 modeB.radius = (float*)malloc(count * sizeof(float));
140
141 return posx && posy && startPosX && startPosY && colorR && colorG && colorB && colorA && deltaColorR &&
142 deltaColorG && deltaColorB && deltaColorA && size && deltaSize && rotation && staticRotation &&
143 deltaRotation && totalTimeToLive && timeToLive && atlasIndex && modeA.dirX && modeA.dirY &&
144 modeA.radialAccel && modeA.tangentialAccel && modeB.angle && modeB.degreesPerSecond && modeB.deltaRadius &&
145 modeB.radius;
146}
147
148void ParticleData::release()
149{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected