Scarab
A thin, game-agnostic 2D engine host built on the sunlight tile-map engine
Loading...
Searching...
No Matches
main.h
Go to the documentation of this file.
1/*
2 * Copyright (c) since 2021 by PopolonY2k and Leidson Campos A. Ferreira
3 *
4 * This software is provided 'as-is', without any express or implied
5 * warranty. In no event will the authors be held liable for any damages
6 * arising from the use of this software.
7 *
8 * Permission is granted to anyone to use this software for any purpose,
9 * including commercial applications, and to alter it and redistribute it
10 * freely, subject to the following restrictions:
11 *
12 * 1. The origin of this software must not be misrepresented; you must not
13 * claim that you wrote the original software. If you use this software
14 * in a product, an acknowledgment in the product documentation would be
15 * appreciated but is not required.
16 * 2. Altered source versions must be plainly marked as such, and must not be
17 * misrepresented as being the original software.
18 * 3. This notice may not be removed or altered from any source distribution.
19 */
20
21#ifndef __MAIN_H__
22#define __MAIN_H__
23
24#define DISPLAY_W 1260
25#define DISPLAY_H 920
26#define FRAMES_PER_SECOND 60
27#define H_SCROLL_STEP_SIZE 1
28#define W_SCROLL_STEP_SIZE 1
29/*
30 * The viewport is the rectangle [pos, pos + size) inside the display - size
31 * is a real WIDTH/HEIGHT (sunlight v0.29.0+; before that, size was
32 * inconsistently treated as the far-edge coordinate, so this same visible
33 * area used to be written 1250x910). 10 px margin on all four sides of the
34 * 1260x920 display: 1260 - 2*10 = 1240, 920 - 2*10 = 900.
35 */
36#define VIEWPORT_POS_X 10
37#define VIEWPORT_POS_Y 10
38#define VIEWPORT_WIDTH 1240
39#define VIEWPORT_HEIGHT 900
40#define DEFAULT_ZOOM_SCALE_POS 60
41
42/*
43 * Process exit code of a --headless run whose --max-frames budget ran out
44 * before the game ended it itself (app_quit()) - distinct from
45 * EXIT_FAILURE (a fatal engine/Lua error) so a wrapper or CI job can tell
46 * "the safety net tripped" (a hang or a too-short budget) apart from
47 * "the game broke". --max-frames-ok turns it into a normal EXIT_SUCCESS.
48 */
49#define EXIT_FRAME_BUDGET_EXHAUSTED 3
50
51/*
52 * Scarab is a game-agnostic engine - it doesn't hardcode a specific
53 * game's name. "Scarab" is only the initial window title, shown before
54 * any Lua exists to override it; the actual game (main.lua) is expected
55 * to call app_set_name(...) with its own name once it starts running.
56 */
57#define APP_NAME "Scarab"
58
59#endif /* __MAIN_H__ */