From cc9412a77ba2e79f6adbe97dca37e869170b1e83 Mon Sep 17 00:00:00 2001 From: Avenger Date: Mon, 23 Aug 2010 21:08:35 +0200 Subject: [PATCH] fixed black rain --- gemrb/core/Particles.cpp | 14 +++++++++++++- gemrb/core/Particles.h | 26 +++++++++++++------------- gemrb/plugins/FXOpcodes/FXOpcodes.cpp | 16 +--------------- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/gemrb/core/Particles.cpp b/gemrb/core/Particles.cpp index 0f20cf6c9..fa01b16d5 100644 --- a/gemrb/core/Particles.cpp +++ b/gemrb/core/Particles.cpp @@ -27,6 +27,10 @@ Color sparkcolors[MAX_SPARK_COLOR][MAX_SPARK_PHASE]; bool inited = false; +#define SPARK_COUNT 13 + +static int spark_color_indices[SPARK_COUNT]={12,5,0,6,1,8,2,7,9,3,4,10,11}; + void TranslateColor(const char *value, Color &color) { int r = 0; @@ -65,7 +69,14 @@ void InitSparks() } while (i--) { for (int j=0;jQueryField(i,j); + int idx; + + if (iQueryField(idx,j); TranslateColor(value, sparkcolors[i][j]); } } @@ -196,6 +207,7 @@ void Particles::Draw(const Region &screen) case SP_PATH_FLIT: case SP_PATH_RAIN: state = points[i].state>>4; + break; default: state = points[i].state; break; diff --git a/gemrb/core/Particles.h b/gemrb/core/Particles.h index 20cda4c32..fb9cf8aee 100644 --- a/gemrb/core/Particles.h +++ b/gemrb/core/Particles.h @@ -66,19 +66,19 @@ struct Element { #define SP_SPAWN_FULL 1 //fill all at setup, then switch to none #define SP_SPAWN_SOME 2 //add some new elements regularly -#define SPARK_COLOR_NONE 0 -#define SPARK_COLOR_BLUE 1 -#define SPARK_COLOR_GOLD 2 -#define SPARK_COLOR_PURPLE 3 -#define SPARK_COLOR_ICE 4 -#define SPARK_COLOR_STONE 5 -#define SPARK_COLOR_BLACK 6 -#define SPARK_COLOR_CHROM 7 -#define SPARK_COLOR_RED 8 -#define SPARK_COLOR_GREEN 9 -#define SPARK_COLOR_WHITE 10 -#define SPARK_COLOR_MAGENTA 11 -#define SPARK_COLOR_ORANGE 12 +#define SPARK_COLOR_BLUE 0 +#define SPARK_COLOR_GOLD 1 +#define SPARK_COLOR_PURPLE 2 +#define SPARK_COLOR_ICE 3 +#define SPARK_COLOR_STONE 4 +#define SPARK_COLOR_BLACK 5 +#define SPARK_COLOR_CHROM 6 +#define SPARK_COLOR_RED 7 +#define SPARK_COLOR_GREEN 8 +#define SPARK_COLOR_WHITE 9 +#define SPARK_COLOR_MAGENTA 10 +#define SPARK_COLOR_ORANGE 11 +#define SPARK_COLOR_CUSTOM 12 #define MAX_SPARK_COLOR 13 #define MAX_SPARK_PHASE 5 diff --git a/gemrb/plugins/FXOpcodes/FXOpcodes.cpp b/gemrb/plugins/FXOpcodes/FXOpcodes.cpp index 616eac182..79ab43a92 100644 --- a/gemrb/plugins/FXOpcodes/FXOpcodes.cpp +++ b/gemrb/plugins/FXOpcodes/FXOpcodes.cpp @@ -82,10 +82,6 @@ static int polystatcount = 0; //the original engine stores the colors in sprklclr.2da in a different order -#define SPARK_COUNT 13 - -static int spark_color_indices[SPARK_COUNT]={12,5,0,6,1,8,2,7,9,3,4,10,11}; - static ScriptedAnimation default_spell_hit; int fx_ac_vs_damage_type_modifier (Scriptable* Owner, Actor* target, Effect* fx);//00 @@ -1802,17 +1798,7 @@ int fx_sparkle (Scriptable* /*Owner*/, Actor* target, Effect* fx) } Point p(fx->PosX, fx->PosY); - //the IE programmers did something unexpected, again, a permutation! - unsigned int idx; - - if (fx->Parameter1Parameter1]; - } - else { - idx=fx->Parameter1; - } - - map->Sparkle( fx->Duration, idx, fx->Parameter2, p, fx->Parameter3); + map->Sparkle( fx->Duration, fx->Parameter1, fx->Parameter2, p, fx->Parameter3); return FX_NOT_APPLIED; } -- 2.11.4.GIT