ScummVM API documentation
p4_generic_pc.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * Additional copyright for this file:
8 * Copyright (C) 1999-2000 Revolution Software Ltd.
9 * This code is based on source code created by Revolution Software,
10 * used with permission.
11 *
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 *
25 */
26
27#ifndef ICB_P4_GENERIC_PC_H
28#define ICB_P4_GENERIC_PC_H
29
30#include "engines/icb/non_ad_module.h"
31#include "engines/icb/debug_pc.h"
32#include "engines/icb/common/px_common.h"
33#include "engines/icb/common/px_anims.h"
34
35#include "common/textconsole.h"
36
37namespace ICB {
38
39// Useful typedef's for types
40
41// These are now done in px_common.h
42/*
43// Might just be int's on the PSX
44typedef float PXreal;
45// Is likely to be done using fixed-point maths on PSX
46typedef float PXfloat;
47
48*/
49
50// The camera
51typedef PCcamera PXcamera;
52// The animation, frame, marker
53typedef PXframe_PSX PXframe;
54typedef PXmarker_PSX PXmarker;
55typedef PXanim_PSX PXanim;
56// typedef PCactor PXactor;
57
58// Very hacky #defines for function overloading
59#define PXWorldToFilm WorldToFilm
60
61#define PXAngleOfVector AngleOfVector
62#define PXfabs fabs
63#define PXfmod fmod
64#define PXsqrt sqrt
65#define PXsin sin
66#define PXcos cos
67#define PXfloor floor
68
69// screen dimensions
70#define SCREEN_WIDTH 640
71#define SCREEN_DEPTH 480
72
73// screen coordinate limits
74#define SCREEN_LEFT_EDGE 0
75#define SCREEN_RIGHT_EDGE SCREEN_WIDTH - 1
76#define SCREEN_TOP_EDGE 0
77#define SCREEN_BOTTOM_EDGE SCREEN_DEPTH - 1
78
79// Definition and function for comparing floats.
80#define FLOAT_COMPARE_TOLERANCE ((float)0.000001)
81inline bool8 FloatsEqual(PXfloat fA, PXfloat fB, PXfloat tolerance = FLOAT_COMPARE_TOLERANCE) { return ((bool8)((fabs(fA - fB) < tolerance))); }
82
83// This is the name of a bitmap which contains a reference palette entry to be used for transparency.
84#define BITMAP_TRANSPARENCY_REFERENCE "transparent_ref"
85
86} // End of namespace ICB
87
88#include "engines/icb/gfx/psx_anims.h"
89
90#endif // #ifndef P4_GENERIC_PC_H