e26558e1a5
* WIP * WIP * WIP * WIP * Tags are bugged but it's looking good * Centering is bugged, almost there * WIP * Fixed centeriiiing, yaaaay * good progress * add proper '\n' support * WIP descriptions * All descriptions are there ^^ * missing 9-patch for pretty display * WIP * fix rebase issues * Fix minor Run Setup screen issues * Almost done, only one fix to go * Aaaalmooost doooneeeee * make desc frame size adaptative * add rarity color and text * final cleanup * clang format * clang format * clang format * clang format * clang format * Fix Joker update loop index * Fix const and Bull description * Fix unwanted button SFX * fix tte colors * Add misprint description * Fix justified line length computation * Add safeguards to tag parsing loop * clang format * Fix Ante bugged display at boss blind end * Tweak suit colors * Final fixes * Simplified the way we print descriptions * simplify further * get rid of weird macro * Fix Onwed joker price when holding A after showing its description --------- Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
101 lines
2.2 KiB
C
101 lines
2.2 KiB
C
/**
|
|
* @file affine_background.h
|
|
*
|
|
* @brief Utilities for affine background on GBA
|
|
*/
|
|
#ifndef AFFINE_BACKGROUND_H
|
|
#define AFFINE_BACKGROUND_H
|
|
|
|
#include "graphic_utils.h"
|
|
|
|
#include <tonc.h>
|
|
|
|
/**
|
|
* @def AFFINE_BG_IDX
|
|
* @brief The index of the affine background BGCNT register etc.
|
|
*/
|
|
#define AFFINE_BG_IDX 2
|
|
|
|
/**
|
|
* @def AFFINE_BG_PAL_LEN
|
|
* @brief Number of u16 colors available in the palette.
|
|
*/
|
|
#define AFFINE_BG_PAL_LEN 16
|
|
|
|
/**
|
|
* @def AFFINE_BG_PB
|
|
* @brief The starting index of the background palette.
|
|
*/
|
|
#define AFFINE_BG_PB (PAL_ROW_LEN * 15)
|
|
|
|
/**
|
|
* @brief An ID to specify background rendering types.
|
|
*/
|
|
enum AffineBackgroundID
|
|
{
|
|
/**
|
|
* @brief Display background for the initial splash screen.
|
|
*
|
|
* Signifies that no background is currently in use.
|
|
*/
|
|
AFFINE_BG_NONE,
|
|
|
|
/**
|
|
* @brief Display background for main menu.
|
|
*
|
|
* Signifies which background to use and provides a higher quality affine
|
|
* mode to display when there is no game logic.
|
|
*/
|
|
AFFINE_BG_MAIN_MENU,
|
|
/**
|
|
* @brief Display background for game play.
|
|
*
|
|
* Signifies which background to use and provides a lower quality affine
|
|
* mode to keep resources down during play.
|
|
*/
|
|
AFFINE_BG_GAME,
|
|
};
|
|
|
|
/**
|
|
* @brief Initialize resources for affine background rendering
|
|
*/
|
|
void affine_background_init();
|
|
|
|
/**
|
|
* @brief Interrupt routine to update display on HBLANK
|
|
*/
|
|
IWRAM_CODE void affine_background_hblank();
|
|
|
|
/**
|
|
* @brief Per-frame update of the affine background
|
|
*/
|
|
IWRAM_CODE void affine_background_update();
|
|
|
|
/**
|
|
* @brief Update the affine background color
|
|
*
|
|
* @param color @ref COLOR to set
|
|
*/
|
|
void affine_background_set_color(COLOR color);
|
|
|
|
/**
|
|
* @brief Set the background palette
|
|
*
|
|
* Must be called with an array of size at least @ref AFFINE_BG_PAL_LEN
|
|
*
|
|
* @param src pointer to palette to set
|
|
*/
|
|
void affine_background_load_palette(const u16* src);
|
|
|
|
/**
|
|
* @brief Update the background id
|
|
*
|
|
* Update the background id by configuring display registers and loading
|
|
* the image and palette used for the specified id.
|
|
*
|
|
* @param new_bg @ref AffineBackgrounID to set
|
|
*/
|
|
void affine_background_change_background(enum AffineBackgroundID new_bg);
|
|
|
|
#endif // AFFINE_BACKGROUND_H
|