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
# include "polymer.h"
#else
#ifdef POLYMOST
# include "polymost.h"
#endif
#endif
#ifdef __cplusplus

View file

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

View file

@ -157,44 +157,7 @@ typedef struct s_prprogrambit {
char* frag_prog;
} _prprogrambit;
// LIGHTS
#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)
#include "prlights.h"
// RENDER TARGETS
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];
int32_t lightcount;
int32_t curlight;
_prlight gamelights[PR_MAXLIGHTS];
int32_t gamelightcount;
#pragma pack(pop)
static GLfloat shadowBias[] =

View file

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

View file

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

View file

@ -712,9 +712,11 @@ int32_t CONFIG_ReadSetup(void)
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "ScreenBPP", &ud.config.ScreenBPP);
if (ud.config.ScreenBPP < 8) ud.config.ScreenBPP = 32;
#ifdef POLYMER
SCRIPT_GetNumber(ud.config.scripthandle, "Screen Setup", "Polymer", &dummy);
if (dummy > 0 && ud.config.ScreenBPP >= 16) glrendmode = 4;
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", "NoAutoLoad",ud.config.NoAutoLoad,FALSE,FALSE);
#ifdef POLYMER
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "Polymer",glrendmode == 4 && bpp > 8,FALSE,FALSE);
#endif
if (!NAM)
{

View file

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

View file

@ -12699,11 +12699,6 @@ GAME_STATIC int32_t G_DoMoveThings(void)
everyothertime++;
if (g_earthquakeTime > 0) g_earthquakeTime--;
#ifdef POLYMER
if (ud.pause_on == 0)
gamelightcount = 0;
#endif
if (ud.pause_on == 0)
{
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);
#ifdef POLYMOST
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
}

View file

@ -1,11 +1,11 @@
#ifndef __CONFIG_TYPES_H__
#define __CONFIG_TYPES_H__
/* these are filled in by configure */
typedef short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long ogg_int64_t;
#endif
#ifndef __CONFIG_TYPES_H__
#define __CONFIG_TYPES_H__
/* these are filled in by configure */
typedef short ogg_int16_t;
typedef unsigned short ogg_uint16_t;
typedef int ogg_int32_t;
typedef unsigned int ogg_uint32_t;
typedef long long ogg_int64_t;
#endif

View file

@ -11,7 +11,7 @@
********************************************************************
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
@ -129,6 +129,15 @@
typedef unsigned int ogg_uint32_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
# include <sys/types.h>

View file

@ -11,7 +11,7 @@
********************************************************************
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
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. *************************************************/
struct alloc_chain{

View file

@ -11,7 +11,7 @@
********************************************************************
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
* 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. */
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;
long *serialnos;
ogg_int64_t *pcmlengths; /* overloaded to maintain binary
compatability; x2 size, stores both
compatibility; x2 size, stores both
beginning and end values */
vorbis_info *vi;
vorbis_comment *vc;

View file

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

View file

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

View file

@ -70,7 +70,9 @@ static struct
GtkWidget *vmode3dlabel;
GtkWidget *vmode3dcombo;
GtkWidget *fullscreencheck;
#ifdef POLYMER
GtkWidget *polymercheck;
#endif
GtkWidget *inputdevlabel;
GtkWidget *inputdevcombo;
GtkWidget *custommodlabel;
@ -103,7 +105,9 @@ static struct
static struct
{
int32_t fullscreen;
#ifdef POLYMER
int32_t polymer;
#endif
int32_t xdim3d, ydim3d, bpp3d;
int32_t forcesetup;
int32_t autoload;
@ -142,6 +146,7 @@ static void on_fullscreencheck_toggled(GtkToggleButton *togglebutton, gpointer u
PopulateForm(POPULATE_VIDEO);
}
#ifdef POLYMER
static void on_polymercheck_toggled(GtkToggleButton *togglebutton, gpointer user_data)
{
UNREFERENCED_PARAMETER(user_data);
@ -161,6 +166,7 @@ static void on_polymercheck_toggled(GtkToggleButton *togglebutton, gpointer user
settings.polymer = FALSE;
}
}
#endif
static void on_inputdevcombo_changed(GtkComboBox *combobox, gpointer user_data)
{
@ -420,7 +426,9 @@ static void PopulateForm(unsigned char pgs)
// populate check buttons
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);
#endif
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stwidgets.autoloadcheck), settings.autoload);
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");
gtk_box_pack_start(GTK_BOX(stwidgets.displayvlayout), stwidgets.fullscreencheck, FALSE, FALSE, 0);
#ifdef POLYMER
// Polymer checkbox
stwidgets.polymercheck = gtk_check_button_new_with_mnemonic("_Polymer");
gtk_box_pack_start(GTK_BOX(stwidgets.displayvlayout), stwidgets.polymercheck, FALSE, FALSE, 0);
#endif
// Input devices LabelText
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);
// 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_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);
// 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_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_CALLBACK(on_fullscreencheck_toggled),
NULL);
#ifdef POLYMER
g_signal_connect((gpointer) stwidgets.polymercheck, "toggled",
G_CALLBACK(on_polymercheck_toggled),
NULL);
#endif
g_signal_connect((gpointer) stwidgets.inputdevcombo, "changed",
G_CALLBACK(on_inputdevcombo_changed),
NULL);
@ -858,11 +870,13 @@ int32_t startwin_run(void)
Bstrncpy(settings.selectedgrp, g_grpNamePtr, BMAX_PATH);
if (ud.config.NoAutoLoad) settings.autoload = FALSE;
else settings.autoload = TRUE;
#ifdef POLYMER
if (glrendmode == RDR_POLYMER)
{
if (settings.bpp3d == 8) settings.bpp3d = 32;
settings.polymer = TRUE;
}
#endif
PopulateForm(ALL);
gtk_main();