24 #ifndef SWORD2_OBJECT_H 25 #define SWORD2_OBJECT_H 27 #include "common/endian.h" 50 void read(
const byte *addr);
51 void write(byte *addr);
78 int32 getLooping() {
return READ_LE_UINT32(_addr); }
79 int32 getPause() {
return READ_LE_UINT32(_addr + 4); }
81 void setLooping(int32 x) { WRITE_LE_UINT32(_addr, x); }
82 void setPause(int32 x) { WRITE_LE_UINT32(_addr + 4, x); }
89 #define NO_SPRITE 0x00000000 // don't print 90 #define BGP0_SPRITE 0x00000001 // fixed to background parallax[0] 91 #define BGP1_SPRITE 0x00000002 // fixed to background parallax[1] 92 #define BACK_SPRITE 0x00000004 // 'background' sprite, fixed to main background 93 #define SORT_SPRITE 0x00000008 // 'sorted' sprite, fixed to main background 94 #define FORE_SPRITE 0x00000010 // 'foreground' sprite, fixed to main background 95 #define FGP0_SPRITE 0x00000020 // fixed to foreground parallax[0] 96 #define FGP1_SPRITE 0x00000040 // fixed to foreground parallax[0] 100 #define UNSHADED_SPRITE 0x00000000 // not to be shaded 101 #define SHADED_SPRITE 0x00010000 // to be shaded, based on shading mask 126 int32 getType() {
return READ_LE_UINT32(_addr); }
127 int32 getAnimResource() {
return READ_LE_UINT32(_addr + 4); }
128 int32 getAnimPc() {
return READ_LE_UINT32(_addr + 8); }
130 void setType(int32 x) { WRITE_LE_UINT32(_addr, x); }
131 void setAnimResource(int32 x) { WRITE_LE_UINT32(_addr + 4, x); }
132 void setAnimPc(int32 x) { WRITE_LE_UINT32(_addr + 8, x); }
165 int32 getPen() {
return READ_LE_UINT32(_addr); }
166 int32 getWidth() {
return READ_LE_UINT32(_addr + 4); }
167 int32 getCommand() {
return READ_LE_UINT32(_addr + 8); }
168 int32 getIns1() {
return READ_LE_UINT32(_addr + 12); }
169 int32 getIns2() {
return READ_LE_UINT32(_addr + 16); }
170 int32 getIns3() {
return READ_LE_UINT32(_addr + 20); }
171 int32 getIns4() {
return READ_LE_UINT32(_addr + 24); }
172 int32 getIns5() {
return READ_LE_UINT32(_addr + 28); }
173 int32 getWaitState() {
return READ_LE_UINT32(_addr + 32); }
175 void setPen(int32 x) { WRITE_LE_UINT32(_addr, x); }
176 void setWidth(int32 x) { WRITE_LE_UINT32(_addr + 4, x); }
177 void setCommand(int32 x) { WRITE_LE_UINT32(_addr + 8, x); }
178 void setIns1(int32 x) { WRITE_LE_UINT32(_addr + 12, x); }
179 void setIns2(int32 x) { WRITE_LE_UINT32(_addr + 16, x); }
180 void setIns3(int32 x) { WRITE_LE_UINT32(_addr + 20, x); }
181 void setIns4(int32 x) { WRITE_LE_UINT32(_addr + 24, x); }
182 void setIns5(int32 x) { WRITE_LE_UINT32(_addr + 28, x); }
183 void setWaitState(int32 x) { WRITE_LE_UINT32(_addr + 32, x); }
227 int32 getIsWalking() {
return READ_LE_UINT32(_addr + 16); }
228 int32 getWalkPc() {
return READ_LE_UINT32(_addr + 20); }
229 int32 getScaleA() {
return READ_LE_UINT32(_addr + 24); }
230 int32 getScaleB() {
return READ_LE_UINT32(_addr + 28); }
231 int32 getFeetX() {
return READ_LE_UINT32(_addr + 32); }
232 int32 getFeetY() {
return READ_LE_UINT32(_addr + 36); }
233 int32 getCurDir() {
return READ_LE_UINT32(_addr + 40); }
234 int32 getMegasetRes() {
return READ_LE_UINT32(_addr + 48); }
236 void setIsWalking(int32 x) { WRITE_LE_UINT32(_addr + 16, x); }
237 void setWalkPc(int32 x) { WRITE_LE_UINT32(_addr + 20, x); }
238 void setScaleA(int32 x) { WRITE_LE_UINT32(_addr + 24, x); }
239 void setScaleB(int32 x) { WRITE_LE_UINT32(_addr + 28, x); }
240 void setFeetX(int32 x) { WRITE_LE_UINT32(_addr + 32, x); }
241 void setFeetY(int32 x) { WRITE_LE_UINT32(_addr + 36, x); }
242 void setCurDir(int32 x) { WRITE_LE_UINT32(_addr + 40, x); }
243 void setMegasetRes(int32 x) { WRITE_LE_UINT32(_addr + 48, x); }
252 return (getScaleA() * getFeetY() + getScaleB()) / 256;
261 int32 usingStandingTurnFrames;
262 int32 usingWalkingTurnFrames;
263 int32 usingSlowInFrames;
264 int32 usingSlowOutFrames;
265 int32 nSlowInFrames[8];
267 int32 dx[8 * (12 + 1)];
268 int32 dy[8 * (12 + 1)];
274 void read(
const byte *addr);
275 void write(byte *addr);
Definition: animation.h:37