Skip to content

Commit

Permalink
More cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-allen committed May 4, 2014
1 parent 81e01b1 commit a5fc49b
Show file tree
Hide file tree
Showing 34 changed files with 6,841 additions and 5,813 deletions.
6,953 changes: 1,199 additions & 5,754 deletions code/SDL12/include/SDL_opengl.h

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions code/client/cl_cgame.c
Expand Up @@ -186,16 +186,6 @@ void CL_AddCgameCommand( const char *cmdName ) {
Cmd_AddCommand( cmdName, NULL );
}

/*
=====================
CL_CgameError
=====================
*/
void CL_CgameError( const char *string ) {
Com_Error( ERR_DROP, "%s", string );
}


/*
=====================
CL_ConfigstringModified
Expand Down
41 changes: 36 additions & 5 deletions code/qcommon/common.c
Expand Up @@ -2846,17 +2846,48 @@ Read whatever is in com_pipefile, if anything, and execute it
*/
void Com_ReadFromPipe( void )
{
char buffer[MAX_STRING_CHARS] = {""};
qboolean read;
static char buf[MAX_STRING_CHARS];
static int accu = 0;
int read;

if( !pipefile )
return;

read = FS_Read( buffer, sizeof( buffer ), pipefile );
if( read )
Cbuf_ExecuteText( EXEC_APPEND, buffer );
while( ( read = FS_Read( buf + accu, sizeof( buf ) - accu - 1, pipefile ) ) > 0 )
{
char *brk = NULL;
int i;

for( i = accu; i < accu + read; ++i )
{
if( buf[ i ] == '\0' )
buf[ i ] = '\n';
if( buf[ i ] == '\n' || buf[ i ] == '\r' )
brk = &buf[ i + 1 ];
}
buf[ accu + read ] = '\0';

accu += read;

if( brk )
{
char tmp = *brk;
*brk = '\0';
Cbuf_ExecuteText( EXEC_APPEND, buf );
*brk = tmp;

accu -= brk - buf;
memmove( buf, brk, accu + 1 );
}
else if( accu >= sizeof( buf ) - 1 ) // full
{
Cbuf_ExecuteText( EXEC_APPEND, buf );
accu = 0;
}
}
}


//==================================================================

