Skip to content

Commit

Permalink
Refactor|libhexen|ACScript: Renamed ACScriptInterpreter methods for c…
Browse files Browse the repository at this point in the history
…onsistency
  • Loading branch information
danij-deng committed Mar 25, 2014
1 parent 0696bfe commit fae6036
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -3277,7 +3277,7 @@ void G_DoLoadSession(de::String slotId)
// Deserialize the world ACS data.
if(de::File const *file = session.tryLocateStateFile("ACScript"))
{
Game_ACScriptInterpreter().readWorldScriptData(de::Reader(*file));
Game_ACScriptInterpreter().readWorldState(de::Reader(*file));
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/gamesessionwriter.cpp
Expand Up @@ -63,7 +63,7 @@ DENG2_PIMPL_NOREF(GameSessionWriter)
#if __JHEXEN__
Block data;
de::Writer writer(data);
Game_ACScriptInterpreter().writeWorldScriptData(writer);
Game_ACScriptInterpreter().writeWorldState(writer);
arch.add("ACScriptState", data);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/mapstatereader.cpp
Expand Up @@ -668,7 +668,7 @@ DENG2_PIMPL(MapStateReader)
{
#if __JHEXEN__
beginSegment(ASEG_SCRIPTS);
Game_ACScriptInterpreter().readMapScriptData(thisPublic);
Game_ACScriptInterpreter().readMapState(thisPublic);
// endSegment();
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/mapstatewriter.cpp
Expand Up @@ -231,7 +231,7 @@ DENG2_PIMPL(MapStateWriter)
{
#if __JHEXEN__
beginSegment(ASEG_SCRIPTS);
Game_ACScriptInterpreter().writeMapScriptData(thisPublic);
Game_ACScriptInterpreter().writeMapState(thisPublic);
// endSegment();
#endif
}
Expand Down
8 changes: 4 additions & 4 deletions doomsday/plugins/hexen/include/acscript.h
Expand Up @@ -209,11 +209,11 @@ class ACScriptInterpreter
*/
AutoStr *scriptDescription(int scriptNumber);

void writeWorldScriptData(de::Writer &to) const;
void readWorldScriptData(de::Reader &from);
void writeWorldState(de::Writer &to) const;
void readWorldState(de::Reader &from);

void writeMapScriptData(MapStateWriter *msw);
void readMapScriptData(MapStateReader *msr);
void writeMapState(MapStateWriter *msw);
void readMapState(MapStateReader *msr);

public: /// @todo make private:
BytecodeScriptInfo &scriptInfoByIndex(int index);
Expand Down
9 changes: 4 additions & 5 deletions doomsday/plugins/hexen/src/acscript.cpp
Expand Up @@ -467,7 +467,7 @@ void ACScriptInterpreter::scriptFinished(ACScript *script)
Thinker_Remove(&script->thinker);
}

void ACScriptInterpreter::writeWorldScriptData(de::Writer &to) const
void ACScriptInterpreter::writeWorldState(de::Writer &to) const
{
to << byte(4); // Version.

Expand All @@ -479,14 +479,13 @@ void ACScriptInterpreter::writeWorldScriptData(de::Writer &to) const

// Write the deferred task queue.
to << _deferredTasksSize;

for(int i = 0; i < _deferredTasksSize; ++i)
{
to << _deferredTasks[i];
}
}

void ACScriptInterpreter::readWorldScriptData(de::Reader &from)
void ACScriptInterpreter::readWorldState(de::Reader &from)
{
byte ver; from >> ver;

Expand All @@ -509,7 +508,7 @@ void ACScriptInterpreter::readWorldScriptData(de::Reader &from)
}
}

void ACScriptInterpreter::writeMapScriptData(MapStateWriter *msw)
void ACScriptInterpreter::writeMapState(MapStateWriter *msw)
{
Writer *writer = msw->writer();

Expand All @@ -526,7 +525,7 @@ void ACScriptInterpreter::writeMapScriptData(MapStateWriter *msw)
}
}

void ACScriptInterpreter::readMapScriptData(MapStateReader *msr)
void ACScriptInterpreter::readMapState(MapStateReader *msr)
{
Reader *reader = msr->reader();

Expand Down

0 comments on commit fae6036

Please sign in to comment.