~rabbits/hiversaires

ref: 48e00fcdd82d1c3e02fabb9c29dceaf4d461f02c hiversaires/src/stageregions.c -rw-r--r-- 4.3 KiB
48e00fcdRezmason Remade the splash animation sequence 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#include "stage.h"

/*
Copyright (c) 2013-2021 Devine Lu Linvega
2018 web port by rezmason
2021 C89 port by rezmason

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE.
*/

/*
	All the regions of the Stage are defined here.
	These dimensions are percentages of the width and height of the window,
	except for the regions that stretch to the node region ("LAYOUTMODE_STRETCH_NODE").
*/

#define SIDE_TRIGGER_WIDTH 0.25
#define ASPECT_RATIO (16. / 9.)
#define HUD_WIDTH (1. / 12.)
#define HUD_MARGIN (HUD_WIDTH / 2.)
#define HUD_HEIGHT (1. / 12. / ASPECT_RATIO)
#define HUD_Y (1. - 1. / 16.)
#define HUD_ALERT_Y (1. - HUD_HEIGHT)

#define rect() \
	{ \
		0, 0, 0, 0 \
	}

#define region(x, y, w, h, mode) \
	{ \
		__LINE__, {x, y, w, h}, mode, rect(), rect(), {0, 0, 0, 0, 0, NULL}, NULL, rect() \
	}

Region regions[] =
	{
		/* BILLBOARD_NODE */
		region(0., 0., 1., 1., LAYOUTMODE_COVER),

		/* BILLBOARD_LAST_NODE_FADE */
		region(0., 0., 1., 1., LAYOUTMODE_STRETCH_NODE),

		/* BILLBOARD_ENTENTE_SCREEN */
		region((0.5 - 0.03), (0.5 - 0.03 * ASPECT_RATIO), (0.03 * 2.), (0.03 * 2. * ASPECT_RATIO), LAYOUTMODE_STRETCH_NODE),

		/* BILLBOARD_CLOCK */
		region((0.5 - 0.0738), (0.5 - 0.0738 * ASPECT_RATIO), (0.0738 * 2.), (0.0738 * 2. * ASPECT_RATIO), LAYOUTMODE_STRETCH_NODE),

		/* BILLBOARD_CLOCK_SHADOW */
		region((0.5 - 0.0738), (0.5 - 0.0738 * ASPECT_RATIO), (0.0738 * 2.), (0.0738 * 2. * ASPECT_RATIO), LAYOUTMODE_STRETCH_NODE),

		/* BILLBOARD_PROGRESS_PANE */
		region((0.5 - 0.0738), (0.5 - (0.0738 + 0.015) * ASPECT_RATIO), (0.0738 * 2.), (0.0738 * 2. * ASPECT_RATIO), LAYOUTMODE_STRETCH_NODE),

		/* BILLBOARD_VIGNETTE */
		region(0., 0., 1., 1., LAYOUTMODE_STRETCH),

		/* BILLBOARD_HUD_FUSE */
		region(HUD_MARGIN + HUD_WIDTH * 0, HUD_Y, HUD_WIDTH, HUD_HEIGHT, LAYOUTMODE_CONTAIN),

		/* BILLBOARD_HUD_FUSE_ALERT */
		region(HUD_MARGIN + HUD_WIDTH * 0, HUD_ALERT_Y, HUD_WIDTH, HUD_HEIGHT, LAYOUTMODE_CONTAIN),

		/* BILLBOARD_HUD_AUDIO */
		region(HUD_MARGIN + HUD_WIDTH * 2, HUD_Y, HUD_WIDTH, HUD_HEIGHT, LAYOUTMODE_CONTAIN),

		/* BILLBOARD_HUD_CLOCK */
		region(HUD_MARGIN + HUD_WIDTH * 5, HUD_Y, HUD_WIDTH, HUD_HEIGHT, LAYOUTMODE_CONTAIN),

		/* BILLBOARD_HUD_CLOCK_ALERT */
		region(HUD_MARGIN + HUD_WIDTH * 5, HUD_ALERT_Y, HUD_WIDTH, HUD_HEIGHT, LAYOUTMODE_CONTAIN),

		/* BILLBOARD_HUD_SAVE */
		region(HUD_MARGIN + HUD_WIDTH * 8, HUD_Y, HUD_WIDTH, HUD_HEIGHT, LAYOUTMODE_CONTAIN),

		/* BILLBOARD_HUD_SEAL_1 */
		region(HUD_MARGIN + HUD_WIDTH * 10, HUD_Y, HUD_WIDTH, HUD_HEIGHT, LAYOUTMODE_CONTAIN),

		/* BILLBOARD_HUD_SEAL_2 */
		region(HUD_MARGIN + HUD_WIDTH * 10, HUD_Y - HUD_HEIGHT, HUD_WIDTH, HUD_HEIGHT, LAYOUTMODE_CONTAIN),

		/* BILLBOARD_HUD_SEAL_ALERT */
		region(HUD_MARGIN + HUD_WIDTH * 10, HUD_ALERT_Y, HUD_WIDTH, HUD_HEIGHT, LAYOUTMODE_CONTAIN),

		/* BILLBOARD_HUD_STEP_FORWARD */
		region(0.2, HUD_ALERT_Y, 0.6, HUD_HEIGHT, LAYOUTMODE_STRETCH),

		/* BILLBOARD_HUD_STEP_LEFT */
		region(0., HUD_ALERT_Y, 0.2, HUD_HEIGHT, LAYOUTMODE_STRETCH),

		/* BILLBOARD_HUD_STEP_RIGHT */
		region(0.8, HUD_ALERT_Y, 0.2, HUD_HEIGHT, LAYOUTMODE_STRETCH),

		/* BILLBOARD_MENU_BLACK */
		region(0., 0., 1., 1., LAYOUTMODE_STRETCH),

		/* BILLBOARD_MENU_CREDIT1 */
		region(0., 0., 1., 1., LAYOUTMODE_CONTAIN),

		/* BILLBOARD_MENU_CREDIT2 */
		region(0., 0., 1., 1., LAYOUTMODE_CONTAIN),

		/* BILLBOARD_MENU_CREDIT3 */
		region(0., 0., 1., 1., LAYOUTMODE_CONTAIN),

		/* BILLBOARD_MENU_CREDIT4 */
		region(0., 0., 1., 1., LAYOUTMODE_CONTAIN),

		/* BILLBOARD_MENU_LOGO */
		region(0., 0., 1., 1., LAYOUTMODE_CONTAIN),

		/* BILLBOARD_MENU_CONTROLS */
		region(0., 0., 1., 1., LAYOUTMODE_CONTAIN),

		/* BILLBOARD_SPLASH */
		region(0.3, 0.3, 0.4, 0.4, LAYOUTMODE_CONTAIN),

		/* TRIGGER_ACTION */
		region(1. / 3., 1. / 3., 1. / 3., 1. / 3., LAYOUTMODE_STRETCH),

		/* TRIGGER_MOVE_FORWARD */
		region(SIDE_TRIGGER_WIDTH, 0, (1. - 2.0 * SIDE_TRIGGER_WIDTH), 1, LAYOUTMODE_STRETCH),

		/* TRIGGER_MOVE_LEFT */
		region(0, 0, SIDE_TRIGGER_WIDTH, 1, LAYOUTMODE_STRETCH),

		/* TRIGGER_MOVE_RIGHT */
		region((1. - SIDE_TRIGGER_WIDTH), 0, SIDE_TRIGGER_WIDTH, 1, LAYOUTMODE_STRETCH)};