PAlib: Fichier source de PA_TileDual.h

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

# PA_TileDual.h

Aller à la documentation de ce fichier.

    00001 #ifndef _PA_TileDual
    00002 #define _PA_TileDual
    00003
    00004
    00005
    00012 #include "PA_Tile.h"
    00013
    00014
    00015
    00016
    00017
    00018
    00019
    00035 extern inline void PA_DualHideBg(u8 bg_select){
    00036        PA_HideBg(0, bg_select);
    00037        PA_HideBg(1, bg_select);
    00038 }
    00039
    00049 extern inline void PA_DualShowBg(u8 bg_select){
    00050        PA_ShowBg(0, bg_select);
    00051        PA_ShowBg(1, bg_select);
    00052 }
    00053
    00054
    00055
    00062 extern inline void PA_DualResetBg(void){
    00063        PA_ResetBg(0);
    00064        PA_ResetBg(1);
    00065 }
    00066
    00067
    00068
    00069
    00070
    00080 extern inline void PA_DualDeleteBg(u8 bg_select){
    00081        PA_DeleteBg(0, bg_select);
    00082        PA_DeleteBg(1, bg_select);
    00083 }
    00084
    00085
    00086
    00087
    00088
    00101 #define PA_DualLoadTiledBg(bg_number, bg_name){\
    00102        PA_LoadTiledBg(0, bg_number, bg_name);\
    00103        PA_LoadTiledBg(1, bg_number, bg_name);\
    00104        PA_DualBGScrollY(bg_number, 0);}
    00105
    00106
    00107
    00108
    00109
    00110
    00136 #define PA_DualLoadSimpleBg(bg_select, bg_tiles, bg_map, bg_size, wraparound, color_mode) {\
    00137 PA_LoadSimpleBg(0, bg_select, bg_tiles, bg_map, bg_size, wraparound, color_mode);\
    00138 PA_LoadSimpleBg(1, bg_select, bg_tiles, bg_map, bg_size, wraparound, color_mode);\
    00139 PA_DualBGScrollY(bg_select, 0);}
    00140
    00141
    00142
    00164 #define PA_DualLoadRotBg(bg_select, bg_tiles, bg_map, bg_size, wraparound) {\
    00165 PA_LoadRotBg(0, bg_select, bg_tiles, bg_map, bg_size, wraparound);\
    00166 PA_LoadRotBg(1, bg_select, bg_tiles, bg_map, bg_size, wraparound);\
    00167 PA_DualBGScrollY(bg_select, 0);}
    00168
    00169
    00170
    00171 extern inline void PA_DualSetBgRot(u8 bg_select, s32 x_scroll, s32 y_scroll, s32 x_rotcentre, s32 y_rotcentre, s16 bg_angle, s32 bg_zoom){
    00172 PA_SetBgRot(0, bg_select, x_scroll, y_scroll, x_rotcentre, y_rotcentre, bg_angle, bg_zoom);
    00173 PA_SetBgRot(1, bg_select, x_scroll, y_scroll, x_rotcentre, y_rotcentre, bg_angle, bg_zoom);
    00174 }
    00175
    00176
    00177
    00206 #define PA_DualLoadBg(bg_select, bg_tiles, tile_size, bg_map, bg_size, wraparound, color_mode) {\
    00207 PA_LoadBg(0, bg_select, bg_tiles, tile_size, bg_map, bg_size, wraparound, color_mode);\
    00208 PA_LoadBg(1, bg_select, bg_tiles, tile_size, bg_map, bg_size, wraparound, color_mode);\
    00209 PA_DualBGScrollY(bg_select, 0);}
    00210
    00211
    00212
    00225 extern inline void PA_DualBGScrollX(u8 bg_number, s16 x){
    00226        PA_BGScrollX(0, bg_number, x);
    00227        PA_BGScrollX(1, bg_number, x);
    00228 }
    00229
    00230
    00231
    00232
    00245 extern inline void PA_DualBGScrollY(u8 bg_number, s16 y){
    00246        PA_BGScrollY(0, bg_number, y+PA_ScreenSpace);
    00247        PA_BGScrollY(1, bg_number, y);
    00248 }
    00249
    00250
    00251
    00252
    00268 extern inline void PA_DualBGScrollXY(u8 bg_number, s16 x, s16 y) {
    00269        PA_DualBGScrollX(bg_number, x);
    00270        PA_DualBGScrollY(bg_number, y);
    00271 }
    00272
    00273
    00274
    00275
    00288 #define PA_DualLoadPAGfxLargeBg(bg_number, bg_name){\
    00289        PA_LoadPAGfxLargeBg(0, bg_number, bg_name);\
    00290        PA_LoadPAGfxLargeBg(1, bg_number, bg_name);\
    00291        PA_DualInfLargeScrollY(bg_number, 0);}
    00292
    00293
    00294
    00295
    00320 #define PA_DualLoadLargeBg(bg_select, bg_tiles, bg_map, color_mode, lx, ly){\
    00321 PA_LoadLargeBg(0, bg_select, bg_tiles, bg_map, color_mode, lx, ly);\
    00322 PA_LoadLargeBg(1, bg_select, bg_tiles, bg_map, color_mode, lx, ly);\
    00323 PA_DualInfLargeScrollY(bg_select, 0);}
    00324
    00325
    00326
    00327
    00328
    00356 #define PA_DualLoadLargeBgEx(bg_select, bg_tiles, tile_size, bg_map, color_mode, lx, ly) {\
    00357 PA_LoadLargeBgEx(0, bg_select, bg_tiles, tile_size, bg_map, color_mode, lx, ly);\
    00358 PA_LoadLargeBgEx(1, bg_select, bg_tiles, tile_size, bg_map, color_mode, lx, ly);\
    00359 PA_DualInfLargeScrollY(bg_select, 0);}
    00360
    00361
    00362
    00363
    00376 extern inline void PA_DualInfLargeScrollX(u8 bg_select, s32 x){
    00377        PA_InfLargeScrollX(0, bg_select, x);
    00378        PA_InfLargeScrollX(1, bg_select, x);
    00379 }
    00380
    00381
    00382
    00395 extern inline void PA_DualInfLargeScrollY(u8 bg_select, s32 y){
    00396        PA_InfLargeScrollY(0, bg_select, y+PA_ScreenSpace);
    00397        PA_InfLargeScrollY(1, bg_select, y);
    00398 }
    00399
    00400
    00416 extern inline void PA_DualInfLargeScrollXY(u8 bg_select, s32 x, s32 y){
    00417        PA_DualInfLargeScrollX(bg_select, x);
    00418        PA_DualInfLargeScrollY(bg_select, y);
    00419 }
    00420
    00433 extern inline void PA_DualLargeScrollX(u8 bg_select, s32 x){
    00434        PA_LargeScrollX(0, bg_select, x);
    00435        PA_LargeScrollX(1, bg_select, x);
    00436 }
    00437
    00450 extern inline void PA_DualLargeScrollY(u8 bg_select, s32 y){
    00451        PA_LargeScrollY(0, bg_select, y+PA_ScreenSpace);
    00452        PA_LargeScrollY(1, bg_select, y);
    00453 }
    00454
    00455
    00471 extern inline void PA_DualLargeScrollXY(u8 bg_select, s32 x, s32 y){
    00472        PA_DualLargeScrollX(bg_select, x);
    00473        PA_DualLargeScrollY(bg_select, y);
    00474 }
    00475
    00476
    00477
    00496 extern inline void PA_DualInitParallaxX(s32 bg0, s32 bg1, s32 bg2, s32 bg3) {
    00497         PA_InitParallaxX(0, bg0, bg1, bg2, bg3);
    00498         PA_InitParallaxX(1, bg0, bg1, bg2, bg3);
    00499 }
    00500
    00501
    00502
    00521 extern inline void PA_DualInitParallaxY(s32 bg0, s32 bg1, s32 bg2, s32 bg3) {
    00522        PA_InitParallaxY(0, bg0, bg1, bg2, bg3);
    00523        PA_InitParallaxY(1, bg0, bg1, bg2, bg3);
    00524 }
    00525
    00526
    00527
    00537 extern inline void PA_DualParallaxScrollX(s32 x){
    00538 u8 i;
    00539        for(i = 0; i < 4; i++) {
    00540               if (PA_parallaxX[0][i])  {
    00541                      if(scrollpos[0][i].infscroll) PA_DualInfLargeScrollX(i, (PA_parallaxX[0][i] * x) >> 8); // Si bg en scrolling infini
    00542                      else PA_DualBGScrollX(i, (PA_parallaxX[0][i] * x) >> 8); // Sinon scrolling normal
    00543               }
    00544        }
    00545 }
    00546
    00547
    00557 extern inline void PA_DualParallaxScrollY(s32 y){
    00558 u8 i;
    00559        for(i = 0; i < 4; i++) {
    00560               if (PA_parallaxY[0][i])  {
    00561                      if(scrollpos[0][i].infscroll) PA_DualInfLargeScrollY(i, (PA_parallaxY[0][i] * y) >> 8); // Si bg en scrolling infini
    00562                      else PA_DualBGScrollY(i, (PA_parallaxY[0][i] * y) >> 8); // Sinon scrolling normal
    00563               }
    00564        }
    00565 }
    00566
    00567
    00580 extern inline void PA_DualParallaxScrollXY(s32 x, s32 y){
    00581        PA_DualParallaxScrollX(x);
    00582        PA_DualParallaxScrollY(y);
    00583 }
    00584
    00585
    00586
    00599 extern inline void PA_DualSetBgPrio(u8 bg, u8 prio) {
    00600        PA_SetBgPrio(0, bg, prio);
    00601        PA_SetBgPrio(1, bg, prio);
    00602 }
    00603
    00604
    00605  // end of Backgrounds
    00607
    00608
    00609
    00610 // Pas utilisé en direct par le programmeur
    00611 void PA_InitLargeBg(bool screen, u8 bg_select, s32 lx, s32 ly, void* bg_map);
    00612
    00613
    00614 #endif
    00615