PAlib
Macros | Functions
Rotating Backgrounds

Macros

#define PA_LoadRotBg(screen, bg_select, bg_tiles, bg_map, bg_size, wraparound)
 [DEPRECATED] Load a background fit for rotating/scaling! Warning, you must use PA_SetVideoMode to 1 if you want 1 rotating background (Bg3 only !), or 2 for 2 rotating backgrounds (Bg2 and 3). The background MUST be in 256 colors
 
#define PA_LoadPAGfxRotBg(screen, bg_select, bg_name, wraparound)
 [DEPRECATED] Load a background fit for rotating/scaling ! Warning, you must use PA_SetVideoMode to 1 if you want 1 rotating background (Bg3 only !), or 2 for 2 rotating backgrounds (Bg2 and 3). The background MUST be in 256 colors
 

Functions

static void PA_SetBgRot (u8 screen, u8 bg_select, s32 x_scroll, s32 y_scroll, s32 x_rotcentre, s32 y_rotcentre, s16 bg_angle, s32 bg_zoom)
 Rotate/Scale a RotBg.
 

Detailed Description

Load rotating backgrounds, move, rotate, scale them

Macro Definition Documentation

◆ PA_LoadRotBg

#define PA_LoadRotBg (   screen,
  bg_select,
  bg_tiles,
  bg_map,
  bg_size,
  wraparound 
)
Value:
do{\
PA_DEPRECATED_MACRO;\
PA_DeleteBg(screen, bg_select);\
PA_LoadBgTiles(screen, bg_select, bg_tiles); \
PA_LoadRotBgMap(screen, bg_select, (void*)bg_map, bg_size); \
PA_InitBg(screen, bg_select, bg_size, wraparound, 1);\
PA_SetBgRot(screen, bg_select, 0, 0, 0, 0, 0, 256);\
}while(0)

[DEPRECATED] Load a background fit for rotating/scaling! Warning, you must use PA_SetVideoMode to 1 if you want 1 rotating background (Bg3 only !), or 2 for 2 rotating backgrounds (Bg2 and 3). The background MUST be in 256 colors

Deprecated:
Parameters
screenChose de screen (0 or 1)
bg_selectBackground number to load
bg_tilesName of the tiles' info (example: ship_Tiles)
bg_mapName of the map's info (example : ship_Map)
bg_sizeBackground size. Use the following macros : BG_ROT_128X128, or 256X256, 512X512, or 1024X1024
wraparoundIf the background wraps around or not.

◆ PA_LoadPAGfxRotBg

#define PA_LoadPAGfxRotBg (   screen,
  bg_select,
  bg_name,
  wraparound 
)
Value:
do{\
PA_DEPRECATED_MACRO;\
PA_Load8bitBgPal(screen, (void*)bg_name##_Pal);\
PA_LoadRotBg(screen, bg_select, bg_name##_Tiles, bg_name##_Map, PA_GetPAGfxRotBgSize(bg_name##_Info[1]), wraparound);\
}while(0)

[DEPRECATED] Load a background fit for rotating/scaling ! Warning, you must use PA_SetVideoMode to 1 if you want 1 rotating background (Bg3 only !), or 2 for 2 rotating backgrounds (Bg2 and 3). The background MUST be in 256 colors

Deprecated:
Parameters
screenChose de screen (0 or 1)
bg_selectBackground number to load
bg_nameBackground name, like bg0
wraparoundIf the background wraps around or not.

Function Documentation

◆ PA_SetBgRot()

static inline void PA_SetBgRot ( u8  screen,
u8  bg_select,
s32  x_scroll,
s32  y_scroll,
s32  x_rotcentre,
s32  y_rotcentre,
s16  bg_angle,
s32  bg_zoom 
)
inlinestatic

Rotate/Scale a RotBg.

Parameters
screenChose de screen (0 or 1)
bg_selectBackground number to load
x_scrollX Scroll...
y_scrollY Scroll...
x_rotcentreX position of the rotation center
y_rotcentreY position of the rotation center
bg_angleRotation Angle (0-511)
bg_zoomZoom (256 for no zoom)