2021-10-15 16:43:09 +00:00
|
|
|
// Copyright (c) Jon Thysell <http://jonthysell.com>
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
|
|
#ifndef GAMEWINDOW_H
|
|
|
|
#define GAMEWINDOW_H
|
|
|
|
|
|
|
|
#include "MacCommon.h"
|
2021-10-16 00:29:07 +00:00
|
|
|
#include "GameEngine.h"
|
2021-10-15 16:43:09 +00:00
|
|
|
|
2021-10-20 23:13:31 +00:00
|
|
|
#define WindowPattern black
|
|
|
|
|
|
|
|
#define PlayfieldMargin 4
|
|
|
|
#define PlayfieldPadding 2
|
|
|
|
#define PlayfieldCornerSize 12
|
|
|
|
#define LightMargin 6
|
|
|
|
#define LightSize 50
|
|
|
|
#define LightCornerSize 8
|
|
|
|
#define PlayfieldPattern ltGray
|
|
|
|
|
|
|
|
#define HUDMargin PlayfieldMargin
|
|
|
|
#define HUDCornerSize PlayfieldCornerSize
|
|
|
|
#define HUDPattern PlayfieldPattern
|
2021-10-20 16:34:31 +00:00
|
|
|
|
2021-10-22 18:32:19 +00:00
|
|
|
typedef enum GameMode
|
|
|
|
{
|
2021-10-29 00:44:36 +00:00
|
|
|
Title,
|
2021-10-22 18:32:19 +00:00
|
|
|
Play,
|
|
|
|
LevelComplete,
|
|
|
|
GameComplete
|
|
|
|
} GameMode;
|
|
|
|
|
2021-10-15 16:43:09 +00:00
|
|
|
typedef struct GameWindow
|
|
|
|
{
|
2021-10-20 16:34:31 +00:00
|
|
|
WindowPtr Window;
|
2021-10-16 00:29:07 +00:00
|
|
|
GameEngine Engine;
|
2021-10-22 18:32:19 +00:00
|
|
|
GameMode GameMode;
|
2021-10-20 16:34:31 +00:00
|
|
|
Rect PlayfieldRect;
|
2021-10-20 23:13:31 +00:00
|
|
|
Rect HUDRect;
|
2021-10-15 16:43:09 +00:00
|
|
|
} GameWindow;
|
|
|
|
|
2021-10-16 00:29:07 +00:00
|
|
|
void GameWindow_Init(GameWindow *pGameWindow);
|
2021-10-20 16:34:31 +00:00
|
|
|
|
2021-10-22 18:32:19 +00:00
|
|
|
void GameWindow_Draw(const GameWindow *pGameWindow, bool fullRefresh);
|
2021-10-20 16:34:31 +00:00
|
|
|
void GameWindow_Show(const GameWindow *pGameWindow);
|
|
|
|
|
|
|
|
void GameWindow_Click(GameWindow *pGameWindow, const Point *pPosition);
|
2021-10-15 16:43:09 +00:00
|
|
|
|
|
|
|
#endif
|