1 /******************************************************************************
2 * Arachnoid Graphics Plugin for Mupen64Plus
3 * http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
5 * Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *****************************************************************************/
22 #ifndef RSP_LIGHT_MANAGER_H_
23 #define RSP_LIGHT_MANAGER_H_
25 //Forward declarations
28 //-----------------------------------------------------------------------------
30 //! Struct defining how lights are stored in RDRAM
31 //-----------------------------------------------------------------------------
34 unsigned char pad0; //!< Padding
35 unsigned char b, g, r; //!< Color <blue, green, red>
36 unsigned char pad1; //!< Padding
37 unsigned char b2, g2, r2; //!< Color <blue, green, red>
38 char pad2; //!< Padding
39 char z, y, x; //!< Direction
42 //-----------------------------------------------------------------------------
44 //! Struct used to store information about lights
45 //-----------------------------------------------------------------------------
48 float r, g, b; //Color
49 float x, y, z; //Direction
52 //*****************************************************************************
54 //*****************************************************************************
59 //Constructor / Destructor
63 bool initialize(Memory* memory);
65 void setLight( unsigned int lightIndex, unsigned int rdramAddress );
66 void setNumLights(int numLights);
67 void setLightColor( unsigned int lightIndex, unsigned int packedColor );
68 const float* getAmbientLight() { return &m_lights[m_numLights].r; }
71 int getNumLights() { return m_numLights; }
72 void setLightEnabled(bool enabled) { m_lightEnabled = enabled; }
73 bool getLightEnabled() { return m_lightEnabled; }
74 const float* getLightColor(int lightIndex) { return &m_lights[lightIndex].r; }
75 const float* getLightDirection(int lightIndex) { return &m_lights[lightIndex].x; }