From: <ave...@us...> - 2007-03-13 19:36:04
|
Revision: 4556 http://gemrb.svn.sourceforge.net/gemrb/?rev=4556&view=rev Author: avenger_teambg Date: 2007-03-13 12:35:48 -0700 (Tue, 13 Mar 2007) Log Message: ----------- fully implemented disguise in pst implemented weapon colour (pulsating colours still need work) in pst some source file indentation cleanup Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/pst/GUICommonWindows.py gemrb/trunk/gemrb/GUIScripts/pst/GUIINV.py gemrb/trunk/gemrb/plugins/Core/EffectQueue.cpp gemrb/trunk/gemrb/plugins/Core/EffectQueue.h gemrb/trunk/gemrb/plugins/Core/Interface.cpp gemrb/trunk/gemrb/plugins/Core/Interface.h gemrb/trunk/gemrb/plugins/Core/Inventory.cpp gemrb/trunk/gemrb/plugins/Core/Inventory.h gemrb/trunk/gemrb/plugins/Core/Item.cpp gemrb/trunk/gemrb/plugins/Core/Item.h gemrb/trunk/gemrb/plugins/DLGImporter/DLGImp.cpp gemrb/trunk/gemrb/plugins/GUIScript/GUIScript.cpp gemrb/trunk/gemrb/plugins/IWDOpcodes/IWDOpc.cpp gemrb/trunk/gemrb/plugins/MVEPlayer/MVEPlay.cpp gemrb/trunk/gemrb/plugins/PNGImporter/PNGImp.cpp Modified: gemrb/trunk/gemrb/GUIScripts/pst/GUICommonWindows.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/pst/GUICommonWindows.py 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/GUIScripts/pst/GUICommonWindows.py 2007-03-13 19:35:48 UTC (rev 4556) @@ -207,22 +207,22 @@ def UpdateAnimation (): - disguise = GemRB.GetGameVar ("APPEARANCE") pc = GemRB.GameGetSelectedPCSingle () - if disguise == 2: #dustman - GemRB.SetPlayerStat (pc, IE_ANIMATION_ID, 0x5d) - return - if disguise == 1: #zombie - GemRB.SetPlayerStat (pc, IE_ANIMATION_ID, 0x52) - return - slot = GemRB.GetEquippedQuickSlot (pc) - item = GemRB.GetSlotItem (pc, slot ) - animid = "" - if item: - item = GemRB.GetItem(item["ItemResRef"]) + disguise = GemRB.GetGameVar ("APPEARANCE") + if disguise == 2: #dustman + animid = "DR" + elif disguise == 1: #zombie + animid = "ZO" + else: + slot = GemRB.GetEquippedQuickSlot (pc) + item = GemRB.GetSlotItem (pc, slot ) + animid = "" if item: - animid = item["AnimationType"] + item = GemRB.GetItem(item["ItemResRef"]) + if item: + animid = item["AnimationType"] + BioTable = GemRB.LoadTable ("BIOS") Specific = "%d"%GemRB.GetPlayerStat (pc, IE_SPECIFIC) AvatarName = GemRB.GetTableValue (BioTable, Specific, "PC") @@ -465,10 +465,8 @@ Class = GemRB.FindTableValue (ClassTable, 5, 4) SaveName2 = GemRB.GetTableValue (ClassTable, Class, 3) Class = 0 #fighter - print "SaveName2", SaveName2 SaveName1 = GemRB.GetTableValue (ClassTable, Class, 3) - print "SaveName1", SaveName1 for row in range(5): tmp1 = GetSavingThrow (SaveName1, row, level1) @@ -477,7 +475,6 @@ if tmp2<tmp1: tmp1=tmp2 GemRB.SetPlayerStat (pc, IE_SAVEVSDEATH+row, tmp1) - print "Savingthrow:", tmp1 return Modified: gemrb/trunk/gemrb/GUIScripts/pst/GUIINV.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/pst/GUIINV.py 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/GUIScripts/pst/GUIINV.py 2007-03-13 19:35:48 UTC (rev 4556) @@ -147,6 +147,8 @@ Window = InventoryWindow + GemRB.RunEventHandler("UpdateAnimation") + pc = GemRB.GameGetSelectedPCSingle () Container = GemRB.GetContainer (pc, 1) @@ -333,9 +335,13 @@ pc = GemRB.GameGetSelectedPCSingle () - GemRB.DropDraggedItem (pc, -1) - #item = GemRB.GetItem (ResRef) - #GemRB.PlaySound (item["BrokenItem"]) + item = GemRB.GetSlotItem (0,0) + ret = GemRB.DropDraggedItem (pc, -1) + #this is exactly the same hack as the blackisle guys did it + #quite lame, but we should copy their efforts the best + if ret == 2 and item and (item['ItemResRef'] == "dustrobe"): + GemRB.SetGlobal("APPEARANCE","GLOBAL",2) + UpdateInventoryWindow () return @@ -348,11 +354,20 @@ ResRef = slot_item['ItemResRef'] item = GemRB.GetItem (ResRef) GemRB.DragItem (pc, slot, item["ItemIcon"], 0, 0) + if slot == 2: + GemRB.SetGlobal("APPEARANCE","GLOBAL",0) else: + item = GemRB.GetSlotItem (0,0) + itemdata = GemRB.GetItem(item['ItemResRef']) GemRB.DropDraggedItem (pc, slot) + if slot == 2 and item['ItemResRef'] == 'dustrobe': + GemRB.SetGlobal("APPEARANCE","GLOBAL",2) + elif slot < 21 and itemdata['AnimationType'] != '': + GemRB.SetGlobal("APPEARANCE","GLOBAL",0) UpdateInventoryWindow () + def OnDropItemToPC (): pc = GemRB.GetVar ("PressedPortrait") + 1 GemRB.DropDraggedItem (pc, -3) Modified: gemrb/trunk/gemrb/plugins/Core/EffectQueue.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/EffectQueue.cpp 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/Core/EffectQueue.cpp 2007-03-13 19:35:48 UTC (rev 4556) @@ -254,7 +254,7 @@ opcodes_count += count; effectnames[opcodes_count].Name = NULL; //if we merge two effect lists, then we need to sort their effect tables - //actually, we might always want to sort this list, so there is no + //actually, we might always want to sort this list, so there is no //need to do it manually (sorted table is needed if we use bsearch) qsort(effectnames, opcodes_count, sizeof(EffectRef), compare_effects); } @@ -262,7 +262,6 @@ EffectQueue::EffectQueue() { Owner = NULL; -// opcodes_count = 0; } EffectQueue::~EffectQueue() @@ -272,6 +271,30 @@ } } +Effect *EffectQueue::CreateEffect(ieDword opcode, ieDword param1, ieDword param2, ieDword timing) +{ + if (opcode==0xffffffff) { + return NULL; + } + Effect *fx = new Effect(); + if (!fx) { + return NULL; + } + memset(fx,0,sizeof(Effect)); + fx->Opcode=opcode; + fx->Probability1=100; + fx->Parameter1=param1; + fx->Parameter2=param2; + fx->TimingMode=timing; + return fx; +} + +Effect *EffectQueue::CreateEffect(EffectRef &effect_reference, ieDword param1, ieDword param2, ieDword timing) +{ + ResolveEffectRef(effect_reference); + return CreateEffect(effect_reference.EffText, param1, param2, timing); +} + bool EffectQueue::AddEffect(Effect* fx) { Effect* new_fx = new Effect; @@ -597,7 +620,7 @@ if (NeedPrepare((ieByte) fx->TimingMode) ) { //prepare for delayed duration effects fx->Duration=fx->SecondaryDelay; - PrepareDuration(fx); + PrepareDuration(fx); } break; case DURATION: @@ -613,10 +636,10 @@ default: abort(); } - + EffectFunction fn = effect_refs[fx->Opcode].Function; bool flg = false; - if (fn) { + if (fn) { if ( effect_refs[fx->Opcode].EffText > 0 ) { char *text = core->GetString( effect_refs[fx->Opcode].EffText ); core->DisplayString( text ); @@ -640,7 +663,7 @@ //for example, a strength modifier effect if ((fx->TimingMode==FX_DURATION_INSTANT_PERMANENT) ) { fx->TimingMode=FX_DURATION_JUST_EXPIRED; - } + } break; case FX_ABORT: flg = true; @@ -766,12 +789,12 @@ if ( IsPrepared( (ieByte) ((*f)->TimingMode) )!=PERMANENT ) { if ( (*f)->Duration<=GameTime) { (*f)->TimingMode=FX_DURATION_JUST_EXPIRED; - } + } } } } -//this effect will expire all effects that are not truly permanent +//this effect will expire all effects that are not truly permanent //which i call permanent after death (iesdp calls it permanent after bonuses) void EffectQueue::RemoveAllNonPermanentEffects() { @@ -990,7 +1013,7 @@ } //returns true if the effect supports simplified duration -bool EffectQueue::HasDuration(Effect *fx) +bool EffectQueue::HasDuration(Effect *fx) { switch(fx->TimingMode) { case FX_DURATION_INSTANT_LIMITED: //simple duration Modified: gemrb/trunk/gemrb/plugins/Core/EffectQueue.h =================================================================== --- gemrb/trunk/gemrb/plugins/Core/EffectQueue.h 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/Core/EffectQueue.h 2007-03-13 19:35:48 UTC (rev 4556) @@ -188,6 +188,7 @@ /* returns the number of saved effects */ ieDword GetSavedEffectsCount() const; size_t GetEffectsCount() const { return effects.size(); } + static Effect *CreateEffect(EffectRef &effect_reference, ieDword param1, ieDword param2, ieDword timing); //locating opcodes Effect *HasEffect(EffectRef &effect_reference); @@ -208,6 +209,7 @@ static int ResolveEffect(EffectRef &effect_reference); private: //use the effect reference style calls from outside + static Effect *CreateEffect(ieDword opcode, ieDword param1, ieDword param2, ieDword timing); void RemoveAllEffectsWithResource(ieDword opcode, const ieResRef resource); void RemoveAllEffectsWithParam(ieDword opcode, ieDword param2); Effect *HasOpcode(ieDword opcode) const; Modified: gemrb/trunk/gemrb/plugins/Core/Interface.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/Interface.cpp 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/Core/Interface.cpp 2007-03-13 19:35:48 UTC (rev 4556) @@ -4050,7 +4050,7 @@ switch (speaker->Type) { case ST_ACTOR: name = ((Actor *) speaker)->GetName(-1); - GetPalette( ((Actor *) speaker)->GetStat(IE_MAJOR_COLOR),8, ActorColor ); + GetPalette( ((Actor *) speaker)->GetStat(IE_MAJOR_COLOR), PALSIZE, ActorColor ); speaker_color = (ActorColor[4].r<<16) | (ActorColor[4].g<<8) | ActorColor[4].b; break; case ST_TRIGGER: case ST_PROXIMITY: case ST_TRAVEL: @@ -4083,7 +4083,7 @@ switch (attacker->Type) { case ST_ACTOR: name1 = ((Actor *) attacker)->GetName(-1); - GetPalette( ((Actor *) attacker)->GetStat(IE_MAJOR_COLOR),8, ActorColor ); + GetPalette( ((Actor *) attacker)->GetStat(IE_MAJOR_COLOR),PALSIZE, ActorColor ); attacker_color = (ActorColor[4].r<<16) | (ActorColor[4].g<<8) | ActorColor[4].b; break; default: @@ -4119,7 +4119,7 @@ switch (speaker->Type) { case ST_ACTOR: name = ((Actor *) speaker)->GetName(-1); - GetPalette( ((Actor *) speaker)->GetStat(IE_MAJOR_COLOR),8, ActorColor ); + GetPalette( ((Actor *) speaker)->GetStat(IE_MAJOR_COLOR), PALSIZE, ActorColor ); speaker_color = (ActorColor[4].r<<16) | (ActorColor[4].g<<8) | ActorColor[4].b; break; case ST_TRIGGER: case ST_PROXIMITY: case ST_TRAVEL: Modified: gemrb/trunk/gemrb/plugins/Core/Interface.h =================================================================== --- gemrb/trunk/gemrb/plugins/Core/Interface.h 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/Core/Interface.h 2007-03-13 19:35:48 UTC (rev 4556) @@ -638,7 +638,7 @@ char GameSounds[12]; char GameScripts[12]; char GamePortraits[12]; - char GameCharacters[12]; + char GameCharacters[12]; ieResRef GameNameResRef; ieResRef GoldResRef; //MISC07.itm Variables *RtRows; Modified: gemrb/trunk/gemrb/plugins/Core/Inventory.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/Inventory.cpp 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/Core/Inventory.cpp 2007-03-13 19:35:48 UTC (rev 4556) @@ -27,6 +27,7 @@ #include "Item.h" #include "Actor.h" #include "Game.h" +#include "ScriptEngine.h" static int SLOT_HEAD = -1; static int SLOT_MAGIC = -1; @@ -190,13 +191,18 @@ } ItemExcl|=itm->ItemExcl; + ieWord gradient = itm->GetWieldedGradient(); + if (gradient!=0xffff) { + Owner->SetBase(IE_COLORS, gradient); + } + //get the equipping effects - //EffectQueue *fxqueue = itm->GetEffectBlock(-1); - //fxqueue->SetOwner(Owner); //the equipped items owner is the equipping character - //fxqueue->ApplyAllEffects(Owner); + EffectQueue *eqfx = itm->GetEffectBlock(-1); + core->FreeItem( itm, slot->ItemResRef, false ); - for (int i = 0; i < itm->EquippingFeatureCount; i++) { - Effect *fx = itm->equipping_features+i; + int cnt = eqfx->GetEffectsCount(); + for (int i = 0; i < cnt; i++) { + Effect* fx = eqfx->GetEffect(i); fx->PosX = Owner->Pos.x; fx->PosY = Owner->Pos.y; @@ -215,8 +221,8 @@ Owner->fxqueue.AddEffect( fx ); } - - core->FreeItem( itm, slot->ItemResRef, false ); + delete eqfx; + core->GetGUIScriptEngine()->RunFunction("UpdateAnimation", false); } void Inventory::RemoveSlotEffects(CREItem* slot) @@ -227,13 +233,28 @@ if (!itm) return; ItemExcl&=~itm->ItemExcl; + EffectQueue *eqfx = itm->GetEffectBlock(-1); + core->FreeItem( itm, slot->ItemResRef, false ); + //this block is also ok, but knows too much about the item effect block + //if item wants other equipping effects (like pst weapon pulse) + //this one isn't good enough +/* for (int i = 0; i < itm->EquippingFeatureCount; i++) { Effect* fx = &itm->equipping_features[i]; if (fx->TimingMode == FX_DURATION_INSTANT_WHILE_EQUIPPED) { Owner->fxqueue.RemoveEffect( fx ); } } - core->FreeItem( itm, slot->ItemResRef, false ); +*/ + int cnt = eqfx->GetEffectsCount(); + for (int i = 0; i < cnt; i++) { + Effect* fx = eqfx->GetEffect(i); + if (fx->TimingMode == FX_DURATION_INSTANT_WHILE_EQUIPPED) { + Owner->fxqueue.RemoveEffect( fx ); + } + } + delete eqfx; + core->GetGUIScriptEngine()->RunFunction("UpdateAnimation", false); } void Inventory::SetInventoryType(int arg) @@ -1013,7 +1034,7 @@ int Inventory::GetEquippedSlot() { - if (Equipped==IW_NO_EQUIPPED) { + if (Equipped == IW_NO_EQUIPPED) { return SLOT_FIST; } if (IWD2 && Equipped>=0) { Modified: gemrb/trunk/gemrb/plugins/Core/Inventory.h =================================================================== --- gemrb/trunk/gemrb/plugins/Core/Inventory.h 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/Core/Inventory.h 2007-03-13 19:35:48 UTC (rev 4556) @@ -278,6 +278,7 @@ /** Returns item in specified slot. Does NOT change inventory */ CREItem* GetSlotItem(unsigned int slot); bool ChangeItemFlag(unsigned int slot, ieDword value, int mode); + /** Equips the item, don't use it directly for weapons */ bool EquipItem(unsigned int slot); bool UnEquipItem(unsigned int slot, bool removecurse); /** Returns equipped weapon */ Modified: gemrb/trunk/gemrb/plugins/Core/Item.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/Item.cpp 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/Core/Item.cpp 2007-03-13 19:35:48 UTC (rev 4556) @@ -65,6 +65,13 @@ for (int i=0;i<count;i++) { fxqueue->AddEffect( features+i ); } + + //adding a pulse effect for weapons (PST) + if (WieldColor!=0xffff) { + if (Flags&IE_ITEM_PULSATING) { + fxqueue->AddEffect( BuildGlowEffect(WieldColor) ); + } + } return fxqueue; } @@ -101,7 +108,7 @@ return NULL; } -int Item::UseCharge(ieWord *Charges, int header) +int Item::UseCharge(ieWord *Charges, int header) const { ITMExtHeader *ieh = GetExtHeader(header); if (!ieh) return 0; @@ -130,9 +137,25 @@ if (!eh) { return NULL; } - EffectQueue *fx = GetEffectBlock(header); + EffectQueue *fx = GetEffectBlock(header); Projectile *pro = core->GetProjectileServer()->GetProjectileByIndex(eh->ProjectileAnimation); pro->SetEffects(fx); return pro; } +//this is the implementation of the weapon glow effect in PST +static EffectRef glow_ref ={"Color:PulseRGB",NULL,-1}; +//this type of colour uses PAL32, a PST specific palette +#define PALSIZE 32 +static Color ActorColor[PALSIZE]; + +Effect *Item::BuildGlowEffect(int gradient) const +{ + //palette entry to to RGB conversion + core->GetPalette( gradient, PALSIZE, ActorColor ); + ieDword rgb = (ActorColor[16].r<<16) | (ActorColor[16].g<<8) | ActorColor[16].b; + ieDword location = 0; + ieDword speed = 128; + Effect *fx = EffectQueue::CreateEffect(glow_ref, rgb, location|(speed<<16), FX_DURATION_INSTANT_WHILE_EQUIPPED); + return fx; +} Modified: gemrb/trunk/gemrb/plugins/Core/Item.h =================================================================== --- gemrb/trunk/gemrb/plugins/Core/Item.h 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/Core/Item.h 2007-03-13 19:35:48 UTC (rev 4556) @@ -8,12 +8,12 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * @@ -57,7 +57,7 @@ #define IE_ITEM_CURSED 0x00000010 #define IE_ITEM_NOT_COPYABLE 0x00000020 #define IE_ITEM_MAGICAL 0x00000040 -#define IE_ITEM_BOW 0x00000080 +#define IE_ITEM_BOW 0x00000080 #define IE_ITEM_SILVER 0x00000100 #define IE_ITEM_COLD_IRON 0x00000200 #define IE_ITEM_STOLEN 0x00000400 @@ -80,7 +80,7 @@ #define ITEM_AT_MELEE 1 #define ITEM_AT_PROJECTILE 2 #define ITEM_AT_MAGIC 3 -#define ITEM_AT_BOW 4 +#define ITEM_AT_BOW 4 //projectile qualifiers #define PROJ_ARROW 1 @@ -214,7 +214,7 @@ return ItemDescIdentified; } - int UseCharge(ieWord *Charges, int header); + int UseCharge(ieWord *Charges, int header) const; //returns the requested extended header ITMExtHeader *GetExtHeader(unsigned int which) const @@ -224,14 +224,23 @@ } return ext_headers+which; } + ieDword GetWieldedGradient() const + { + return WieldColor; + } + //-1 will return the equipping feature block EffectQueue *GetEffectBlock(int usage) const; //returns a projectile created from an extended header Projectile *GetProjectile(int header) const; + //Builds an equipping glow effect from gradient colour + //this stuff is not item specific, could be moved elsewhere + Effect *BuildGlowEffect(int gradient) const; //returns the average damage of the weapon (doesn't check for special effects) int GetDamagePotential(bool ranged, ITMExtHeader *&header) const; //returns the weapon header ITMExtHeader *GetWeaponHeader(bool ranged) const; + }; -#endif // ! ITEM_H +#endif // ! ITEM_H Modified: gemrb/trunk/gemrb/plugins/DLGImporter/DLGImp.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/DLGImporter/DLGImp.cpp 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/DLGImporter/DLGImp.cpp 2007-03-13 19:35:48 UTC (rev 4556) @@ -104,8 +104,8 @@ DialogState* ds = new DialogState(); //16 = sizeof(State) str->Seek( StatesOffset + ( index * 16 ), GEM_STREAM_START ); - ieDword FirstTransitionIndex; - ieDword TriggerIndex; + ieDword FirstTransitionIndex; + ieDword TriggerIndex; str->ReadDword( &ds->StrRef ); str->ReadDword( &FirstTransitionIndex ); str->ReadDword( &ds->transitionsCount ); Modified: gemrb/trunk/gemrb/plugins/GUIScript/GUIScript.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/GUIScript/GUIScript.cpp 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/GUIScript/GUIScript.cpp 2007-03-13 19:35:48 UTC (rev 4556) @@ -6190,8 +6190,6 @@ core->GetSoundMgr()->Play(Sound); } core->DragItem (si, ResRef); - //this is PST specific, so the error flag is false - core->GetGUIScriptEngine()->RunFunction("UpdateAnimation", false); Py_INCREF( Py_None ); return Py_None; } @@ -6331,8 +6329,6 @@ if (Sound[0]) { core->GetSoundMgr()->Play(Sound); } - //this is PST specific, changes animation - core->GetGUIScriptEngine()->RunFunction("UpdateAnimation", false); return PyInt_FromLong( res ); } @@ -7705,16 +7701,11 @@ } work_ref.Name=opcodename; work_ref.EffText=-1; - EffectQueue::ResolveEffect(work_ref); - Effect *fx = core->GetEffect(work_ref.EffText); + Effect *fx = EffectQueue::CreateEffect(work_ref, param1, param2, FX_DURATION_INSTANT_PERMANENT_AFTER_BONUSES); if (!fx) { //invalid effect name didn't resolve to opcode return RuntimeError( "Invalid effect name!" ); } - fx->Parameter1=param1; - fx->Parameter2=param2; - fx->Probability1=100; - fx->TimingMode=FX_DURATION_INSTANT_PERMANENT_AFTER_BONUSES; //fx is freed by this function core->ApplyEffect(fx, actor, actor); Py_INCREF( Py_None ); Modified: gemrb/trunk/gemrb/plugins/IWDOpcodes/IWDOpc.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/IWDOpcodes/IWDOpc.cpp 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/IWDOpcodes/IWDOpc.cpp 2007-03-13 19:35:48 UTC (rev 4556) @@ -203,7 +203,7 @@ //function code (>=0x100). //If value is -1, then GemRB will use Param1, otherwise it is //compared to the target's stat using the relation function. -//The relation function is exactly the same as the extended +//The relation function is exactly the same as the extended //diffmode for gemrb. (Thus scripts can use the very same relation //functions). @@ -462,7 +462,7 @@ { if (0) printf( "fx_iwd_monster_summoning (%2d): ResRef:%s Anim:%s Type: %d\n", fx->Opcode, fx->Resource, fx->Resource2, fx->Parameter2 ); //check the summoning limit? - + ieResRef monster; ieResRef hit; ieResRef areahit; @@ -508,7 +508,7 @@ { if (0) printf( "fx_animate_dead (%2d): ResRef:%s Type: %d\n", fx->Opcode, fx->Resource, fx->Parameter2 ); //check the summoning limit? - + ieResRef monster; ieResRef hit; ieResRef areahit; @@ -525,8 +525,8 @@ } //f4,f5 (implemented in PST) -//0xf6 SummonMonster2 -#define IWD_SM2 11 +//0xf6 SummonMonster2 +#define IWD_SM2 11 ieResRef summon_monster_2da[IWD_SM2]={"SLIZARD","STROLLS","SSHADOW","ISTALKE", "CFELEMW","CEELEMW","CWELEMW","CFELEMP","CEELEMP","CWELEMP","CEELEMM"}; @@ -534,7 +534,7 @@ { if (0) printf( "fx_summon_monster2 (%2d): ResRef:%s Type: %d\n", fx->Opcode, fx->Resource, fx->Parameter2 ); //check the summoning limit? - + ieResRef monster; ieResRef hit; ieResRef areahit; @@ -601,7 +601,7 @@ { if (0) printf( "fx_summon_shadow_monster (%2d): ResRef:%s Type: %d\n", fx->Opcode, fx->Resource, fx->Parameter2 ); //check the summoning limit? - + ieResRef monster; ieResRef hit; ieResRef areahit; @@ -1238,9 +1238,9 @@ //418 FreeAction2 int fx_free_action_iwd2 (Actor* /*Owner*/, Actor* target, Effect* fx) { - if (0) printf( "fx_free_action_iwd2 (%2d)\n", fx->Opcode); + if (0) printf( "fx_free_action_iwd2 (%2d)\n", fx->Opcode); target->AddPortraitIcon(PI_FREEACTION); - return FX_APPLIED; + return FX_APPLIED; } //419 Unconsciousness //420 Death2 (see in core effects) Modified: gemrb/trunk/gemrb/plugins/MVEPlayer/MVEPlay.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/MVEPlayer/MVEPlay.cpp 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/MVEPlayer/MVEPlay.cpp 2007-03-13 19:35:48 UTC (rev 4556) @@ -159,8 +159,8 @@ video->InitMovieScreen(w,h); MVE_rmPrepMovie( ( void * ) mve, -1, -1, 1 ); - vSpec.screenWidth = w; - vSpec.screenHeight = h; + vSpec.screenWidth = w; + vSpec.screenHeight = h; MVE_getVideoSpec( &vSpec ); bpp = vSpec.truecolor ? 16 : 8; Modified: gemrb/trunk/gemrb/plugins/PNGImporter/PNGImp.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/PNGImporter/PNGImp.cpp 2007-03-13 18:47:13 UTC (rev 4555) +++ gemrb/trunk/gemrb/plugins/PNGImporter/PNGImp.cpp 2007-03-13 19:35:48 UTC (rev 4556) @@ -29,7 +29,7 @@ #include <png.h> static void DataStream_png_read_data(png_structp png_ptr, - png_bytep data, png_size_t length) + png_bytep data, png_size_t length) { voidp read_io_ptr = png_get_io_ptr(png_ptr); DataStream* str = reinterpret_cast<DataStream*>(read_io_ptr); @@ -49,8 +49,6 @@ static ieDword alpha_mask = 0xff000000; - - PNGImp::PNGImp(void) { str = 0; @@ -73,7 +71,7 @@ if (inf) { if (inf->png_ptr) { png_destroy_read_struct(&inf->png_ptr, &inf->info_ptr, - &inf->end_info); + &inf->end_info); } inf->png_ptr = 0; inf->info_ptr = 0; @@ -103,26 +101,26 @@ if (!inf->png_ptr) return false; - inf->info_ptr = png_create_info_struct(inf->png_ptr); - if (!inf->info_ptr) - { - png_destroy_read_struct(&inf->png_ptr, (png_infopp)NULL, - (png_infopp)NULL); - return false; - } + inf->info_ptr = png_create_info_struct(inf->png_ptr); + if (!inf->info_ptr) + { + png_destroy_read_struct(&inf->png_ptr, (png_infopp)NULL, + (png_infopp)NULL); + return false; + } - inf->end_info = png_create_info_struct(inf->png_ptr); - if (!inf->end_info) - { - png_destroy_read_struct(&inf->png_ptr, &inf->info_ptr, - (png_infopp)NULL); - return false; - } + inf->end_info = png_create_info_struct(inf->png_ptr); + if (!inf->end_info) + { + png_destroy_read_struct(&inf->png_ptr, &inf->info_ptr, + (png_infopp)NULL); + return false; + } - if (setjmp(png_jmpbuf(inf->png_ptr))) { - png_destroy_read_struct(&inf->png_ptr, &inf->info_ptr, &inf->end_info); - return false; - } + if (setjmp(png_jmpbuf(inf->png_ptr))) { + png_destroy_read_struct(&inf->png_ptr, &inf->info_ptr, &inf->end_info); + return false; + } png_set_read_fn(inf->png_ptr, stream, DataStream_png_read_data); png_set_sig_bytes(inf->png_ptr, 8); @@ -133,8 +131,8 @@ int bit_depth, color_type; int interlace_type, compression_type, filter_method; png_get_IHDR(inf->png_ptr, inf->info_ptr, &width, &height, - &bit_depth, &color_type, - &interlace_type, &compression_type, &filter_method); + &bit_depth, &color_type, + &interlace_type, &compression_type, &filter_method); if (color_type != PNG_COLOR_TYPE_PALETTE && png_get_valid(inf->png_ptr, inf->info_ptr, PNG_INFO_tRNS)) @@ -144,8 +142,8 @@ png_set_tRNS_to_alpha(inf->png_ptr); } - if (bit_depth == 16) - png_set_strip_16(inf->png_ptr); + if (bit_depth == 16) + png_set_strip_16(inf->png_ptr); if (color_type == PNG_COLOR_TYPE_RGB) png_set_filler(inf->png_ptr, 0xFF, PNG_FILLER_AFTER); @@ -175,12 +173,12 @@ for (unsigned int i = 0; i < Height; ++i) row_pointers[i] = reinterpret_cast<png_bytep>(&buffer[(hasPalette?1:4)*i*Width]); - if (setjmp(png_jmpbuf(inf->png_ptr))) { + if (setjmp(png_jmpbuf(inf->png_ptr))) { delete[] row_pointers; free( buffer ); - png_destroy_read_struct(&inf->png_ptr, &inf->info_ptr, &inf->end_info); - return false; - } + png_destroy_read_struct(&inf->png_ptr, &inf->info_ptr, &inf->end_info); + return false; + } png_read_image(inf->png_ptr, row_pointers); @@ -230,5 +228,5 @@ void PNGImp::PutImage(DataStream* /*output*/) { - // FIXME: add png code here + // FIXME: add png code here } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |