2014-06-01 17:55:23 +00:00
/*
2018-09-02 00:57:29 +00:00
* This file is part of the DXX - Rebirth project < https : //www.dxx-rebirth.com/>.
2014-06-01 17:55:23 +00:00
* It is copyright by its individual contributors , as recorded in the
* project ' s Git history . See COPYING . txt at the top level for license
* terms and a link to the Git history .
*/
2012-11-11 22:12:51 +00:00
# pragma once
2006-03-20 17:12:09 +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
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE .
COPYRIGHT 1993 - 1998 PARALLAX SOFTWARE CORPORATION . ALL RIGHTS RESERVED .
*/
/*
*
* Local include file for texture mapper library - - NOT to be included by users .
*
*/
// Local include file for texture map library.
2013-10-26 03:40:50 +00:00
# include "maths.h"
# include "pstypes.h"
2012-11-11 22:12:51 +00:00
# ifdef __cplusplus
2014-06-01 20:49:07 +00:00
# include <cstddef>
# include "dxxsconf.h"
2016-03-19 19:08:10 +00:00
# include "dsx-ns.h"
2014-06-01 20:49:07 +00:00
# include "compiler-array.h"
2012-11-11 22:12:51 +00:00
2015-12-13 18:00:49 +00:00
namespace dcx {
2015-12-05 22:57:24 +00:00
2017-11-01 02:01:21 +00:00
# if !DXX_USE_OGL
2013-10-26 03:40:50 +00:00
struct g3ds_tmap ;
2006-03-20 17:12:09 +00:00
extern int prevmod ( int val , int modulus ) ;
extern int succmod ( int val , int modulus ) ;
2014-11-30 22:09:17 +00:00
fix compute_dx_dy ( const g3ds_tmap & t , int top_vertex , int bottom_vertex , fix recip_dy ) ;
void compute_y_bounds ( const g3ds_tmap & t , int & vlt , int & vlb , int & vrt , int & vrb , int & bottom_y_ind ) ;
2006-03-20 17:12:09 +00:00
2014-12-11 02:34:13 +00:00
extern int fx_y , fx_xleft , fx_xright ;
2014-11-30 22:09:18 +00:00
extern const unsigned char * pixptr ;
2006-03-20 17:12:09 +00:00
// texture mapper scanline renderers
// Interface variables to assembler code
extern fix fx_u , fx_v , fx_z , fx_du_dx , fx_dv_dx , fx_dz_dx ;
extern fix fx_dl_dx , fx_l ;
extern int bytes_per_row ;
extern unsigned char * write_buffer ;
2014-08-08 02:07:07 +00:00
2017-11-01 02:01:21 +00:00
extern uint8_t tmap_flat_color ;
2006-03-20 17:12:09 +00:00
2017-10-14 17:10:30 +00:00
constexpr std : : integral_constant < std : : size_t , 641 > FIX_RECIP_TABLE_SIZE { } ; //increased from 321 to 641, since this res is now quite achievable.. slight fps boost -MM
2014-06-01 20:49:07 +00:00
extern const array < fix , FIX_RECIP_TABLE_SIZE > fix_recip_table ;
static inline fix fix_recip ( unsigned i )
{
if ( i < fix_recip_table . size ( ) )
return fix_recip_table [ i ] ;
else
return F1_0 / i ;
}
2015-01-22 03:34:20 +00:00
# endif
2006-03-20 17:12:09 +00:00
2015-12-05 22:57:24 +00:00
}
2012-11-11 22:12:51 +00:00
# endif