TargetedAnimProcess.cpp

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2003-2004 The Pentagram team
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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 // p_dynamic_cast stuff
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 }

Generated on Fri Jul 27 22:27:40 2007 for pentagram by  doxygen 1.4.7