mirror of
https://github.com/CTurt/dsgmLib.git
synced 2025-06-18 22:55:33 -04:00
Get drawable background pixel
This commit is contained in:
parent
701232d410
commit
d08db41d23
@ -23,6 +23,9 @@ inline void DSGM_ClearDrawableBackgroundFull(DSGM_Room *room, u8 screen);
|
|||||||
#define DSGM_DrawPixelToBackground(screen, x, y, color) DSGM_DrawPixelToBackgroundFull(&DSGM_Rooms[DSGM_currentRoom], screen, x, y, color)
|
#define DSGM_DrawPixelToBackground(screen, x, y, color) DSGM_DrawPixelToBackgroundFull(&DSGM_Rooms[DSGM_currentRoom], screen, x, y, color)
|
||||||
inline void DSGM_DrawPixelToBackgroundFull(DSGM_Room *room, u8 screen, int x, int y, u16 color);
|
inline void DSGM_DrawPixelToBackgroundFull(DSGM_Room *room, u8 screen, int x, int y, u16 color);
|
||||||
|
|
||||||
|
#define DSGM_GetDrawablePixel(screen, x, y) DSGM_GetDrawablePixelFull(&DSGM_Rooms[DSGM_currentRoom], screen, x, y)
|
||||||
|
inline u16 DSGM_GetDrawablePixelFull(DSGM_Room *room, u8 screen, int x, int y);
|
||||||
|
|
||||||
#define DSGM_DrawRectangleToBackground(screen, x, y, width, height, thickness, color) DSGM_DrawRectangleToBackgroundFull(&DSGM_Rooms[DSGM_currentRoom], screen, x, y, width, height, thickness, color)
|
#define DSGM_DrawRectangleToBackground(screen, x, y, width, height, thickness, color) DSGM_DrawRectangleToBackgroundFull(&DSGM_Rooms[DSGM_currentRoom], screen, x, y, width, height, thickness, color)
|
||||||
inline void DSGM_DrawRectangleToBackgroundFull(DSGM_Room *room, u8 screen, int x, int y, int width, int height, int thickness, u16 color);
|
inline void DSGM_DrawRectangleToBackgroundFull(DSGM_Room *room, u8 screen, int x, int y, int width, int height, int thickness, u16 color);
|
||||||
|
|
||||||
|
@ -22,6 +22,11 @@ inline void DSGM_DrawPixelToBackgroundFull(DSGM_Room *room, u8 screen, int x, in
|
|||||||
bgGetGfxPtr(room->layers[screen][3].vramId)[x + (y << 8)] = color;
|
bgGetGfxPtr(room->layers[screen][3].vramId)[x + (y << 8)] = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline u16 DSGM_GetDrawablePixelFull(DSGM_Room *room, u8 screen, int x, int y) {
|
||||||
|
if(x >= 0 && y >= 0 && x < 256 && y < 192) return bgGetGfxPtr(room->layers[screen][3].vramId)[x + (y << 8)];
|
||||||
|
else return ARGB16(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
inline void DSGM_DrawRectangleToBackgroundFull(DSGM_Room *room, u8 screen, int x, int y, int width, int height, int thickness, u16 color) {
|
inline void DSGM_DrawRectangleToBackgroundFull(DSGM_Room *room, u8 screen, int x, int y, int width, int height, int thickness, u16 color) {
|
||||||
DSGM_DrawLineToBackgroundFull(room, screen, x, y, x + width, y, thickness, color);
|
DSGM_DrawLineToBackgroundFull(room, screen, x, y, x + width, y, thickness, color);
|
||||||
DSGM_DrawLineToBackgroundFull(room, screen, x + width, y, x + width, y + height, thickness, color);
|
DSGM_DrawLineToBackgroundFull(room, screen, x + width, y, x + width, y + height, thickness, color);
|
||||||
|
Loading…
Reference in New Issue
Block a user