|
coastline 0.0.4
|
The arithmetic and the parsing of the quality of life changes of the patched PC libraries. More...
#include <stdbool.h>
Go to the source code of this file.
Functions | |
| bool | IsSecondPressWithin (unsigned *pLastPress, unsigned now, unsigned window) |
| Record a press and report whether it follows an earlier press within a window. | |
| float | GetHorPlusFovY (float fov, float width, float height) |
| Return the vertical field of view of a camera for the shape of its viewport. | |
| void | GetHudCanvasSize (int width, int height, int *pCanvasWidth, int *pCanvasHeight) |
| Return the size of the canvas the HUD of a race is laid out on. | |
| int | ParseTestScene (const char *pszValue) |
| Return the mode of play of the value of scene= on the command line. | |
The arithmetic and the parsing of the quality of life changes of the patched PC libraries.
| bool IsSecondPressWithin | ( | unsigned * | pLastPress, |
| unsigned | now, | ||
| unsigned | window ) |
Record a press and report whether it follows an earlier press within a window.
A second press consumes both presses, and the next press starts a new pair.
| pLastPress | The time of the unpaired earlier press, or 0 for none. Updated. |
| now | The time of this press. |
| window | The most time between the two presses, in the unit of the times. |
| float GetHorPlusFovY | ( | float | fov, |
| float | width, | ||
| float | height ) |
Return the vertical field of view of a camera for the shape of its viewport.
At 4:3 and wider the vertical angle is preserved and the view widens. Narrower viewports retain the horizontal angle of 4:3 and grow taller.
| fov | The vertical field of view at 4:3, in radians. |
| width | The width of the viewport. |
| height | The height of the viewport. |
| void GetHudCanvasSize | ( | int | width, |
| int | height, | ||
| int * | pCanvasWidth, | ||
| int * | pCanvasHeight ) |
Return the size of the canvas the HUD of a race is laid out on.
The canvas has the shape of the frame buffer. At 4:3 and wider it is at most 480 units tall, and narrower frame buffers get a canvas at most 640 units wide, so the 640 by 480 layout of the HUD always fits. The routines that draw the HUD anchor it to the edges and the centre.
| width | The width of the frame buffer, in pixels. |
| height | The height of the frame buffer, in pixels. |
| pCanvasWidth | Receives the width of the canvas. |
| pCanvasHeight | Receives the height of the canvas. |
| int ParseTestScene | ( | const char * | pszValue | ) |
Return the mode of play of the value of scene= on the command line.
The scenes are arcade, demo, practice, seasonwinner, and timeattack. The value ends at the end of the string or at white space.
| pszValue | The text after scene=. |