Moved ui_draw_frame(), ui_draw_shad(), draw_tmap_flat(), math tables externs to headers - patches by Kp

This commit is contained in:
zicodxx 2012-11-02 18:02:43 +01:00
parent 9520012d57
commit 904f1b1a90
9 changed files with 17 additions and 26 deletions

View file

@ -112,4 +112,10 @@ fixang fix_atan2 (fix cos, fix sin);
//for passed value a, returns 1/sqrt(a)
fix fix_isqrt (fix a);
extern const ubyte guess_table[];
extern const short sincos_table[];
extern const ushort asin_table[];
extern const ushort acos_table[];
extern const fix isqrt_guess_table[];
#endif

View file

@ -43,6 +43,10 @@ extern fix compute_lighting_value(g3s_point *vertptr);
// vertbuf is a pointer to an array of vertex pointers
extern void draw_tmap(grs_bitmap *bp, int nverts, g3s_point **vertbuf);
//function that takes the same parms as draw_tmap, but renders as flat poly
//we need this to do the cloaked effect
extern void draw_tmap_flat(grs_bitmap *bp,int nverts,g3s_point **vertbuf);
// -------------------------------------------------------------------------------------------------------
// Texture map vertex.
// The fields r,g,b and l are mutually exclusive. r,g,b are used for rgb lighting.

View file

@ -223,7 +223,8 @@ extern void ui_string_centered( short x, short y, char * s );
extern void ui_draw_box_out( short x1, short y1, short x2, short y2 );
extern void ui_draw_box_in( short x1, short y1, short x2, short y2 );
extern void ui_draw_line_in( short x1, short y1, short x2, short y2 );
extern void ui_draw_frame( short x1, short y1, short x2, short y2 );
extern void ui_draw_shad( short x1, short y1, short x2, short y2, short c1, short c2 );
void ui_init();
void ui_close();

View file

@ -275,10 +275,6 @@ extern fix Max_thrust;
//used for robot engine glow
#define MAX_VELOCITY i2f(50)
//function that takes the same parms as draw_tmap, but renders as flat poly
//we need this to do the cloaked effect
extern void draw_tmap_flat();
//what darkening level to use when cloaked
#define CLOAKED_FADE_LEVEL 28

View file

@ -23,12 +23,6 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "error.h"
#include "maths.h"
extern ubyte guess_table[];
extern short sincos_table[];
extern ushort asin_table[];
extern ushort acos_table[];
extern fix isqrt_guess_table[];
//negate a quad
void fixquadnegate(quadint *q)
{

View file

@ -20,7 +20,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#include "maths.h"
ubyte guess_table[] = {
const ubyte guess_table[] = {
1,
1,1,1,
2,2,2,2,2,
@ -39,7 +39,7 @@ ubyte guess_table[] = {
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
};
short sincos_table[] = {
const short sincos_table[] = {
0,
402,
804,
@ -364,7 +364,7 @@ short sincos_table[] = {
16384
};
ushort asin_table[] = {
const ushort asin_table[] = {
0,
41,
81,
@ -625,7 +625,7 @@ ushort asin_table[] = {
16384 // extra for when exactly 1
};
ushort acos_table[] = {
const ushort acos_table[] = {
16384,
16343,
16303,
@ -886,7 +886,7 @@ ushort acos_table[] = {
0 // extra for when exactly 1
};
fix isqrt_guess_table[] = {
const fix isqrt_guess_table[] = {
// 0,
0x80000000,
16777216,11863283,9686330,8388608,7502999,6849269,6341191,

View file

@ -58,8 +58,6 @@ int Current_seg_depth; // HACK INTERFACE: how far away the current segment (& t
int Max_perspective_depth;
int Max_flat_depth;
extern int Window_clip_left, Window_clip_bot, Window_clip_right, Window_clip_top;
// These variables are the interface to assembler. They get set for each texture map, which is a real waste of time.
// They should be set only when they change, which is generally when the window bounds change. And, even still, it's
// a pretty bad interface.
@ -175,7 +173,6 @@ void init_interface_vars_to_assembler(void)
// -------------------------------------------------------------------------------------
// VARIABLES
extern g3ds_tmap Tmap1;
// -------------------------------------------------------------------------------------
// Returns number preceding val modulo modulus.
@ -904,8 +901,6 @@ void ntexture_map_lighted_linear(grs_bitmap *srcb, g3ds_tmap *t)
// fix DivNum = F1_0*12;
extern void draw_tmap_flat(grs_bitmap *bp,int nverts,g3s_point **vertbuf);
// -------------------------------------------------------------------------------------
// Interface from Matt's data structures to Mike's texture mapper.
// -------------------------------------------------------------------------------------

View file

@ -58,9 +58,6 @@ static unsigned char SavedState[256];
static int PlaybackSpeed = 1;
extern void ui_draw_frame( short x1, short y1, short x2, short y2 );
extern void save_screen_shot(int automap_flag); // avoids conflict with FrameCount when including game.h
// 1=1x faster, 2=2x faster, etc
void ui_set_playback_speed( int speed )
{

View file

@ -30,8 +30,6 @@ static char rcsid[] = "$Id: icon.c,v 1.1.1.1 2006/03/17 19:52:19 zicodxx Exp $";
#define Middle(x) ((2*(x)+1)/4)
extern void ui_draw_shad( short x1, short y1, short x2, short y2, short c1, short c2 );
void ui_draw_box_in1( short x1, short y1, short x2, short y2 )
{