// C Header File // Created 12/28/2002; 11:29:40 AM extern TEXANIMATION animations[MAX_DIFFERENT_ANIMATED_WALLS]; static inline void InitAnimatedWalls(void); static inline void AnimateWalls(void); static inline void CheckForCustomWallDeath(short a); #ifndef __WALLS_TXT__ #define __WALLS_TXT__ TEXANIMATION animations[MAX_DIFFERENT_ANIMATED_WALLS]; static inline void InitAnimatedWalls(void) { register GameGlobals *ggg asm("a4") = gg; #include "walls_animated.txt" short max = (signed)(sizeof(animatedwalls)/sizeof(animatedwalls[0])); short a,i; short count = 0; char done[max]; inline short FindIndex(char texture) { short b; for(b=0;bmap_width*fc->map_height;a++) { if(count == MAX_DIFFERENT_ANIMATED_WALLS) { ggg->total_animated_walls = count; return; } for(i=0;i<(signed)(sizeof(animatedwalls)/sizeof(animatedwalls[0]));i++) { if(fc->map_data[a] == animatedwalls[i][0]) { short orig = FindIndex(animatedwalls[i][0]); short temp; if(orig == -1) temp = count; else temp = orig; animations[temp].dest = &ggg->textures[temp+TOTAL_TEXCONFIGS_IN_oblvgfx1+MAX_UNIQUE_BUTTONS*2]; animations[temp].sources = &ggg->textures[animatedwalls[i][0]-1]; animations[temp].anim_steps = animatedwalls[i][1]; animations[temp].anim_idx = 0; fc->map_data[a] = TOTAL_TEXCONFIGS_IN_oblvgfx1+MAX_UNIQUE_BUTTONS*2+temp+1; if(orig==-1) { done[count] = animatedwalls[i][0]; count++; } } } } ggg->total_animated_walls = count; } static inline void AnimateWalls(void) { register GameGlobals *ggg asm("a4") = gg; short a; for(a=0;atotal_animated_walls;a++) { FAT_UpdateAnimation(&animations[a]); } } static inline void CheckForCustomWallDeath(short a) { register GameGlobals *ggg asm("a4") = gg; char temp = fc->map_data[a]; short i; #include "walls_hit.txt" if(temp!=fc->map_data[a]) return; for(i=0;itotal_animated_walls;i++) { char src = (char)(((long)animations[i].sources- (long)&ggg->textures[0])/(long)sizeof(TEXCONFIG))+1; char dest = (char)(((long)animations[i].dest- (long)&ggg->textures[0])/(long)sizeof(TEXCONFIG))+1; if(fc->map_data[a] == dest) { fc->map_data[a] = src; #include "walls_hit.txt" else fc->map_data[a] = dest; } } } #endif