mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-10 14:42:06 +00:00
Added common/config.h.in, moving the version and a few other variables
there, more will be added later as needed.. Added -Wall to the cflags on a few things, may have missed some stuff.. Changed the tests on HAVE_GL_COLOR_INDEX8_EXT to actually function.. (Fixes the GL texture problem..) Added tests for GLAPIENTRY and APIENTRY, there will alweys be something.. Fixed the check for the 3dfxgl lib.. Some makefile tweaking.. Changed VERSION into a string so it can easily be 0.1.0.. Removed the generated configure script, does not merge sanely..
This commit is contained in:
parent
d9d937cd66
commit
e468985ee1
11 changed files with 117 additions and 3874 deletions
|
@ -21,9 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#define QUAKE_GAME // as opposed to utilities
|
||||
|
||||
//#define PARANOID // speed sapping error checking
|
||||
|
||||
#define VERSION 0.1
|
||||
#include <config/config.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
@ -33,7 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <setjmp.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
#if defined(_WIN32) && !defined(WINDED)
|
||||
void VID_LockBuffer (void);
|
||||
void VID_UnlockBuffer (void);
|
||||
|
|
31
common/config/config.h.in
Normal file
31
common/config/config.h.in
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG__CONFIG_H
|
||||
#define __CONFIG__CONFIG_H
|
||||
|
||||
#define VERSION "0.1.0"
|
||||
|
||||
#undef GLAPIENTRY_IS_APIENTRY
|
||||
|
||||
#ifdef GLAPIENTRY_IS_APIENTRY
|
||||
# define GLAPIENTRY APIENTRY
|
||||
#endif
|
||||
#endif // __CONFIG__CONFIG_H
|
102
configure.in
102
configure.in
|
@ -27,7 +27,7 @@ AC_SUBST(OGL_LDFLAGS)
|
|||
AC_ARG_WITH(opengl-includes,
|
||||
[ --with-opengl-includes=DIR
|
||||
use OpenGL with header files found in DIR],
|
||||
HAS_OGL_INC=yes; OGL_INC_PATH=$enable_OpenGLINC; OGL_CFLAGS=-I$enable_OpenGLINC)
|
||||
HAS_OGL_INC=yes; OGL_INC_PATH=$enable_OpenGLINC; OGL_CFLAGS=-Wall -I$enable_OpenGLINC)
|
||||
AC_SUBST(OGL_CFLAGS)
|
||||
|
||||
dnl Check for X first...
|
||||
|
@ -85,7 +85,7 @@ if test "x$HAS_OGL_INC" = x; then
|
|||
AC_MSG_CHECKING(for $x_includes/GL/gl.h)
|
||||
if test -f "$x_includes"/GL/gl.h; then
|
||||
HAS_OGL_INC=yes
|
||||
OGL_CFLAGS=-I$x_includes
|
||||
OGL_CFLAGS=-Wall -I$x_includes
|
||||
OGL_INC_PATH=$x_includes
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
|
@ -93,7 +93,7 @@ if test "x$HAS_OGL_INC" = x; then
|
|||
AC_MSG_CHECKING(for $POSS_OGL_CFLAGS/GL/gl.h)
|
||||
if test -f "$POSS_OGL_CFLAGS/GL/gl.h"; then
|
||||
HAS_OGL_INC=yes
|
||||
OGL_CFLAGS=-I$POSS_OGL_CFLAGS
|
||||
OGL_CFLAGS=-Wall -I$POSS_OGL_CFLAGS
|
||||
OGL_INC_PATH=$POSS_OGL_CFLAGS
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
|
@ -107,38 +107,67 @@ fi
|
|||
|
||||
AC_MSG_CHECKING(for OpenGL support)
|
||||
if test "x$HAS_OGL_INC" != x; then
|
||||
if test "x$HAS_OGL_LIB" != x; then
|
||||
HAS_OGL=yes
|
||||
if test "x$OGL_CFLAGS" != x; then
|
||||
AC_MSG_RESULT([yes, libraries $OGL_LDFLAGS, headers $OGL_CFLAGS])
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
if test "x$OGL_LDFLAGS" = x-L; then
|
||||
AC_MSG_ERROR(OpenGL LDFLAGS is -L with no directory)
|
||||
fi
|
||||
AC_MSG_CHECKING(for GL_COLOR_INDEX8_EXT)
|
||||
if test "x$OGL_INC_PATH" != x; then
|
||||
OGL_INC_PATH_TO_GL="$OGL_INC_PATH/GL/gl.h"
|
||||
else
|
||||
OGL_INC_PATH_TO_GL="GL/gl.h"
|
||||
fi
|
||||
AC_TRY_COMPILE([#include "$OGL_INC_PATH_TO_GL"],
|
||||
[ int x = (int) GL_COLOR_INDEX8_EXT;],
|
||||
HAS_GL_COLOR_INDEX8_EXT=yes,
|
||||
HAS_GL_COLOR_INDEX8_EXT=no)
|
||||
if test "x$HAS_GL_COLOR_INDEX8_EXT" != xno; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAS_GL_COLOR_INDEX8_EXT, 1)
|
||||
fi
|
||||
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "x$HAS_OGL_LIB" != x; then
|
||||
HAS_OGL=yes
|
||||
if test "x$OGL_CFLAGS" != x; then
|
||||
AC_MSG_RESULT([yes, libraries $OGL_LDFLAGS, headers $OGL_CFLAGS])
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
if test "x$OGL_LDFLAGS" = x-L; then
|
||||
AC_MSG_ERROR(OpenGL LDFLAGS is -L with no directory)
|
||||
fi
|
||||
if test "x$OGL_INC_PATH" != x; then
|
||||
OGL_INC_PATH_TO_GL="$OGL_INC_PATH/GL/gl.h"
|
||||
else
|
||||
OGL_INC_PATH_TO_GL="GL/gl.h"
|
||||
fi
|
||||
AC_MSG_CHECKING(for GL_COLOR_INDEX8_EXT)
|
||||
AC_TRY_COMPILE([#include "$OGL_INC_PATH_TO_GL"],
|
||||
[ int x = (int) GL_COLOR_INDEX8_EXT;],
|
||||
HAVE_GL_COLOR_INDEX8_EXT=yes,
|
||||
HAVE_GL_COLOR_INDEX8_EXT=no)
|
||||
if test "x$HAVE_GL_COLOR_INDEX8_EXT" != xno; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GL_COLOR_INDEX8_EXT, 1)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(Error, HAVE_GL_COLOR_INDEX8_EXT not found.)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for GLAPIENTRY)
|
||||
AC_TRY_COMPILE([#include "$OGL_INC_PATH_TO_GL"],
|
||||
[ int x = GLAPIENTRY printf("");],
|
||||
HAS_GLAPIENTRY=yes,
|
||||
HAS_GLAPIENTRY=no)
|
||||
if test "x$HAS_GLAPIENTRY" != xno; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING(for APIENTRY)
|
||||
AC_TRY_COMPILE([#include "$OGL_INC_PATH_TO_GL"],
|
||||
[ int x = APIENTRY printf("");],
|
||||
HAS_APIENTRY=yes,
|
||||
HAS_APIENTRY=no)
|
||||
if test "x$HAS_APIENTRY" != xno; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(GLAPIENTRY_IS_APIENTRY, 1)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(Error, neither GLAPIENTRY nor APIENTRY are defined)
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_SUBST(HAS_OGL)
|
||||
AC_SUBST(HAS_APIENTRY)
|
||||
AC_SUBST(HAS_GLAPIENTRY)
|
||||
|
||||
dnl Check for other libraries
|
||||
AC_CHECK_LIB(vga, vga_getmousetype, [HAS_VGA=yes], [HAS_VGA=])
|
||||
|
@ -196,9 +225,7 @@ if test "x$HAS_TDFXGL" != xno; then
|
|||
if test "x$HAS_OGL" != x; then
|
||||
if test "x$HAS_VGA" != x; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$TDFXGL_LDFLAGS $LIBS"
|
||||
AC_CHECK_LIB(3dfxgl, glColor4f, HAS_TDFXGL=yes, HAS_TDFXGL=)
|
||||
LIBS="$save_LIBS"
|
||||
AC_CHECK_LIB(3dfxgl, glColor4f, HAS_TDFXGL=yes, HAS_TDFXGL=, -lglide2x)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -226,7 +253,7 @@ AC_SUBST(STRICMP_DEF)
|
|||
if test "x$RELEASE" = xyes; then
|
||||
if test "x$GCC" = xyes; then
|
||||
AC_MSG_CHECKING(for special release compiler settings)
|
||||
BASE_RELEASE_CFLAGS="-O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"
|
||||
BASE_RELEASE_CFLAGS="-Wall -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"
|
||||
dnl FIX: Someone PLEASE be so kind as to make this -mcpu stuff sane?
|
||||
case "${target}" in
|
||||
changequote(,)dnl
|
||||
|
@ -363,5 +390,6 @@ AC_PATH_XTRA
|
|||
#
|
||||
# Output files
|
||||
#
|
||||
AC_CONFIG_HEADER(common/config/config.h)
|
||||
AC_OUTPUT(qw_client/Makefile qw_server/Makefile uquake/Makefile Makefile)
|
||||
|
||||
|
|
|
@ -142,7 +142,8 @@ MISC_SRC = common.c crc.c cvar.c cmd.c mathlib.c wad.c zone.c
|
|||
|
||||
# OpenGL
|
||||
GL_REND_SRC = gl_screen.c gl_model.c gl_draw.c gl_mesh.c gl_refrag.c \
|
||||
gl_rlight.c gl_rmain.c gl_rmisc.c gl_rsurf.c gl_test.c gl_warp.c
|
||||
gl_rlight.c gl_rmain.c gl_rmisc.c gl_rsurf.c gl_warp.c nonintel.c
|
||||
# gl_rlight.c gl_rmain.c gl_rmisc.c gl_rsurf.c gl_test.c gl_warp.c
|
||||
QW_GL_REND_SRC = gl_ngraph.c
|
||||
|
||||
# Software source
|
||||
|
@ -182,7 +183,7 @@ CL_COMMON_SRC = $(MISC_SRC) $(CL_GUI_SRC) $(CL_SRC) \
|
|||
# Directory specific stuff
|
||||
#
|
||||
DEFS = @DEFS@ @STRICMP_DEF@
|
||||
CFLAGS = -DQUAKEWORLD $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) -I$(QW_COMMON_DIR) -I$(COMMON_DIR)
|
||||
CFLAGS = -Wall -DQUAKEWORLD $(OPTFLAGS) $(DEFS) -I. $(SRC_DIR_INC) -I$(QW_COMMON_DIR) -I$(COMMON_DIR)
|
||||
ALL_X11_SRC = $(GENERAL_SRC) $(SW_REND_SRC) $(QW_X11_VID_SRC) model.c
|
||||
ALL_GL_SRC = $(GENERAL_SRC) $(GL_REND_SRC) $(GL_VID_SRC) $(QW_GL_REND_SRC)
|
||||
ALL_TDFX_SRC = $(GENERAL_SRC) $(GL_REND_SRC) $(TDFX_VID_SRC) $(QW_GL_REND_SRC)
|
||||
|
|
|
@ -177,7 +177,7 @@ CL_Version_f
|
|||
*/
|
||||
void CL_Version_f (void)
|
||||
{
|
||||
Con_Printf ("Version %4.2f\n", VERSION);
|
||||
Con_Printf ("Version %s\n", VERSION);
|
||||
Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
|
||||
}
|
||||
|
||||
|
@ -1077,7 +1077,7 @@ void CL_Init (void)
|
|||
Info_SetValueForKey (cls.userinfo, "rate", "2500", MAX_INFO_STRING);
|
||||
Info_SetValueForKey (cls.userinfo, "msg", "1", MAX_INFO_STRING);
|
||||
//sprintf (st, "%4.2f-%04d", VERSION, build_number());
|
||||
sprintf (st, "%.1f", VERSION);
|
||||
sprintf (st, "%s", VERSION);
|
||||
Info_SetValueForStarKey (cls.userinfo, "*ver", st, MAX_INFO_STRING);
|
||||
|
||||
CL_InitInput ();
|
||||
|
@ -1515,7 +1515,7 @@ void Host_Init (quakeparms_t *parms)
|
|||
|
||||
host_initialized = true;
|
||||
|
||||
Con_Printf ("\nClient Version %4.2f (Build %04d)\n\n", VERSION, build_number());
|
||||
Con_Printf ("\nClient Version %s (Build %04d)\n\n", VERSION, build_number());
|
||||
|
||||
Con_Printf ("€<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> QuakeWorld Initialized <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‚\n");
|
||||
}
|
||||
|
|
|
@ -659,14 +659,14 @@ void Draw_ConsoleBackground (int lines)
|
|||
//sprintf (ver, "start commands with a \\ character %4.2f", VERSION);
|
||||
|
||||
if (cls.download) {
|
||||
sprintf (ver, "%4.2f", VERSION);
|
||||
sprintf (ver, "%s", VERSION);
|
||||
dest = conback->data + 320 + 320*186 - 11 - 8*strlen(ver);
|
||||
} else {
|
||||
#if defined(__linux__)
|
||||
//sprintf (ver, "Linux (%4.2f) QuakeWorld %4.2f", LINUX_VERSION, VERSION);
|
||||
sprintf (ver, "QuakeForge (Linux QuakeWorld) Version %4.2f", VERSION);
|
||||
sprintf (ver, "QuakeForge (Linux QuakeWorld) Version %s", VERSION);
|
||||
#else
|
||||
sprintf (ver, "QuakeForge (QuakeWorld) %4.2f", VERSION);
|
||||
sprintf (ver, "QuakeForge (QuakeWorld) %s", VERSION);
|
||||
#endif
|
||||
dest = conback->data + 320 - (strlen(ver)*8 + 11) + 320*186;
|
||||
}
|
||||
|
|
|
@ -414,7 +414,7 @@ void Draw_Init (void)
|
|||
Sys_Error ("Couldn't load gfx/conback.lmp");
|
||||
SwapPic (cb);
|
||||
|
||||
sprintf (ver, "%4.2f", VERSION);
|
||||
sprintf (ver, VERSION);
|
||||
dest = cb->data + 320 + 320*186 - 11 - 8*strlen(ver);
|
||||
for (x=0 ; x<strlen(ver) ; x++)
|
||||
Draw_CharToConback (ver[x], dest+(x<<3));
|
||||
|
@ -795,9 +795,9 @@ void Draw_ConsoleBackground (int lines)
|
|||
y = lines-14;
|
||||
if (!cls.download) {
|
||||
#ifdef __linux__
|
||||
sprintf (ver, "QuakeForge (LinuxGL QuakeWorld) %4.2f", VERSION);
|
||||
sprintf (ver, "QuakeForge (LinuxGL QuakeWorld) " VERSION);
|
||||
#else
|
||||
sprintf (ver, "QuakeForge (GL QuakeWorld) %4.2f", VERSION);
|
||||
sprintf (ver, "QuakeForge (GL QuakeWorld) " VERSION);
|
||||
#endif
|
||||
x = vid.conwidth - (strlen(ver)*8 + 11) - (vid.conwidth*8/320)*7;
|
||||
for (i=0 ; i<strlen(ver) ; i++)
|
||||
|
@ -1242,9 +1242,7 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
|
|||
if (!mipmap)
|
||||
{
|
||||
// FIXME - what if this extension isn't available?
|
||||
#ifdef HAVE_GL_COLOR_INDEX8_EXT
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX , GL_UNSIGNED_BYTE, data);
|
||||
#endif
|
||||
goto done;
|
||||
}
|
||||
memcpy (scaled, data, width*height);
|
||||
|
@ -1253,9 +1251,7 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
|
|||
GL_Resample8BitTexture (data, width, height, scaled, scaled_width, scaled_height);
|
||||
|
||||
// FIXME - what if this extension isn't available?
|
||||
#ifdef HAVE_GL_COLOR_INDEX8_EXT
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled);
|
||||
#endif
|
||||
if (mipmap)
|
||||
{
|
||||
int miplevel;
|
||||
|
@ -1272,9 +1268,7 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
|
|||
scaled_height = 1;
|
||||
miplevel++;
|
||||
// FIXME - what if this extension isn't available?
|
||||
#ifdef HAVE_GL_COLOR_INDEX8_EXT
|
||||
glTexImage2D (GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, scaled_width, scaled_height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, scaled);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
done: ;
|
||||
|
|
|
@ -1073,9 +1073,9 @@ void M_Quit_Draw (void)
|
|||
#define VSTR(x) #x
|
||||
#define VSTR2(x) VSTR(x)
|
||||
char *cmsg[] = {
|
||||
// 0123456789012345678901234567890123456789
|
||||
// 0123456789012345678901234567890123456789
|
||||
"0 QuakeWorld",
|
||||
"1 version " VSTR2(VERSION) " by id Software",
|
||||
"1 version " VERSION " by id Software",
|
||||
"0Programming",
|
||||
"1 John Carmack Michael Abrash",
|
||||
"1 John Cash Christian Antkow",
|
||||
|
@ -1083,7 +1083,7 @@ void M_Quit_Draw (void)
|
|||
"1 Dave 'Zoid' Kirsch",
|
||||
"1 Jack 'morbid' Mathews",
|
||||
"0Id Software is not responsible for",
|
||||
"0providing technical support for",
|
||||
"0providing technical support for",
|
||||
"0QUAKEWORLD(tm). (c)1996 Id Software,",
|
||||
"0Inc. All Rights Reserved.",
|
||||
"0QUAKEWORLD(tm) is a trademark of Id",
|
||||
|
|
|
@ -20,9 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// quakedef.h -- primary header for server
|
||||
|
||||
#define QUAKE_GAME // as opposed to utilities
|
||||
#define VERSION 0.1
|
||||
#define VERSION "0.1.0"
|
||||
|
||||
//define PARANOID // speed sapping error checking
|
||||
//define PARANOID // speed sapping error checking
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma warning( disable : 4244 4127 4201 4214 4514 4305 4115 4018)
|
||||
|
|
|
@ -520,7 +520,7 @@ void SVC_DirectConnect (void)
|
|||
version = atoi(Cmd_Argv(1));
|
||||
if (version != PROTOCOL_VERSION)
|
||||
{
|
||||
Netchan_OutOfBandPrint (net_from, "%c\nServer is version %4.2f.\n", A2C_PRINT, VERSION);
|
||||
Netchan_OutOfBandPrint (net_from, "%c\nServer is version %s.\n", A2C_PRINT, VERSION);
|
||||
Con_Printf ("* rejected connect from version %i\n", version);
|
||||
return;
|
||||
}
|
||||
|
@ -1366,7 +1366,7 @@ void SV_InitLocal (void)
|
|||
for (i=0 ; i<MAX_MODELS ; i++)
|
||||
sprintf (localmodels[i], "*%i", i);
|
||||
|
||||
Info_SetValueForStarKey (svs.info, "*version", va("%4.2f", VERSION), MAX_SERVERINFO_STRING);
|
||||
Info_SetValueForStarKey (svs.info, "*version", va("%s", VERSION), MAX_SERVERINFO_STRING);
|
||||
|
||||
// init fraglog stuff
|
||||
svs.logsequence = 1;
|
||||
|
@ -1644,7 +1644,7 @@ void SV_Init (quakeparms_t *parms)
|
|||
Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
|
||||
Con_Printf ("%4.1f megabyte heap\n",parms->memsize/ (1024*1024.0));
|
||||
|
||||
Con_Printf ("\nServer Version %4.2f (Build %04d)\n\n", VERSION, build_number());
|
||||
Con_Printf ("\nServer Version %s (Build %04d)\n\n", VERSION, build_number());
|
||||
|
||||
Con_Printf ("======== QuakeWorld Initialized ========\n");
|
||||
|
||||
|
|
Loading…
Reference in a new issue