PAlib: Fichier source de PA_BgLargeMap.h

Page principale | Modules | Liste des fichiers | Portée globale | Rechercher

# PA_BgLargeMap.h

Aller à la documentation de ce fichier.

    00001 #ifndef _PA_BGLARGEMAP
    00002 #define _PA_BGLARGEMAP
    00003
    00004
    00005 #include "PA_BgTiles.h"
    00006
    00007
    00008
    00058 #define PA_LoadLargeBg(screen, bg_select, bg_tiles, bg_map, color_mode, lx, ly) {\
    00059 PA_LoadSimpleBg(screen, bg_select, bg_tiles, Blank, BG_512X256, 0, color_mode);\
    00060 PA_InitLargeBg(screen, bg_select, lx, ly, (void*)bg_map);}
    00061
    00062
    00063
    00064
    00080 #define PA_LoadPAGfxLargeBg(screen, bg_number, bg_name){\
    00081        PA_LoadBgPal(screen, bg_number, (void*)bg_name##_Pal); \
    00082        PA_LoadLargeBg(screen, bg_number, bg_name##_Tiles, bg_name##_Map, 1, (bg_name##_Width) >> 3, (bg_name##_Height) >> 3);}
    00083
    00084
    00085
    00116 #define PA_LoadLargeBgEx(screen, bg_select, bg_tiles, tile_size, bg_map, color_mode, lx, ly) {\
    00117 PA_LoadBg(screen, bg_select, bg_tiles, tile_size, Blank, BG_512X256, 0, color_mode);\
    00118 PA_InitLargeBg(screen, bg_select, lx, ly, (void*)bg_map);}
    00119
    00120
    00121
    00122
    00138 void PA_InfLargeScrollX(u8 screen, u8 bg_select, s32 x);
    00139
    00140
    00156 void PA_InfLargeScrollY(u8 screen, u8 bg_select, s32 y);
    00157
    00158
    00159
    00178 extern inline void PA_InfLargeScrollXY(u8 screen, u8 bg_select, s32 x, s32 y){
    00179        PA_InfLargeScrollX(screen, bg_select, x);
    00180        PA_InfLargeScrollY(screen, bg_select, y);
    00181 }
    00182
    00198 void PA_LargeScrollX(u8 screen, u8 bg_select, s32 x);
    00199
    00200
    00216 void PA_LargeScrollY(u8 screen, u8 bg_select, s32 y);
    00217
    00218
    00219
    00238 extern inline void PA_LargeScrollXY(u8 screen, u8 bg_select, s32 x, s32 y){
    00239        PA_LargeScrollX(screen, bg_select, x);
    00240        PA_LargeScrollY(screen, bg_select, y);
    00241 }
    00242
    00243
    00244
    00266 extern inline void PA_InitParallaxX(u8 screen, s32 bg0, s32 bg1, s32 bg2, s32 bg3) {
    00267         PA_parallaxX[screen][0] = bg0;
    00268         PA_parallaxX[screen][1] = bg1;
    00269         PA_parallaxX[screen][2] = bg2;
    00270         PA_parallaxX[screen][3] = bg3;
    00271 }
    00272
    00294 extern inline void PA_InitParallaxY(u8 screen, s32 bg0, s32 bg1, s32 bg2, s32 bg3) {
    00295         PA_parallaxY[screen][0] = bg0;
    00296         PA_parallaxY[screen][1] = bg1;
    00297         PA_parallaxY[screen][2] = bg2;
    00298         PA_parallaxY[screen][3] = bg3;
    00299 }
    00300
    00301
    00302
    00315 extern inline void PA_ParallaxScrollX(u8 screen, s32 x){
    00316 u8 i;
    00317        for(i = 0; i < 4; i++) {
    00318               if (PA_parallaxX[screen][i])  {
    00319                      if(scrollpos[screen][i].infscroll) PA_InfLargeScrollX(screen, i, (PA_parallaxX[screen][i] * x) >> 8); // Si bg en scrolling infini
    00320                      else PA_BGScrollX(screen, i, (PA_parallaxX[screen][i] * x) >> 8); // Sinon scrolling normal
    00321               }
    00322        }
    00323 }
    00324
    00325
    00338 extern inline void PA_ParallaxScrollY(u8 screen, s32 y){
    00339 u8 i;
    00340        for(i = 0; i < 4; i++) {
    00341               if (PA_parallaxY[screen][i])  {
    00342                      if(scrollpos[screen][i].infscroll) PA_InfLargeScrollY(screen, i, (PA_parallaxY[screen][i] * y) >> 8); // Si bg en scrolling infini
    00343                      else PA_BGScrollY(screen, i, (PA_parallaxY[screen][i] * y) >> 8); // Sinon scrolling normal
    00344               }
    00345        }
    00346 }
    00347
    00348
    00364 extern inline void PA_ParallaxScrollXY(u8 screen, s32 x, s32 y){
    00365        PA_ParallaxScrollX(screen, x);
    00366        PA_ParallaxScrollY(screen, y);
    00367 }
    00368
    00369  // end of BgLargeMap
    00371
    00372
    00373
    00374 // Pas utilisé en direct par le programmaeur
    00375 void PA_InitLargeBg(u8 screen, u8 bg_select, s32 lx, s32 ly, void* bg_map);
    00376
    00377
    00378
    00379 #endif
    00380