2006-03-20 16:43:15 +00:00
|
|
|
/*
|
2014-06-01 17:55:23 +00:00
|
|
|
* Portions of this file are copyright Rebirth contributors and licensed as
|
|
|
|
* described in COPYING.txt.
|
|
|
|
* Portions of this file are copyright Parallax Software and licensed
|
|
|
|
* according to the Parallax license below.
|
|
|
|
* See COPYING.txt for license details.
|
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
2008-10-16 17:27:02 +00:00
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
|
|
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
2006-03-20 16:43:15 +00:00
|
|
|
*/
|
2008-10-16 17:27:02 +00:00
|
|
|
|
2006-03-20 16:43:15 +00:00
|
|
|
/*
|
|
|
|
*
|
2008-10-16 17:27:02 +00:00
|
|
|
* Lighting system prototypes, structures, etc.
|
2006-03-20 16:43:15 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-01-29 04:27:36 +00:00
|
|
|
#pragma once
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2013-10-26 03:40:50 +00:00
|
|
|
#include "maths.h"
|
2015-07-25 23:10:45 +00:00
|
|
|
#include "vecmat.h"
|
2013-10-26 03:40:50 +00:00
|
|
|
|
2015-10-10 03:44:14 +00:00
|
|
|
#include "fwd-object.h"
|
2015-10-10 03:44:14 +00:00
|
|
|
#include "fwd-segment.h"
|
2018-12-30 00:43:58 +00:00
|
|
|
#include "3d.h"
|
2020-12-26 21:17:29 +00:00
|
|
|
#include "d_array.h"
|
2013-10-26 03:40:50 +00:00
|
|
|
|
2008-10-16 17:27:02 +00:00
|
|
|
#define MAX_LIGHT 0x10000 // max value
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2008-10-16 17:27:02 +00:00
|
|
|
#define MIN_LIGHT_DIST (F1_0*4)
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2018-12-30 00:43:58 +00:00
|
|
|
namespace dcx {
|
|
|
|
|
|
|
|
struct d_level_unique_light_state
|
|
|
|
{
|
2020-12-26 21:17:29 +00:00
|
|
|
enumerated_array<g3s_lrgb, MAX_VERTICES, vertnum_t> Dynamic_light;
|
2018-12-30 00:43:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-11-26 02:56:55 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
|
2019-04-13 18:00:07 +00:00
|
|
|
namespace dsx {
|
|
|
|
|
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
|
|
|
struct d_level_unique_headlight_state
|
|
|
|
{
|
|
|
|
unsigned Num_headlights = 0;
|
2020-05-02 21:18:42 +00:00
|
|
|
std::array<const object_base *, 8> Headlights = {};
|
2019-04-13 18:00:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct d_level_unique_light_state :
|
|
|
|
d_level_unique_headlight_state,
|
|
|
|
::dcx::d_level_unique_light_state
|
|
|
|
{
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern d_level_unique_light_state LevelUniqueLightState;
|
|
|
|
}
|
2018-09-25 03:44:09 +00:00
|
|
|
extern const object *old_viewer;
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2019-04-13 18:00:07 +00:00
|
|
|
namespace dsx {
|
2008-10-16 17:27:02 +00:00
|
|
|
// compute the lighting for an object. Takes a pointer to the object,
|
|
|
|
// and possibly a rotated 3d point. If the point isn't specified, the
|
|
|
|
// object's center point is rotated.
|
2019-04-13 18:00:07 +00:00
|
|
|
g3s_lrgb compute_object_light(const d_level_unique_light_state &LevelUniqueLightState, vcobjptridx_t obj);
|
2006-03-20 16:43:15 +00:00
|
|
|
|
2008-10-16 17:27:02 +00:00
|
|
|
// turn headlight boost on & off
|
2017-04-22 21:23:55 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
|
|
|
void toggle_headlight_active(object &);
|
|
|
|
#endif
|
2017-03-11 19:56:25 +00:00
|
|
|
}
|
2018-09-25 03:44:09 +00:00
|
|
|
void start_lighting_frame(const object &viewer);
|
2015-11-26 02:56:55 +00:00
|
|
|
#endif
|