mirror of
https://github.com/jonthysell/MacLO.git
synced 2024-06-25 16:29:53 +00:00
I've imported some of the "character" images from ArduLO, converted to GIFs because they're easier to work with. They've been imported into a new Bitmaps structure so they only need to be loaded once at app start. I've also cleaned up some of the drawing code, and created a series of helpers for dividing Rects into a 3x3 grid, to make it easier to define the layout. I've also stubbed out "theme-support". :)
55 lines
1.5 KiB
C
55 lines
1.5 KiB
C
// Copyright (c) Jon Thysell <http://jonthysell.com>
|
|
// Licensed under the MIT License.
|
|
|
|
#include "Bitmaps.h"
|
|
|
|
#define NumChars 10
|
|
|
|
#define TitlePictResID BaseResID
|
|
#define NumCharPictBaseResID (TitlePictResID + 1)
|
|
#define ACharPictResID (NumCharPictBaseResID + NumChars)
|
|
#define BCharPictResID (ACharPictResID + 1)
|
|
#define SlashCharPictResID (BCharPictResID + 1)
|
|
|
|
void Bitmaps_Init(Bitmaps *pBitmaps)
|
|
{
|
|
int16_t i;
|
|
|
|
// Load title
|
|
pBitmaps->TitlePict = GetPicture(TitlePictResID);
|
|
if (pBitmaps->TitlePict == nil)
|
|
{
|
|
ShowError("\pTitle PICT resource missing!", true);
|
|
}
|
|
|
|
// Load number chars
|
|
for (i = 0; i < NumChars; i++)
|
|
{
|
|
pBitmaps->NumCharPicts[i] = GetPicture(NumCharPictBaseResID + i);
|
|
if (pBitmaps->NumCharPicts[i] == nil)
|
|
{
|
|
ShowError("\pNumber char PICT resource missing!", true);
|
|
}
|
|
}
|
|
|
|
// Load "A" char
|
|
pBitmaps->ACharPict = GetPicture(ACharPictResID);
|
|
if (pBitmaps->ACharPict == nil)
|
|
{
|
|
ShowError("\pA char PICT resource missing!", true);
|
|
}
|
|
|
|
// Load "B" char
|
|
pBitmaps->BCharPict = GetPicture(BCharPictResID);
|
|
if (pBitmaps->BCharPict == nil)
|
|
{
|
|
ShowError("\pB char PICT resource missing!", true);
|
|
}
|
|
|
|
// Load "/" char
|
|
pBitmaps->SlashCharPict = GetPicture(SlashCharPictResID);
|
|
if (pBitmaps->SlashCharPict == nil)
|
|
{
|
|
ShowError("\pSlash char PICT resource missing!", true);
|
|
}
|
|
} |