mirror of
https://github.com/jonthysell/MacLO.git
synced 2024-06-01 20:41:28 +00:00
eab519a40d
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". :)
54 lines
1.3 KiB
C
54 lines
1.3 KiB
C
// Copyright (c) Jon Thysell <http://jonthysell.com>
|
|
// Licensed under the MIT License.
|
|
|
|
#include "TitleScene.h"
|
|
#include "Bitmaps.h"
|
|
|
|
void TitleScene_Init(GameWindow *pGameWindow)
|
|
{
|
|
const Rect *pContentRect = &(pGameWindow->Window->portRect);
|
|
|
|
// Setup rects
|
|
pGameWindow->TitleScene.TitleRect = (**(pGameWindow->Bitmaps.TitlePict)).picFrame;
|
|
CenterRect(pContentRect, &(pGameWindow->TitleScene.TitleRect));
|
|
}
|
|
|
|
void TitleScene_Draw(const GameWindow *pGameWindow, bool fullRefresh)
|
|
{
|
|
// TODO: Proper title
|
|
if (fullRefresh)
|
|
{
|
|
}
|
|
|
|
// Draw Title PICT
|
|
DrawPicture(pGameWindow->Bitmaps.TitlePict, &(pGameWindow->TitleScene.TitleRect));
|
|
|
|
TextFace(bold + outline);
|
|
|
|
MoveTo(100, pGameWindow->TitleScene.TitleRect.bottom + 30);
|
|
DrawString("\pSet A");
|
|
|
|
MoveTo(350, pGameWindow->TitleScene.TitleRect.bottom + 30);
|
|
DrawString("\pSet B");
|
|
}
|
|
|
|
void TitleScene_Click(GameWindow *pGameWindow, const Point *pPosition)
|
|
{
|
|
bool setB;
|
|
|
|
// TODO: Proper click handling
|
|
|
|
if (pPosition->h < ((pGameWindow->Window->portRect.right - pGameWindow->Window->portRect.left) / 2))
|
|
{
|
|
setB = false;
|
|
}
|
|
else
|
|
{
|
|
setB = true;
|
|
}
|
|
|
|
GameEngine_NewGame(&(pGameWindow->Engine), setB);
|
|
|
|
GameWindow_SetScene(pGameWindow, Play);
|
|
}
|