From 904f1b1a90b5968d3eed265f3c67d77714515561 Mon Sep 17 00:00:00 2001 From: zicodxx Date: Fri, 2 Nov 2012 18:02:43 +0100 Subject: [PATCH] Moved ui_draw_frame(), ui_draw_shad(), draw_tmap_flat(), math tables externs to headers - patches by Kp --- include/maths.h | 6 ++++++ include/texmap.h | 4 ++++ include/ui.h | 3 ++- main/object.c | 4 ---- maths/fixc.c | 6 ------ maths/tables.c | 10 +++++----- texmap/ntmap.c | 5 ----- ui/dialog.c | 3 --- ui/icon.c | 2 -- 9 files changed, 17 insertions(+), 26 deletions(-) diff --git a/include/maths.h b/include/maths.h index 2319b7fb3..910997d4f 100644 --- a/include/maths.h +++ b/include/maths.h @@ -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 diff --git a/include/texmap.h b/include/texmap.h index 27ac7c9f2..241c7ce24 100644 --- a/include/texmap.h +++ b/include/texmap.h @@ -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. diff --git a/include/ui.h b/include/ui.h index d3d0410f0..8fe08dcf1 100644 --- a/include/ui.h +++ b/include/ui.h @@ -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(); diff --git a/main/object.c b/main/object.c index c9bb83127..1a31504d2 100644 --- a/main/object.c +++ b/main/object.c @@ -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 diff --git a/maths/fixc.c b/maths/fixc.c index 5ef651e74..1924d8cea 100644 --- a/maths/fixc.c +++ b/maths/fixc.c @@ -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) { diff --git a/maths/tables.c b/maths/tables.c index ceb61e131..2e29f08b6 100644 --- a/maths/tables.c +++ b/maths/tables.c @@ -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, diff --git a/texmap/ntmap.c b/texmap/ntmap.c index d753ff828..aaa21f1da 100644 --- a/texmap/ntmap.c +++ b/texmap/ntmap.c @@ -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. // ------------------------------------------------------------------------------------- diff --git a/ui/dialog.c b/ui/dialog.c index 59bfd9791..c0c4ef610 100644 --- a/ui/dialog.c +++ b/ui/dialog.c @@ -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 ) { diff --git a/ui/icon.c b/ui/icon.c index c5dcba5b6..379937a07 100644 --- a/ui/icon.c +++ b/ui/icon.c @@ -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 ) {