Large diffs are not rendered by default.

@@ -36,7 +36,7 @@
// afxSelectronData::ewValidator
//
// When an effect is added using "addEffect", this validator intercepts the value
// and adds it to the dynamic effects list.
// and adds it to the dynamic effects list.
//
void afxSelectronData::ewValidator::validateType(SimObject* object, void* typePtr)
{
@@ -66,8 +66,8 @@ void afxSelectronData::ewValidator::validateType(SimObject* object, void* typePt
class SelectronFinishStartupEvent : public SimEvent
{
public:
void process(SimObject* obj)
{
void process(SimObject* obj)
{
afxSelectron* selectron = dynamic_cast<afxSelectron*>(obj);
if (selectron)
selectron->finish_startup();
@@ -170,7 +170,7 @@ void afxSelectronData::initPersistFields()
"...");

// effect lists
// for each of these, dummy_fx_entry is set and then a validator adds it to the appropriate effects list
// for each of these, dummy_fx_entry is set and then a validator adds it to the appropriate effects list
addFieldV("addMainEffect", TYPEID<afxEffectBaseData>(), myOffset(dummy_fx_entry), &_mainPhrase,
"...");
addFieldV("addSelectEffect", TYPEID<afxEffectBaseData>(), myOffset(dummy_fx_entry), &_selectPhrase,
@@ -198,7 +198,7 @@ bool afxSelectronData::onAdd()
{
if (Parent::onAdd() == false)
return false;

return true;
}

@@ -258,14 +258,14 @@ inline void expand_fx_list(afxEffectList& fx_list, const char* tag)
{
for (S32 i = 0; i < fx_list.size(); i++)
{
SimObjectId db_id = (SimObjectId)fx_list[i];
SimObjectId db_id = SimObjectId((uintptr_t)fx_list[i]);
if (db_id != 0)
{
// try to convert id to pointer
if (!Sim::findObject(db_id, fx_list[i]))
{
Con::errorf(ConsoleLogEntry::General,
"afxSelectronData::preload() -- bad datablockId: 0x%x (%s)",
Con::errorf(ConsoleLogEntry::General,
"afxSelectronData::preload() -- bad datablockId: 0x%x (%s)",
db_id, tag);
}
}
@@ -278,7 +278,7 @@ bool afxSelectronData::preload(bool server, String &errorStr)
return false;

// Resolve objects transmitted from server
if (!server)
if (!server)
{
if (do_id_convert)
{
@@ -459,7 +459,7 @@ void afxSelectron::onRemove()
U32 afxSelectron::packUpdate(NetConnection* conn, U32 mask, BitStream* stream)
{
U32 retMask = Parent::packUpdate(conn, mask, stream);

// InitialUpdate
if (stream->writeFlag(mask & InitialUpdateMask))
{
@@ -485,7 +485,7 @@ U32 afxSelectron::packUpdate(NetConnection* conn, U32 mask, BitStream* stream)
{
pack_constraint_info(conn, stream);
}

return retMask;
}

@@ -494,7 +494,7 @@ U32 afxSelectron::packUpdate(NetConnection* conn, U32 mask, BitStream* stream)
void afxSelectron::unpackUpdate(NetConnection * conn, BitStream * stream)
{
Parent::unpackUpdate(conn, stream);

bool initial_update = false;
bool zoned_in = true;
bool do_sync_event = false;
@@ -504,7 +504,7 @@ void afxSelectron::unpackUpdate(NetConnection * conn, BitStream * stream)

// InitialUpdate Only
if (stream->readFlag())
{
{
initial_update = true;

stream->read(&time_factor);
@@ -608,7 +608,7 @@ void afxSelectron::setup_main_fx()
phrases[MAIN_PHRASE] = new afxPhrase(isServerObject(), true);

if (phrases[MAIN_PHRASE])
phrases[MAIN_PHRASE]->init(datablock->main_fx_list, datablock->main_dur, this, time_factor,
phrases[MAIN_PHRASE]->init(datablock->main_fx_list, datablock->main_dur, this, time_factor,
datablock->n_main_loops);
}

@@ -685,7 +685,7 @@ void afxSelectron::process_server()
}

void afxSelectron::change_state_s(U8 pending_state)
{
{
if (effect_state == pending_state)
return;

@@ -721,7 +721,7 @@ void afxSelectron::change_state_s(U8 pending_state)
}

void afxSelectron::enter_done_state_s()
{
{
postEvent(DEACTIVATE_EVENT);

F32 done_time = effect_elapsed;
@@ -751,7 +751,7 @@ void afxSelectron::enter_done_state_s()
}

void afxSelectron::enter_active_state_s()
{
{
// stamp constraint-mgr starting time
constraint_mgr->setStartTime(Platform::getVirtualMilliseconds());
effect_elapsed = 0;
@@ -769,13 +769,13 @@ void afxSelectron::enter_active_state_s()
}

void afxSelectron::leave_active_state_s()
{
{
if (phrases[MAIN_PHRASE])
phrases[MAIN_PHRASE]->stop(effect_elapsed);
}

void afxSelectron::enter_cleanup_state_s()
{
{
// start deselect effects
setup_deselect_fx();
if (phrases[SELECT_PHRASE])
@@ -863,7 +863,7 @@ void afxSelectron::process_client(F32 dt)
}

void afxSelectron::change_state_c(U8 pending_state)
{
{
if (effect_state == pending_state)
return;

@@ -899,7 +899,7 @@ void afxSelectron::change_state_c(U8 pending_state)
}

void afxSelectron::enter_active_state_c(F32 starttime)
{
{
// stamp constraint-mgr starting time
constraint_mgr->setStartTime(Platform::getVirtualMilliseconds() - (U32)(effect_elapsed*1000));
///effect_elapsed = 0;
@@ -916,7 +916,7 @@ void afxSelectron::enter_active_state_c(F32 starttime)
}

void afxSelectron::leave_active_state_c()
{
{
if (phrases[MAIN_PHRASE])
{
//if (marks_mask & MARK_INTERRUPT)
@@ -927,7 +927,7 @@ void afxSelectron::leave_active_state_c()
}

void afxSelectron::enter_cleanup_state_c()
{
{
if (!client_only)
return;

@@ -940,7 +940,7 @@ void afxSelectron::enter_cleanup_state_c()
}

void afxSelectron::enter_done_state_c()
{
{
if (!client_only)
return;

@@ -974,7 +974,7 @@ void afxSelectron::enter_done_state_c()

void afxSelectron::sync_client(U16 marks, U8 state, F32 elapsed)
{
//Con::printf("SYNC marks=%d old_state=%d state=%d elapsed=%g",
//Con::printf("SYNC marks=%d old_state=%d state=%d elapsed=%g",
// marks, effect_state, state, elapsed);

if (effect_state != LATE_STATE)
@@ -1007,10 +1007,10 @@ void afxSelectron::sync_client(U16 marks, U8 state, F32 elapsed)
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// public:

void afxSelectron::postEvent(U8 event)
{
void afxSelectron::postEvent(U8 event)
{
setMaskBits(StateEventMask);

switch (event)
{
case ACTIVATE_EVENT:
@@ -1037,8 +1037,8 @@ void afxSelectron::finish_startup()
}

// static
afxSelectron*
afxSelectron::start_selectron(SceneObject* picked, U8 subcode, SimObject* extra)
afxSelectron*
afxSelectron::start_selectron(SceneObject* picked, U8 subcode, SimObject* extra)
{
U32 picked_type = (picked) ? picked->getTypeMask() : 0;

@@ -1068,8 +1068,8 @@ afxSelectron::start_selectron(SceneObject* picked, U8 subcode, SimObject* extra)
}

// CALL SCRIPT afxSelectronData::onPreactivate(%params, %extra)
const char* result = Con::executef(datablock, "onPreactivate",
Con::getIntArg(param_holder->getId()),
const char* result = Con::executef(datablock, "onPreactivate",
Con::getIntArg(param_holder->getId()),
(extra) ? Con::getIntArg(extra->getId()) : "");
if (result && result[0] != '\0' && !dAtob(result))
{
@@ -1110,10 +1110,10 @@ afxSelectron::start_selectron(SceneObject* picked, U8 subcode, SimObject* extra)
return selectron;
}

void afxSelectron::activate()
void afxSelectron::activate()
{
// separating the final part of startup allows the calling script
// to make certain types of calls on the returned effectron that
// to make certain types of calls on the returned effectron that
// need to happen prior to constraint initialization.
Sim::postEvent(this, new SelectronFinishStartupEvent, Sim::getCurrentTime());

@@ -83,20 +83,20 @@ bool afxSpellBookData::preload(bool server, String &errorStr)
return false;

// Resolve objects transmitted from server
if (!server)
if (!server)
{
if (do_id_convert)
{
for (S32 i = 0; i < pages_per_book*spells_per_page; i++)
{
SimObjectId db_id = (SimObjectId) rpg_spells[i];
SimObjectId db_id = SimObjectId((uintptr_t)rpg_spells[i]);
if (db_id != 0)
{
// try to convert id to pointer
if (!Sim::findObject(db_id, rpg_spells[i]))
{
Con::errorf(ConsoleLogEntry::General,
"afxSpellBookData::preload() -- bad datablockId: 0x%x (afxRPGMagicSpellData)",
Con::errorf(ConsoleLogEntry::General,
"afxSpellBookData::preload() -- bad datablockId: 0x%x (afxRPGMagicSpellData)",
db_id);
}
}
@@ -213,7 +213,7 @@ bool afxSpellBook::onNewDataBlock(GameBaseData* dptr, bool reload)

bool afxSpellBook::onAdd()
{
if (!Parent::onAdd())
if (!Parent::onAdd())
return(false);

return(true);
@@ -265,7 +265,7 @@ char* afxSpellBook::formatDesc(char* buffer, int len, S32 page, S32 slot) const
S32 idx = mDataBlock->getPageSlotIndex(page, slot);
if (idx < 0 || !mDataBlock->rpg_spells[idx])
return SPELL_DATA_NOT_FOUND;

return mDataBlock->rpg_spells[idx]->formatDesc(buffer, len);
}

@@ -274,7 +274,7 @@ const char* afxSpellBook::getSpellIcon(S32 page, S32 slot) const
S32 idx = mDataBlock->getPageSlotIndex(page, slot);
if (idx < 0 || !mDataBlock->rpg_spells[idx])
return 0;

return mDataBlock->rpg_spells[idx]->icon_name;
}

@@ -283,7 +283,7 @@ bool afxSpellBook::isPlaceholder(S32 page, S32 slot) const
S32 idx = mDataBlock->getPageSlotIndex(page, slot);
if (idx < 0 || !mDataBlock->rpg_spells[idx])
return false;

return mDataBlock->rpg_spells[idx]->is_placeholder;
}

@@ -33,7 +33,7 @@
#endif

#define AFX_VERSION_STRING "2.0"
#define AFX_VERSION 2.0
#define AFX_VERSION 2.0

// #define AFX_CUSTOMIZED_BRANCH

@@ -167,11 +167,11 @@ class ByteRange
public:
U8 low;
U8 high;

public:
/*C*/ ByteRange() { low = 0; high = 255; }
/*C*/ ByteRange(U8 l, U8 h=255) { low = l; high = h; }

void set(U8 l, U8 h=255) { low = l; high = h; }
bool outOfRange(U8 v) { return (v < low || v > high); }
bool inRange(U8 v) { return !outOfRange(v); }
@@ -186,13 +186,13 @@ DefineConsoleType(TypeByteRange2, ByteRange)
inline void writeDatablockID(BitStream* s, SimObject* simobj, bool packed=false)
{
if (s->writeFlag(simobj))
s->writeRangedU32(packed ? SimObjectId(simobj) : simobj->getId(),
s->writeRangedU32(packed ? SimObjectId((uintptr_t)simobj) : simobj->getId(),
DataBlockObjectIdFirst, DataBlockObjectIdLast);
}

inline S32 readDatablockID(BitStream* s)
{
return (!s->readFlag()) ? 0 : ((S32)s->readRangedU32(DataBlockObjectIdFirst,
return (!s->readFlag()) ? 0 : ((S32)s->readRangedU32(DataBlockObjectIdFirst,
DataBlockObjectIdLast));
}

@@ -98,13 +98,13 @@ void afxT3DLightBaseData::initPersistFields()
// are injected at runtime by the lighting system itself.

addGroup( "Light" );

addField( "isEnabled", TypeBool, Offset( mIsEnabled, afxT3DLightBaseData ),
"Enables/Disables the object rendering and functionality in the scene.");
addField( "color", TypeColorF, Offset( mColor, afxT3DLightBaseData ),
"Changes the base color hue of the light.");
addField( "brightness", TypeF32, Offset( mBrightness, afxT3DLightBaseData ),
"Adjusts the lights power, 0 being off completely.");
"Adjusts the lights power, 0 being off completely.");
addField( "castShadows", TypeBool, Offset( mCastShadows, afxT3DLightBaseData ),
"Enables/disables shadow casts by this light.");
addField( "priority", TypeF32, Offset( mPriority, afxT3DLightBaseData ),
@@ -163,7 +163,7 @@ void afxT3DLightBaseData::packData(BitStream* stream)

// note: BitStream's overloaded write() for ColorF will convert
// to ColorI for transfer and then back to ColorF. This is fine
// for most color usage but for lighting colors we want to preserve
// for most color usage but for lighting colors we want to preserve
// "pushed" color values which may be greater than 1.0 so the color
// is instead sent as individual color primaries.
stream->write( mColor.red );
@@ -189,7 +189,7 @@ void afxT3DLightBaseData::unpackData(BitStream* stream)
stream->read( &mColor.blue );
mColor.alpha = 1.0f;

stream->read( &mBrightness );
stream->read( &mBrightness );
mCastShadows = stream->readFlag();
stream->read( &mAnimState.animationPeriod );
stream->read( &mAnimState.animationPhase );
@@ -207,11 +207,11 @@ bool afxT3DLightBaseData::preload(bool server, String &errorStr)
return false;

// Resolve objects transmitted from server
if (!server)
if (!server)
{
if (do_id_convert)
{
SimObjectId anim_id = (SimObjectId)mAnimationData;
SimObjectId anim_id = SimObjectId((uintptr_t)mAnimationData);
if (anim_id != 0)
{
// try to convert id to pointer
@@ -222,7 +222,7 @@ bool afxT3DLightBaseData::preload(bool server, String &errorStr)
anim_id);
}
}
SimObjectId flare_id = (SimObjectId)mFlareData;
SimObjectId flare_id = SimObjectId((uintptr_t)mFlareData);
if (flare_id != 0)
{
// try to convert id to pointer
@@ -271,7 +271,7 @@ bool afxPhraseEffectData::preload(bool server, String &errorStr)
{
for (S32 i = 0; i < fx_list.size(); i++)
{
SimObjectId db_id = (SimObjectId) fx_list[i];
SimObjectId db_id = SimObjectId((uintptr_t)fx_list[i]);
if (db_id != 0)
{
// try to convert id to pointer
@@ -50,9 +50,9 @@ S32 SimDataBlock::sNextModifiedKey = 0;
ConsoleDocClass( SimDataBlock,
"@brief \n"
"@ingroup \n"

"@section Datablock_Networking Datablocks and Networking\n"

"@section Datablock_ClientSide Client-Side Datablocks\n"
);

@@ -99,15 +99,15 @@ SimDataBlock::SimDataBlock(const SimDataBlock& other, bool temp_clone) : SimObje
// a destructor is added to SimDataBlock so that we can delete any substitutions.
SimDataBlock::~SimDataBlock()
{
clear_substitutions();
clear_substitutions();
}

void SimDataBlock::clear_substitutions()
{
for (S32 i = 0; i < substitutions.size(); i++)
delete substitutions[i];
substitutions.clear();
}
}

void SimDataBlock::addSubstitution(StringTableEntry slot, S32 idx, const char* subst)
{
@@ -189,13 +189,13 @@ void SimDataBlock::copySubstitutionsFrom(SimDataBlock* other)

//
// This is the method that evaluates any substitution statements on a datablock and does the
// actual replacement of substituted datablock fields.
// actual replacement of substituted datablock fields.
//
// Much of the work is done by passing the statement to Con::evaluate() but first there are
// some key operations performed on the statement.
// some key operations performed on the statement.
// -- Instances of "%%" in the statement are replaced with the id of the <obj> object.
// -- Instances of "##" are replaced with the value of <index>.
//
//
// There are also some return values that get special treatment.
// -- An empty result will produce a realtime error message.
// -- A result of "~~" will leave the original field value unchanged.
@@ -254,12 +254,12 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o
else
{
b[0] = v[0];
b++;
b++;
v++;
}
}

AssertFatal((U32)b < (U32)b_oob, "Substitution buffer overflowed");
AssertFatal(U32((uintptr_t)b) < U32((uintptr_t)b_oob), "Substitution buffer overflowed");

b[0] = '\0';

@@ -269,7 +269,7 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o
const char *result = Con::evaluate(avar("return %s;", buffer), false, 0);
if (Compiler::gSyntaxError)
{
Con::errorf("Field Substitution Failed: field=\"%s\" substitution=\"%s\" -- syntax error",
Con::errorf("Field Substitution Failed: field=\"%s\" substitution=\"%s\" -- syntax error",
substitutions[i]->slot, substitutions[i]->value);
Compiler::gSyntaxError = false;
return;
@@ -278,7 +278,7 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o
// output a runtime console error when a substitution produces and empty result.
if (result == 0 || result[0] == '\0')
{
Con::errorf("Field Substitution Failed: field=\"%s\" substitution=\"%s\" -- empty result",
Con::errorf("Field Substitution Failed: field=\"%s\" substitution=\"%s\" -- empty result",
substitutions[i]->slot, substitutions[i]->value);
return;
}
@@ -304,7 +304,7 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o

if (field->keepClearSubsOnly && result[0] != '\0')
{
Con::errorf("Field Substitution Failed: field \"%s\" of datablock %s only allows \"$$ ~~\" (keep) and \"$$ ~0\" (clear) field substitutions. [%s]",
Con::errorf("Field Substitution Failed: field \"%s\" of datablock %s only allows \"$$ ~~\" (keep) and \"$$ ~0\" (clear) field substitutions. [%s]",
substitutions[i]->slot, this->getClassName(), this->getName());
continue;
}
@@ -344,7 +344,7 @@ bool SimDataBlock::onAdd()
if ( !isClientOnly() )
if (SimGroup* grp = Sim::getDataBlockGroup())
grp->addObject(this);

Sim::getDataBlockSet()->addObject( this );

return true;