MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / EfxCreate

Function EfxCreate

Descent3/TelComEffects.cpp:221–247  ·  view source on GitHub ↗

Creates an instance of an Effect

Source from the content-addressed store, hash-verified

219
220// Creates an instance of an Effect
221int EfxCreate(int type, int monitor, int screen, int id, bool is_tab_stop) {
222 ASSERT(type != EFX_NONE);
223 ASSERT(monitor >= 0 && monitor < MAX_MONITOR);
224 ASSERT(screen >= 0 && screen < MAX_TELCOM_SCREENS);
225
226 bool make_focus = false;
227
228 // find an available index
229 for (int i = 0; i < MAX_TCEFFECTS; i++) {
230 if (TCEffects[i].type == EFX_NONE) {
231 // we found a slot
232 TCEffects[i].type = type;
233 TCEffects[i].monitor = monitor;
234 TCEffects[i].screen = screen;
235 TCEffects[i].id = id;
236
237 if (is_tab_stop && !Screen_has_effect_with_focus[screen]) {
238 // this effect should get focus
239 make_focus = true;
240 }
241
242 EfxInit(&TCEffects[i], is_tab_stop, make_focus);
243 return i;
244 }
245 }
246 return INVALID_EFFECT_HANDLE;
247}
248
249// Frees up any memory allocated for effect, sets type to EFX_NONE
250void EfxFreeEffect(tceffect *tce) {

Callers 6

CreateTextEffectFunction · 0.85
CreateBitmapEffectFunction · 0.85
CreateMovieEffectFunction · 0.85
CreateBackgroundEffectFunction · 0.85
CreateSoundEffectFunction · 0.85
CreateButtonEffectFunction · 0.85

Calls 1

EfxInitFunction · 0.85

Tested by

no test coverage detected