ScummVM API documentation
px_lights.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 #include "engines/icb/common/px_common.h"
28 #include "engines/icb/gfx/psx_pcdefines.h"
29 
30 namespace ICB {
31 
32 enum pxLightType { OMNI_PX_LIGHT, FREE_SPOT_PX_LIGHT, TARGET_SPOT_PX_LIGHT, FREE_DIRECT_PX_LIGHT, TARGET_DIRECT_PX_LIGHT, GLOBAL_PX_LIGHT };
33 
34 typedef struct {
35  char name[16]; // String for user's name
36  uint32 type; // 0-5 enumerated, see above
37 
38  MATRIX PSX_matrix; // Standard PSX type, 32 bytes
39 
40  SVECTOR direction; // Standard PSX type, 8 bytes
41 
42  int32 pan; // Fixed point angle
43  int32 cant; // Fixed point angle
44  int32 tilt; // Fixed point angle
45 
46  uint32 red; // Fixed point integer
47  uint32 green; // Fixed point integer
48  uint32 blue; // Fixed point integer
49  uint32 intensity; // Fixed point integer
50  uint32 hspot_size; // Fixed point angle
51  uint32 falloff_size; // Fixed point angle
52  uint32 use_nearAtten; // 0 false, 1 true
53  uint32 nearAtten_start; // Nearest integer
54  uint32 nearAtten_end; // Nearest integer
55  uint32 use_farAtten; // 0 false, 1 true
56  uint32 farAtten_start; // Nearest integer
57  uint32 farAtten_end; // Nearest integer
58 
59  uint32 shape; // 0 rectangular, 1 circlular
60  uint32 aspect; // Fixed point integer
61  uint32 overshoot; // 0 false, 1 true
62  uint32 shadow; // 0 false, 1 true
63  uint32 affect_diffuse; // 0 false, 1 true
64  uint32 affect_specular; // 0 false, 1 true
65 
66 } _pxLightState; // Size 144 bytes in total
67 
68 class _pxLights {
69 public:
70  _pxLights() { ; }
71  ~_pxLights() { ; }
72 
73  uint32 Fetch_number_of_items() const { return num_of_lights; }
74  inline const _pxLightState *Fetch_item_by_number(uint32 number) const;
75 
76 private:
77  uint32 num_of_lights;
78 };
79 
80 // All lights are of the same size to skip to the start of whichever is wanted
81 inline const _pxLightState *_pxLights::Fetch_item_by_number(uint32 number) const {
82  if (number < num_of_lights) {
83  return ((_pxLightState *)(((char *)this) + (4 + (number * 144))));
84  } else
85  return NULL;
86 }
87 
88 } // End of namespace ICB
Definition: px_capri_maths.h:53
Definition: actor.h:32
Definition: px_lights.h:68
Definition: px_lights.h:34
Definition: px_capri_maths.h:38