From 9098e305d5fb3da42ff4c440784777b4cb8b2a98 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Thu, 25 Oct 2001 09:12:16 +0000 Subject: [PATCH] Completed tmap selection code. --- main/inferno.c | 15 +++++++++++++-- texmap/ntmap.c | 45 ++++++++++----------------------------------- texmap/tmapflat.c | 21 +++++++-------------- 3 files changed, 30 insertions(+), 51 deletions(-) diff --git a/main/inferno.c b/main/inferno.c index 11dae398..44d8122b 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -13,13 +13,16 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. /* * $Source: /cvs/cvsroot/d2x/main/inferno.c,v $ - * $Revision: 1.10 $ + * $Revision: 1.11 $ * $Author: bradleyb $ - * $Date: 2001-10-25 02:19:31 $ + * $Date: 2001-10-25 09:12:16 $ * * FIXME: put description here * * $Log: not supported by cvs2svn $ + * Revision 1.10 2001/10/25 02:19:31 bradleyb + * conditionalize including multi.h and network.h, fix backslashes, fix compiler errors with EDITOR + * * Revision 1.9 2001/10/19 08:08:50 bradleyb * conditionalize conf.h * @@ -101,6 +104,8 @@ char copyright[] = "DESCENT II COPYRIGHT (C) 1994-1996 PARALLAX SOFTWARE CORPOR // # include "3dfx_des.h" +#include "../texmap/scanline.h" //for select_tmap -MM + #if defined(POLY_ACC) #include "poly_acc.h" extern int Current_display_mode; //$$ there's got to be a better way than hacking this. @@ -276,6 +281,7 @@ void print_commandline_help() printf( " -xcontrol %s\n","FIXME: Undocumented"); printf( " -xname %s\n","FIXME: Undocumented"); printf( " -xver %s\n","FIXME: Undocumented"); + printf( " -tmap %s\n","select texmapper to use (c,fp,i386,pent,ppro)"); printf( "\n D2X System Options:\n\n"); @@ -508,6 +514,11 @@ int main(int argc,char **argv) if ( FindArg( "-noscreens" ) ) Skip_briefing_screens = 1; + if ((t=FindArg("-tmap"))){ + select_tmap(Args[t+1]); + }else + select_tmap(NULL); + Lighting_on = 1; // if (init_graphics()) return 1; diff --git a/texmap/ntmap.c b/texmap/ntmap.c index a934ee26..338cbaa4 100644 --- a/texmap/ntmap.c +++ b/texmap/ntmap.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/texmap/ntmap.c,v $ - * $Revision: 1.4 $ + * $Revision: 1.5 $ * $Author: bradleyb $ - * $Date: 2001-10-25 02:22:46 $ + * $Date: 2001-10-25 09:12:16 $ * * Start of conversion to new texture mapper. * * $Log: not supported by cvs2svn $ + * Revision 1.4 2001/10/25 02:22:46 bradleyb + * adding support for runtime selection of tmap funcs + * * Revision 1.3 2001/01/31 15:18:04 bradleyb * Makefile and conf.h fixes * @@ -147,7 +150,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: ntmap.c,v 1.4 2001-10-25 02:22:46 bradleyb Exp $"; +static char rcsid[] = "$Id: ntmap.c,v 1.5 2001-10-25 09:12:16 bradleyb Exp $"; #endif #define VESA 0 @@ -557,16 +560,8 @@ void ntmap_scanline_lighted(grs_bitmap *srcb, int y, fix xleft, fix xright, fix fx_xright = f2i(xright); fx_xleft = f2i(xleft); -#if defined(FL1_WITH_FLAT) || defined(NO_ASM) tmap_flat_color = 1; - #ifdef NO_ASM - c_tmap_scanline_flat(); - #else - asm_tmap_scanline_flat(); - #endif -#else - asm_tmap_scanline_matt(); -#endif + cur_tmap_scanline_flat(); #else Int3(); // Illegal, called an editor only routine! #endif @@ -815,15 +810,7 @@ void ntmap_scanline_lighted_linear(grs_bitmap *srcb, int y, fix xleft, fix xrigh fx_xleft = 0; //end addition -adb - #ifdef NO_ASM - c_tmap_scanline_lin_nolight(); - #else - #ifdef NO_ASM_NOLIGHT - asm_tmap_scanline_lin_lighted(); - #else - asm_tmap_scanline_lin(); - #endif - #endif + cur_tmap_scanline_lin_nolight(); break; case 1: if (lleft < F1_0/2) @@ -858,26 +845,14 @@ void ntmap_scanline_lighted_linear(grs_bitmap *srcb, int y, fix xleft, fix xrigh fx_l = lleft; dl_dx = fixmul(lright - lleft,recip_dx); fx_dl_dx = dl_dx; - #ifdef NO_ASM - c_tmap_scanline_lin(); - #else - asm_tmap_scanline_lin_lighted(); - #endif + cur_tmap_scanline_lin(); break; case 2: #ifdef EDITOR_TMAP fx_xright = f2i(xright); fx_xleft = f2i(xleft); -#if defined(FL1_WITH_FLAT) || defined(NO_ASM) tmap_flat_color = 1; - #ifdef NO_ASM - c_tmap_scanline_flat(); - #else - asm_tmap_scanline_flat(); - #endif -#else - asm_tmap_scanline_matt(); -#endif + cur_tmap_scanline_flat(); #else Int3(); // Illegal, called an editor only routine! #endif diff --git a/texmap/tmapflat.c b/texmap/tmapflat.c index 6c657222..312ded21 100644 --- a/texmap/tmapflat.c +++ b/texmap/tmapflat.c @@ -12,13 +12,16 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * $Source: /cvs/cvsroot/d2x/texmap/tmapflat.c,v $ - * $Revision: 1.3 $ + * $Revision: 1.4 $ * $Author: bradleyb $ - * $Date: 2001-01-31 15:18:05 $ + * $Date: 2001-10-25 09:12:16 $ * * Flat shader derived from texture mapper (a little slow) * * $Log: not supported by cvs2svn $ + * Revision 1.3 2001/01/31 15:18:05 bradleyb + * Makefile and conf.h fixes + * * Revision 1.2 2001/01/31 14:04:46 bradleyb * Fix compiler warnings * @@ -86,9 +89,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "grdef.h" #include "texmap.h" #include "texmapl.h" -#ifdef NO_ASM #include "scanline.h" -#endif //#include "tmapext.h" @@ -112,18 +113,10 @@ void tmap_scanline_flat(int y, fix xleft, fix xright) fx_xright = f2i(xright); if ( Gr_scanline_darkening_level >= GR_FADE_LEVELS ) - #ifdef NO_ASM - c_tmap_scanline_flat(); - #else - asm_tmap_scanline_flat(); - #endif + cur_tmap_scanline_flat(); else { tmap_flat_shade_value = Gr_scanline_darkening_level; - #ifdef NO_ASM - c_tmap_scanline_shaded(); - #else - asm_tmap_scanline_shaded(); - #endif + cur_tmap_scanline_shaded(); } } -- 2.39.2