CigiAnimationTable.cpp

Go to the documentation of this file.
00001 
00049 #define _EXPORT_CCL_
00050 
00051 #include "CigiAnimationTable.h"
00052 #include "CigiErrorCodes.h"
00053 
00054 #include <memory.h>
00055 
00056 
00057 // ====================================================================
00058 // Construction/Destruction
00059 // ====================================================================
00060 
00061 // ================================================
00062 // CigiAnimationTable
00063 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00064 CigiAnimationTable::CigiAnimationTable()
00065 {
00066 
00067    memset(AnimationTable,0,16384);
00068 
00069 }
00070 
00071 // ================================================
00072 // ~CigiAnimationTable
00073 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00074 CigiAnimationTable::~CigiAnimationTable()
00075 {
00076 
00077 }
00078 
00079 // ====================================================================
00080 // Accessors
00081 // ====================================================================
00082 
00083 // ================================================
00084 // GetPastAnimation
00085 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00086 Cigi_uint32 CigiAnimationTable::GetPastAnimation(const Cigi_uint16 EntityID)
00087 {
00088 
00089    int ndx;
00090    int shift;
00091 
00092    shift = EntityID & 0x3;
00093 
00094    ndx = EntityID >> 2;
00095 
00096    return((Cigi_uint32)(AnimationTable[ndx] >> shift) & 0x03);
00097 
00098 }
00099 
00100 
00101 
00102 // ================================================
00103 // SetPastAnimation
00104 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00105 int CigiAnimationTable::SetPastAnimation(const Cigi_uint16 EntityID, const Cigi_uint32 State)
00106 {
00107 
00108    int ndx;
00109    int shift;
00110    Cigi_uint8 mask;
00111 
00112    shift = EntityID & 0x3;
00113 
00114    ndx = EntityID >> 2;
00115 
00116    mask = 0x03 << shift;
00117    AnimationTable[ndx] = (AnimationTable[ndx] & (~mask)) |
00118                          ((Cigi_uint8)(State & 0x03) << shift);
00119 
00120    return(CIGI_SUCCESS);
00121 
00122 }

Generated on Wed Apr 29 08:59:57 2009 for CCL by  doxygen 1.4.7