void Com_WriteConfigToFile( const char *filename ) {
Expand Down
3 changes: 1 addition & 2 deletions code/sdl/sdl_glimp.c
Expand Up @@ -31,7 +31,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <stdlib.h>
#include <math.h>

//FIXME: factor out the bits that are actually needed here into a renderercommon header
#include "../renderercommon/tr_common.h"
#include "../sys/sys_local.h"
#include "sdl_icon.h"
Expand Down Expand Up @@ -239,7 +238,7 @@ static int GLimp_SetMode(int mode, qboolean fullscreen, qboolean noborder)

ri.Printf (PRINT_ALL, "...setting mode %d:", mode );

if (mode == -2)
if (mode == -2)
{
// use desktop video resolution
if( videoInfo->current_h > 0 )
Expand Down
2 changes: 1 addition & 1 deletion md4-readme.txt
Expand Up @@ -19,7 +19,7 @@ this readme. Since the code on how to handle those MDR files was released
under a GPL licence a long time ago, I was able to implement this format for
Quake3 and do some efficiency improvements.
To enable the support for this model format, go to qcommon/qfiles.h,
remove the comment slashes for #define RAVENMDR and then compile the engine.
remove the comment slashes for #define RAVENMD4 and then compile the engine.

Including finished MDR models in your projects is easy: just load the model
files in your cgame code as you would normally load an MD3 model. The engine
Expand Down
4 changes: 2 additions & 2 deletions misc/nsis/ioquake3.nsi.in
Expand Up @@ -93,7 +93,7 @@ Section "ioquake3 (required)"
File "../../build/release-mingw32-x86/ioquake3.x86.exe"
!ifdef USE_RENDERER_DLOPEN
File "../../build/release-mingw32-x86/renderer_opengl1_x86.dll"
File "../../build/release-mingw32-x86/renderer_rend2_x86.dll"
File "../../build/release-mingw32-x86/renderer_opengl2_x86.dll"
!endif

File "../../COPYING.txt"
Expand Down Expand Up @@ -181,7 +181,7 @@ Section "Uninstall"
Delete $INSTDIR\ioq3ded.x86.exe
!ifdef USE_RENDERER_DLOPEN
Delete $INSTDIR\renderer_opengl1_x86.dll
Delete $INSTDIR\renderer_rend2_x86.dll
Delete $INSTDIR\renderer_opengl2_x86.dll
!endif

Delete $INSTDIR\COPYING.txt
Expand Down
4 changes: 3 additions & 1 deletion misc/osxfe/ioquake3fe/Info.plist
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>ioquake3.icns</string>
<string>quake3_flat</string>
<key>CFBundleIdentifier</key>
<string>org.icculus.quake3</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -16,6 +16,8 @@
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
34 changes: 21 additions & 13 deletions misc/osxfe/ioquake3fe/ioquake3fe.xcodeproj/project.pbxproj
Expand Up @@ -3,16 +3,16 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
278714DB1791207600094CA3 /* quake3_flat.icns in Resources */ = {isa = PBXBuildFile; fileRef = 278714DA1791207600094CA3 /* quake3_flat.icns */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
C30C62180F677DD30043A4E2 /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = C30C62170F677DD30043A4E2 /* Controller.m */; };
C30C631D0F67A37E0043A4E2 /* ErrorWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = C30C631C0F67A37E0043A4E2 /* ErrorWindow.m */; };
C30C638F0F67AA7B0043A4E2 /* ioquake3.icns in Resources */ = {isa = PBXBuildFile; fileRef = C30C638E0F67AA7B0043A4E2 /* ioquake3.icns */; };
C34EC1F60F68433A00C42E7D /* ErrorWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34EC1F50F68433A00C42E7D /* ErrorWindowController.m */; };
C37357890F68280200B1A10C /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = C37357850F68280200B1A10C /* MainMenu.xib */; };
C373578A0F68280200B1A10C /* ErrorWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = C37357870F68280200B1A10C /* ErrorWindow.xib */; };
Expand All @@ -22,6 +22,7 @@
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
278714DA1791207600094CA3 /* quake3_flat.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = quake3_flat.icns; path = ../../quake3_flat.icns; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
Expand All @@ -32,7 +33,6 @@
C30C62170F677DD30043A4E2 /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = "<group>"; };
C30C631B0F67A37E0043A4E2 /* ErrorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorWindow.h; sourceTree = "<group>"; };
C30C631C0F67A37E0043A4E2 /* ErrorWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ErrorWindow.m; sourceTree = "<group>"; };
C30C638E0F67AA7B0043A4E2 /* ioquake3.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = ioquake3.icns; sourceTree = "<group>"; };
C34EC1F40F68433A00C42E7D /* ErrorWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorWindowController.h; sourceTree = "<group>"; };
C34EC1F50F68433A00C42E7D /* ErrorWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ErrorWindowController.m; sourceTree = "<group>"; };
C37357860F68280200B1A10C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -116,7 +116,7 @@
children = (
C37357850F68280200B1A10C /* MainMenu.xib */,
C37357870F68280200B1A10C /* ErrorWindow.xib */,
C30C638E0F67AA7B0043A4E2 /* ioquake3.icns */,
278714DA1791207600094CA3 /* quake3_flat.icns */,
8D1107310486CEB800E47090 /* Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
);
Expand Down Expand Up @@ -158,9 +158,16 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0460;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ioquake3fe" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* ioquake3fe */;
projectDirPath = "";
projectRoot = "";
Expand All @@ -176,9 +183,9 @@
buildActionMask = 2147483647;
files = (
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
C30C638F0F67AA7B0043A4E2 /* ioquake3.icns in Resources */,
C37357890F68280200B1A10C /* MainMenu.xib in Resources */,
C373578A0F68280200B1A10C /* ErrorWindow.xib in Resources */,
278714DB1791207600094CA3 /* quake3_flat.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -230,15 +237,16 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ioquake3fe_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.5;
PRODUCT_NAME = ioquake3fe;
};
name = Debug;
Expand All @@ -247,39 +255,39 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ioquake3fe_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.5;
PRODUCT_NAME = ioquake3fe;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.4;
SDKROOT = "";
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = macosx10.4;
SDKROOT = "";
};
name = Release;
};
Expand Down
4 changes: 2 additions & 2 deletions misc/setup/Makefile
@@ -1,4 +1,4 @@
VERSION=1.34
VERSION=1.36
RELEASE=svn

all:
Expand All @@ -10,6 +10,6 @@ sign:
done

clean:
rm -rf *.run image
rm -rf *.run image defines.m4

.PHONY: all sign clean
7 changes: 4 additions & 3 deletions misc/setup/Solaris_pkg.sh
Expand Up @@ -37,10 +37,11 @@ DEMO_PKGFILE="${PKG_DEMO_NAME}-${BUILD_VERSION}-${PKG_VERSION}.pkg"
BUILD_DIR="${MOUNT_DIR}/build/release-${PLATFORM}-${ARCH}"
PKG_SRC_DIR="${MOUNT_DIR}/misc/setup/pkg/${PKG_SOLARIS_NAME}"
PKG_BUILD_DIR="/tmp/ioquake3-build/${PKG_SOLARIS_NAME}-${BUILD_VERSION}"
PKG_EXTRA_BUILD_DIR="/usr/local/src/quake3-data/ioquake3/quake3"
PKG_DATA_SRC_DIR="${MOUNT_DIR}/misc/setup/pkg/${PKG_DATA_NAME}"
PKG_DATA_BUILD_DIR="/usr/local/src/quake3-data/quake3"
PKG_DATA_BUILD_DIR="/usr/local/src/quake3-data/ioquake3d/quake3"
PKG_DEMO_SRC_DIR="${MOUNT_DIR}/misc/setup/pkg/${PKG_DEMO_NAME}"
PKG_DEMO_BUILD_DIR="/usr/local/src/quake3-demo/quake3"
PKG_DEMO_BUILD_DIR="/usr/local/src/quake3-data/ioquake3m/quake3"

# Tools
RM="/usr/bin/rm"
Expand Down Expand Up @@ -113,7 +114,7 @@ if [ -d ${BUILD_DIR} ]; then
fi
done

${PKGPROTO} ${PKG_BUILD_DIR}=quake3 | \
${PKGPROTO} ${PKG_BUILD_DIR}=quake3 ${PKG_EXTRA_BUILD_DIR}=quake3 | \
${NAWK} '{ print $1,$2,$3,$4 }' >> ${PKG_SRC_DIR}/prototype
${PKGMK} -o -p "${PKG_MAINT_ID}${BUILD_DATE}" \
-b ${PKG_SRC_DIR} -f ${PKG_SRC_DIR}/prototype \
Expand Down
12 changes: 9 additions & 3 deletions misc/setup/ioquake3.SlackBuild
Expand Up @@ -23,6 +23,12 @@ PKG_VERSION=$VERSION

ARCH=${ARCH:-i586}

if [ "$ARCH" = "i?86" ]; then
ARCHSUFFIX="i386"
elif [ "$ARCH" = "x86_64" ]; then
ARCHSUFFIX="64"
fi

BUILD=${BUILD:-1_io}

APP=ioquake3
Expand All @@ -46,7 +52,7 @@ mkdir -p $PKG/usr/bin
cat >> $PKG/usr/bin/ioquake3 << EOF
#!/bin/sh
cd /usr/games/$APP/
./ioquake3.i386 \$*
./ioquake3.${ARCHSUFFIX} \$*
exit \$?
EOF
chmod 754 $PKG/usr/bin/ioquake3
Expand All @@ -55,7 +61,7 @@ mkdir -p $PKG/usr/bin
cat >> $PKG/usr/bin/ioq3ded << EOF
#!/bin/sh
cd /usr/games/$APP/
./ioq3ded.i386 \$*
./ioq3ded.${ARCHSUFFIX} \$*
exit \$?
EOF
chmod 754 $PKG/usr/bin/ioq3ded
Expand All @@ -64,7 +70,7 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cat >> $PKG/install/doinst.sh << EOF
chmod 754 /usr/games/$APP/*.i386
chmod 754 /usr/games/$APP/*.${ARCHSUFFIX}
chmod 754 /usr/bin/ioquake3 /usr/bin/ioq3ded
EOF
chmod +x $PKG/install/doinst.sh
Expand Down
11 changes: 9 additions & 2 deletions misc/setup/pkg/ioq3ded.sh
Expand Up @@ -5,8 +5,15 @@

IOQ3_DIR=/usr/local/share/games/quake3

COMPILE_PLATFORM=`uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'`
COMPILE_ARCH=`uname -p | sed -e s/i.86/i386/`
if [ "x${LD_LIBRARY_PATH}" = "x" ]; then
LD_LIBRARY_PATH="${IOQ3_DIR}/lib"
else
LD_LIBRARY_PATH="${IOQ3_DIR}/lib:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

COMPILE_PLATFORM=`uname|sed -e 's/_.*//'|tr '[:upper:]' '[:lower:]'`
COMPILE_ARCH=`uname -p | sed -e 's/i.86/i386/'`

EXEC_REL=release

Expand Down
11 changes: 9 additions & 2 deletions misc/setup/pkg/ioquake3.sh
Expand Up @@ -5,8 +5,15 @@

IOQ3_DIR=/usr/local/share/games/quake3

COMPILE_PLATFORM=`uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'`
COMPILE_ARCH=`uname -p | sed -e s/i.86/i386/`
if [ "x${LD_LIBRARY_PATH}" = "x" ]; then
LD_LIBRARY_PATH="${IOQ3_DIR}/lib"
else
LD_LIBRARY_PATH="${IOQ3_DIR}/lib:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH

COMPILE_PLATFORM=`uname|sed -e 's/_.*//'|tr '[:upper:]' '[:lower:]'`
COMPILE_ARCH=`uname -p | sed -e 's/i.86/i386/'`

EXEC_REL=release

Expand Down
5 changes: 2 additions & 3 deletions misc/setup/pkg/ioquake3/depend
@@ -1,3 +1,2 @@
P SUNWxilrl XIL Runtime Environment
P SFWsdl SDL - Simple DirectMedia Layer library
P ioquake3d Icculus.Org Quake3 game data files for Solaris 10 (X11,GLX,SDL)
P SUNWxwplt X Window System platform software
P ioquake3d Icculus.Org Quake3 patch data files for Solaris 10 (X11,GLX,SDL)

0 comments on commit a5fc49b

Please sign in to comment.