00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "pent_include.h"
00020
00021 #include "TargetedAnimProcess.h"
00022 #include "AnimationTracker.h"
00023
00024 #include "IDataSource.h"
00025 #include "ODataSource.h"
00026
00027
00028 DEFINE_RUNTIME_CLASSTYPE_CODE(TargetedAnimProcess,ActorAnimProcess);
00029
00030 TargetedAnimProcess::TargetedAnimProcess() : ActorAnimProcess()
00031 {
00032
00033 }
00034
00035 TargetedAnimProcess::TargetedAnimProcess(Actor* actor_, Animation::Sequence action, uint32 dir_, sint32 coords[3]) : ActorAnimProcess(actor_, action, dir_)
00036 {
00037 x = coords[0];
00038 y = coords[1];
00039 z = coords[2];
00040 }
00041
00042 bool TargetedAnimProcess::init()
00043 {
00044 if (!ActorAnimProcess::init())
00045 return false;
00046
00047 tracker->setTargetedMode(x, y, z);
00048 return true;
00049 }
00050
00051
00052 void TargetedAnimProcess::saveData(ODataSource* ods)
00053 {
00054 ActorAnimProcess::saveData(ods);
00055
00056 ods->write4(static_cast<uint32>(x));
00057 ods->write4(static_cast<uint32>(y));
00058 ods->write4(static_cast<uint32>(z));
00059
00060 }
00061
00062 bool TargetedAnimProcess::loadData(IDataSource* ids, uint32 version)
00063 {
00064 if (!ActorAnimProcess::loadData(ids, version)) return false;
00065
00066 x = ids->read4();
00067 y = ids->read4();
00068 z = ids->read4();
00069
00070 return true;
00071 }