This is mostly just build fixes for USE_OPENGL=0, POLYMOST=0 and POLYMER=0. Also updated the precompiled libogg/libvorbis/libvorbisfile that are supplied for MinGW.

git-svn-id: https://svn.eduke32.com/eduke32@1660 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2010-06-23 04:20:46 +00:00
parent a32888140a
commit 068d3c0e52
22 changed files with 105 additions and 67 deletions

View file

@ -701,6 +701,10 @@ void hash_add(hashtable_t *t, const char *s, int32_t key);
#ifdef POLYMER #ifdef POLYMER
# include "polymer.h" # include "polymer.h"
#else
#ifdef POLYMOST
# include "polymost.h"
#endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -65,6 +65,7 @@
# endif # endif
#else #else
# include <stdarg.h> # include <stdarg.h>
# include <stddef.h>
#endif #endif
#ifdef __compat_h_macrodef__ #ifdef __compat_h_macrodef__

View file

@ -157,44 +157,7 @@ typedef struct s_prprogrambit {
char* frag_prog; char* frag_prog;
} _prprogrambit; } _prprogrambit;
// LIGHTS #include "prlights.h"
#define PR_MAXLIGHTS 1024
#define SHADOW_DEPTH_OFFSET 30
#define PR_MAXLIGHTPRIORITY 6
typedef struct s_prplanelist {
struct s_prplane* plane;
struct s_prplanelist* n;
} _prplanelist;
#pragma pack(push,1)
typedef struct s_prlight {
int32_t x, y, z, horiz, range;
int16_t angle, faderadius, radius, sector;
uint8_t color[3], priority;
int8_t minshade, maxshade;
int16_t tilenum;
// internal members
GLfloat proj[16];
GLfloat transform[16];
float frustum[5 * 4];
int32_t rtindex;
struct {
int32_t active : 1;
int32_t invalidate : 1;
int32_t isinview : 1;
} flags;
GLuint lightmap;
_prplanelist* planelist;
int32_t planecount;
} _prlight;
extern _prlight prlights[PR_MAXLIGHTS];
extern int32_t lightcount;
extern _prlight gamelights[PR_MAXLIGHTS];
extern int32_t gamelightcount;
#pragma pack(pop)
// RENDER TARGETS // RENDER TARGETS
typedef struct s_prrt { typedef struct s_prrt {

View file

@ -0,0 +1,40 @@
// LIGHTS
#ifndef _prlight_h_
# define _prlight_h_
#define PR_MAXLIGHTS 1024
#define SHADOW_DEPTH_OFFSET 30
#define PR_MAXLIGHTPRIORITY 6
typedef struct s_prplanelist {
struct s_prplane* plane;
struct s_prplanelist* n;
} _prplanelist;
#pragma pack(push,1)
typedef struct s_prlight {
int32_t x, y, z, horiz, range;
int16_t angle, faderadius, radius, sector;
uint8_t color[3], priority;
int8_t minshade, maxshade;
int16_t tilenum;
// internal members
float proj[16];
float transform[16];
float frustum[5 * 4];
int32_t rtindex;
struct {
int32_t active : 1;
int32_t invalidate : 1;
int32_t isinview : 1;
} flags;
uint32_t lightmap;
_prplanelist* planelist;
int32_t planecount;
} _prlight;
extern _prlight prlights[PR_MAXLIGHTS];
extern int32_t lightcount;
#pragma pack(pop)
#endif

View file

@ -140,9 +140,6 @@ GLfloat artskydata[16];
_prlight prlights[PR_MAXLIGHTS]; _prlight prlights[PR_MAXLIGHTS];
int32_t lightcount; int32_t lightcount;
int32_t curlight; int32_t curlight;
_prlight gamelights[PR_MAXLIGHTS];
int32_t gamelightcount;
#pragma pack(pop) #pragma pack(pop)
static GLfloat shadowBias[] = static GLfloat shadowBias[] =

View file

@ -7,6 +7,7 @@
#include "build.h" #include "build.h"
#include "editor.h" #include "editor.h"
#include "baselayer.h"
enum { enum {
TAB_CONFIG, TAB_CONFIG,

View file

@ -3732,6 +3732,7 @@ ACTOR_STATIC void G_MoveActors(void)
s->z = sector[sect].ceilingz+(32<<8); s->z = sector[sect].ceilingz+(32<<8);
#ifdef POLYMER #ifdef POLYMER
/*
gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum;
gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x;
gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = s->y; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = s->y;
@ -3751,6 +3752,7 @@ ACTOR_STATIC void G_MoveActors(void)
if (gamelightcount < PR_MAXLIGHTS) if (gamelightcount < PR_MAXLIGHTS)
gamelightcount++; gamelightcount++;
*/
#endif // POLYMER #endif // POLYMER
if (!g_netServer && ud.multimode < 2) if (!g_netServer && ud.multimode < 2)

View file

@ -109,7 +109,7 @@ static struct strllist
static const char *Typestr[] = { "Wall", "Ceiling", "Floor", "Sprite", "Wall" }; static const char *Typestr[] = { "Wall", "Ceiling", "Floor", "Sprite", "Wall" };
static const char *typestr[] = { "wall", "ceiling", "floor", "sprite", "wall" }; static const char *typestr[] = { "wall", "ceiling", "floor", "sprite", "wall" };
static const char *Typestr_wss[] = { "Wall", "Sector", "Sector", "Sprite", "Wall" }; static const char *Typestr_wss[] = { "Wall", "Sector", "Sector", "Sprite", "Wall" };
static const char *typestr_wss[] = { "wall", "sector", "sector", "sprite", "wall" }; /*static const char *typestr_wss[] = { "wall", "sector", "sector", "sprite", "wall" };*/
//#define AIMED_obj (typestr[searchstat]) //#define AIMED_obj (typestr[searchstat])

View file

@ -712,9 +712,11 @@ int32_t CONFIG_ReadSetup(void)
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenBPP", &ud.config.ScreenBPP); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenBPP", &ud.config.ScreenBPP);
if (ud.config.ScreenBPP < 8) ud.config.ScreenBPP = 32; if (ud.config.ScreenBPP < 8) ud.config.ScreenBPP = 32;
#ifdef POLYMER
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Polymer", &dummy); SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Polymer", &dummy);
if (dummy > 0 && ud.config.ScreenBPP >= 16) glrendmode = 4; if (dummy > 0 && ud.config.ScreenBPP >= 16) glrendmode = 4;
else glrendmode = 3; else glrendmode = 3;
#endif
/* /*
@ -857,7 +859,9 @@ void CONFIG_WriteSetup(void)
SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "ForceSetup",ud.config.ForceSetup,FALSE,FALSE); SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "ForceSetup",ud.config.ForceSetup,FALSE,FALSE);
SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "NoAutoLoad",ud.config.NoAutoLoad,FALSE,FALSE); SCRIPT_PutNumber(ud.config.scripthandle, "Setup", "NoAutoLoad",ud.config.NoAutoLoad,FALSE,FALSE);
#ifdef POLYMER
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Polymer",glrendmode == 4 && bpp > 8,FALSE,FALSE); SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Polymer",glrendmode == 4 && bpp > 8,FALSE,FALSE);
#endif
if (!NAM) if (!NAM)
{ {

View file

@ -33,6 +33,10 @@ extern "C" {
#include "build.h" #include "build.h"
#ifdef POLYMER #ifdef POLYMER
# include "polymer.h" # include "polymer.h"
#else
#ifdef POLYMOST
# include "polymost.h"
#endif
#endif #endif
#include "cache1d.h" #include "cache1d.h"
#include "pragmas.h" #include "pragmas.h"

View file

@ -12699,11 +12699,6 @@ GAME_STATIC int32_t G_DoMoveThings(void)
everyothertime++; everyothertime++;
if (g_earthquakeTime > 0) g_earthquakeTime--; if (g_earthquakeTime > 0) g_earthquakeTime--;
#ifdef POLYMER
if (ud.pause_on == 0)
gamelightcount = 0;
#endif
if (ud.pause_on == 0) if (ud.pause_on == 0)
{ {
g_globalRandom = krand(); g_globalRandom = krand();

View file

@ -1531,6 +1531,8 @@ static void Gv_AddSystemVars(void)
Gv_NewVar("lastsavepos",(intptr_t)&g_lastSaveSlot, GAMEVAR_SYSTEM | GAMEVAR_INTPTR | GAMEVAR_SYNCCHECK); Gv_NewVar("lastsavepos",(intptr_t)&g_lastSaveSlot, GAMEVAR_SYSTEM | GAMEVAR_INTPTR | GAMEVAR_SYNCCHECK);
#ifdef POLYMOST #ifdef POLYMOST
Gv_NewVar("rendmode",(intptr_t)&rendmode, GAMEVAR_READONLY | GAMEVAR_INTPTR | GAMEVAR_SYSTEM | GAMEVAR_SYNCCHECK); Gv_NewVar("rendmode",(intptr_t)&rendmode, GAMEVAR_READONLY | GAMEVAR_INTPTR | GAMEVAR_SYSTEM | GAMEVAR_SYNCCHECK);
#else
Gv_NewVar("rendmode", 0, GAMEVAR_READONLY | GAMEVAR_SYSTEM | GAMEVAR_SYNCCHECK);
#endif #endif
} }

View file

@ -11,7 +11,7 @@
******************************************************************** ********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal. function: #ifdef jail to whip a few platforms into the UNIX ideal.
last mod: $Id: os_types.h 14997 2008-06-04 03:27:18Z ivo $ last mod: $Id: os_types.h 16649 2009-10-25 00:49:58Z ds $
********************************************************************/ ********************************************************************/
#ifndef _OS_TYPES_H #ifndef _OS_TYPES_H
@ -129,6 +129,15 @@
typedef unsigned int ogg_uint32_t; typedef unsigned int ogg_uint32_t;
typedef long long int ogg_int64_t; typedef long long int ogg_int64_t;
#elif defined(__TMS320C6X__)
/* TI C64x compiler */
typedef signed short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
typedef signed int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long int ogg_int64_t;
#else #else
# include <sys/types.h> # include <sys/types.h>

View file

@ -11,7 +11,7 @@
******************************************************************** ********************************************************************
function: libvorbis codec headers function: libvorbis codec headers
last mod: $Id: codec.h 16037 2009-05-26 21:10:58Z xiphmont $ last mod: $Id: codec.h 17021 2010-03-24 09:29:41Z xiphmont $
********************************************************************/ ********************************************************************/
@ -121,7 +121,7 @@ typedef struct vorbis_block{
/* vorbis_block is a single block of data to be processed as part of /* vorbis_block is a single block of data to be processed as part of
the analysis/synthesis stream; it belongs to a specific logical the analysis/synthesis stream; it belongs to a specific logical
bitstream, but is independant from other vorbis_blocks belonging to bitstream, but is independent from other vorbis_blocks belonging to
that logical bitstream. *************************************************/ that logical bitstream. *************************************************/
struct alloc_chain{ struct alloc_chain{

View file

@ -11,7 +11,7 @@
******************************************************************** ********************************************************************
function: stdio-based convenience library for opening/seeking/decoding function: stdio-based convenience library for opening/seeking/decoding
last mod: $Id: vorbisfile.h 16243 2009-07-10 02:49:31Z xiphmont $ last mod: $Id: vorbisfile.h 17021 2010-03-24 09:29:41Z xiphmont $
********************************************************************/ ********************************************************************/
@ -47,7 +47,7 @@ typedef struct {
/* a few sets of convenient callbacks, especially for use under /* a few sets of convenient callbacks, especially for use under
* Windows where ov_open_callbacks() should always be used instead of * Windows where ov_open_callbacks() should always be used instead of
* ov_open() to avoid problems with incompatable crt.o version linking * ov_open() to avoid problems with incompatible crt.o version linking
* issues. */ * issues. */
static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){ static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){
@ -122,7 +122,7 @@ typedef struct OggVorbis_File {
ogg_int64_t *dataoffsets; ogg_int64_t *dataoffsets;
long *serialnos; long *serialnos;
ogg_int64_t *pcmlengths; /* overloaded to maintain binary ogg_int64_t *pcmlengths; /* overloaded to maintain binary
compatability; x2 size, stores both compatibility; x2 size, stores both
beginning and end values */ beginning and end values */
vorbis_info *vi; vorbis_info *vi;
vorbis_comment *vc; vorbis_comment *vc;

View file

@ -498,7 +498,7 @@ void G_CacheMapData(void)
polymost_precache(i,DETAILPAL,type); polymost_precache(i,DETAILPAL,type);
if (r_glowmapping && !KB_KeyPressed(sc_Space)) if (r_glowmapping && !KB_KeyPressed(sc_Space))
polymost_precache(i,GLOWPAL,type); polymost_precache(i,GLOWPAL,type);
#ifdef POLYMER
if (rendmode==4) if (rendmode==4)
{ {
if (pr_specularmapping && !KB_KeyPressed(sc_Space)) if (pr_specularmapping && !KB_KeyPressed(sc_Space))
@ -506,6 +506,7 @@ void G_CacheMapData(void)
if (pr_normalmapping && !KB_KeyPressed(sc_Space)) if (pr_normalmapping && !KB_KeyPressed(sc_Space))
polymost_precache(i,NORMALPAL,type); polymost_precache(i,NORMALPAL,type);
} }
#endif
} }
} }
#endif #endif

View file

@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "duke3d.h" #include "duke3d.h"
#include "prlights.h"
extern char *bitptr; extern char *bitptr;

View file

@ -70,7 +70,9 @@ static struct
GtkWidget *vmode3dlabel; GtkWidget *vmode3dlabel;
GtkWidget *vmode3dcombo; GtkWidget *vmode3dcombo;
GtkWidget *fullscreencheck; GtkWidget *fullscreencheck;
#ifdef POLYMER
GtkWidget *polymercheck; GtkWidget *polymercheck;
#endif
GtkWidget *inputdevlabel; GtkWidget *inputdevlabel;
GtkWidget *inputdevcombo; GtkWidget *inputdevcombo;
GtkWidget *custommodlabel; GtkWidget *custommodlabel;
@ -103,7 +105,9 @@ static struct
static struct static struct
{ {
int32_t fullscreen; int32_t fullscreen;
#ifdef POLYMER
int32_t polymer; int32_t polymer;
#endif
int32_t xdim3d, ydim3d, bpp3d; int32_t xdim3d, ydim3d, bpp3d;
int32_t forcesetup; int32_t forcesetup;
int32_t autoload; int32_t autoload;
@ -142,6 +146,7 @@ static void on_fullscreencheck_toggled(GtkToggleButton *togglebutton, gpointer u
PopulateForm(POPULATE_VIDEO); PopulateForm(POPULATE_VIDEO);
} }
#ifdef POLYMER
static void on_polymercheck_toggled(GtkToggleButton *togglebutton, gpointer user_data) static void on_polymercheck_toggled(GtkToggleButton *togglebutton, gpointer user_data)
{ {
UNREFERENCED_PARAMETER(user_data); UNREFERENCED_PARAMETER(user_data);
@ -161,6 +166,7 @@ static void on_polymercheck_toggled(GtkToggleButton *togglebutton, gpointer user
settings.polymer = FALSE; settings.polymer = FALSE;
} }
} }
#endif
static void on_inputdevcombo_changed(GtkComboBox *combobox, gpointer user_data) static void on_inputdevcombo_changed(GtkComboBox *combobox, gpointer user_data)
{ {
@ -420,7 +426,9 @@ static void PopulateForm(unsigned char pgs)
// populate check buttons // populate check buttons
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stwidgets.fullscreencheck), settings.fullscreen); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stwidgets.fullscreencheck), settings.fullscreen);
#ifdef POLYMER
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stwidgets.polymercheck), settings.polymer); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stwidgets.polymercheck), settings.polymer);
#endif
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stwidgets.autoloadcheck), settings.autoload); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stwidgets.autoloadcheck), settings.autoload);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stwidgets.alwaysshowcheck), settings.forcesetup); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stwidgets.alwaysshowcheck), settings.forcesetup);
} }
@ -532,9 +540,11 @@ static GtkWidget *create_window(void)
stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen"); stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen");
gtk_box_pack_start(GTK_BOX(stwidgets.displayvlayout), stwidgets.fullscreencheck, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(stwidgets.displayvlayout), stwidgets.fullscreencheck, FALSE, FALSE, 0);
#ifdef POLYMER
// Polymer checkbox // Polymer checkbox
stwidgets.polymercheck = gtk_check_button_new_with_mnemonic("_Polymer"); stwidgets.polymercheck = gtk_check_button_new_with_mnemonic("_Polymer");
gtk_box_pack_start(GTK_BOX(stwidgets.displayvlayout), stwidgets.polymercheck, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(stwidgets.displayvlayout), stwidgets.polymercheck, FALSE, FALSE, 0);
#endif
// Input devices LabelText // Input devices LabelText
stwidgets.inputdevlabel = gtk_label_new_with_mnemonic("_Input devices:"); stwidgets.inputdevlabel = gtk_label_new_with_mnemonic("_Input devices:");
@ -556,7 +566,7 @@ static GtkWidget *create_window(void)
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevcombo, 1,2, 1,2, GTK_EXPAND | GTK_FILL, 0, 4, 0); gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevcombo, 1,2, 1,2, GTK_EXPAND | GTK_FILL, 0, 4, 0);
// Custom mod LabelText // Custom mod LabelText
stwidgets.custommodlabel = gtk_label_new_with_mnemonic("Custom _Mod:"); stwidgets.custommodlabel = gtk_label_new_with_mnemonic("Custom _game:");
gtk_misc_set_alignment(GTK_MISC(stwidgets.custommodlabel), 0.3, 0); gtk_misc_set_alignment(GTK_MISC(stwidgets.custommodlabel), 0.3, 0);
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodlabel, 0,1, 2,3, GTK_FILL, 0, 4, 7); gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodlabel, 0,1, 2,3, GTK_FILL, 0, 4, 7);
@ -596,7 +606,7 @@ static GtkWidget *create_window(void)
gtk_container_set_border_width(GTK_CONTAINER(stwidgets.gamevlayout), 4); gtk_container_set_border_width(GTK_CONTAINER(stwidgets.gamevlayout), 4);
// Game data field LabelText // Game data field LabelText
stwidgets.gamelabel = gtk_label_new_with_mnemonic("_Game or addon:"); stwidgets.gamelabel = gtk_label_new_with_mnemonic("_Game:");
gtk_box_pack_start(GTK_BOX(stwidgets.gamevlayout), stwidgets.gamelabel, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(stwidgets.gamevlayout), stwidgets.gamelabel, FALSE, FALSE, 0);
gtk_misc_set_alignment(GTK_MISC(stwidgets.gamelabel), 0, 0.5); gtk_misc_set_alignment(GTK_MISC(stwidgets.gamelabel), 0, 0.5);
@ -703,9 +713,11 @@ static GtkWidget *create_window(void)
g_signal_connect((gpointer) stwidgets.fullscreencheck, "toggled", g_signal_connect((gpointer) stwidgets.fullscreencheck, "toggled",
G_CALLBACK(on_fullscreencheck_toggled), G_CALLBACK(on_fullscreencheck_toggled),
NULL); NULL);
#ifdef POLYMER
g_signal_connect((gpointer) stwidgets.polymercheck, "toggled", g_signal_connect((gpointer) stwidgets.polymercheck, "toggled",
G_CALLBACK(on_polymercheck_toggled), G_CALLBACK(on_polymercheck_toggled),
NULL); NULL);
#endif
g_signal_connect((gpointer) stwidgets.inputdevcombo, "changed", g_signal_connect((gpointer) stwidgets.inputdevcombo, "changed",
G_CALLBACK(on_inputdevcombo_changed), G_CALLBACK(on_inputdevcombo_changed),
NULL); NULL);
@ -858,11 +870,13 @@ int32_t startwin_run(void)
Bstrncpy(settings.selectedgrp, g_grpNamePtr, BMAX_PATH); Bstrncpy(settings.selectedgrp, g_grpNamePtr, BMAX_PATH);
if (ud.config.NoAutoLoad) settings.autoload = FALSE; if (ud.config.NoAutoLoad) settings.autoload = FALSE;
else settings.autoload = TRUE; else settings.autoload = TRUE;
#ifdef POLYMER
if (glrendmode == RDR_POLYMER) if (glrendmode == RDR_POLYMER)
{ {
if (settings.bpp3d == 8) settings.bpp3d = 32; if (settings.bpp3d == 8) settings.bpp3d = 32;
settings.polymer = TRUE; settings.polymer = TRUE;
} }
#endif
PopulateForm(ALL); PopulateForm(ALL);
gtk_main(); gtk_main();