From 7a4ee17ea46742a5aff331ad195eb5be098c01b2 Mon Sep 17 00:00:00 2001 From: Stephen Simpson Date: Wed, 12 Oct 2011 23:05:13 -0500 Subject: Started adding animations in. also fix for updated effects --- src/effects.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/effects.cpp') diff --git a/src/effects.cpp b/src/effects.cpp index 8d0e565..40f08a2 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -1004,7 +1004,7 @@ const char* effects_name_list [] = { "Wm_ob_treasureboxwait_b" }; -extern "C" void SpawnEffect(const char*, int, Vec*, int, int); +extern "C" bool SpawnEffect(const char*, int, Vec*, S16Vec*, Vec*); // Just call CreateEffect(this, number_between_0_and_1000); bool CreateEffect(dEn_c* enemy, int effect_num) { @@ -1022,7 +1022,7 @@ bool CreateEffect(Vec* pos, S16Vec* rot, Vec* scale, int effect_num) { return false; if (effect_num < 0) return false; - Vec tempVec = (Vec){ pos.x, pos.y, 5500.0 }; + Vec tempVec = (Vec){ pos->x, pos->y, 5500.0 }; const char* effect_name = effects_name_list[effect_num]; return SpawnEffect(effect_name, 0, &tempVec, rot, scale); } @@ -1030,8 +1030,8 @@ bool CreateEffect(Vec* pos, S16Vec* rot, Vec* scale, int effect_num) { bool CreateEffect(const char* name, Vec* pos) { //check effects name list bool exists = false; - for( int ii = 0; ii < sizeof(effect_name_list); ii++) { - if (strncmp(name, effects_name_list[ii], strlen(effects_name_list) ) ) { + for( int ii = 0; ii < sizeof(effects_name_list); ii++) { + if (memcmp(name, effects_name_list[ii], strlen(effects_name_list[ii]) ) ) { exists = true; break; } -- cgit v1.2.3 From 9098cb8b28c089d8abe1b2ff7d9010ab5c6d8766 Mon Sep 17 00:00:00 2001 From: Stephen Simpson Date: Thu, 13 Oct 2011 21:23:12 -0500 Subject: Started work on animations --- src/effects.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/effects.cpp') diff --git a/src/effects.cpp b/src/effects.cpp index 40f08a2..3b2d5c7 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -1041,6 +1041,15 @@ bool CreateEffect(const char* name, Vec* pos) { return SpawnEffect(name, 0, pos, 0, 0); } +bool CreateEffect(int effect_num, Vec* pos, S16Vec* rot, Vec* scale) { + if (effect_num > 1000) + return false; + if (effect_num < 0) + return false; + const char* effect_name = effects_name_list[effect_num]; + return SpawnEffect(effect_name, 0, pos, rot, scale); +} + /* void* CustomEffectSpawn(const char* name) { // FILL ME IN -- cgit v1.2.3