Skip to content

Commit

Permalink
Update to current-ish.
Browse files Browse the repository at this point in the history
  • Loading branch information
psychonic committed Aug 24, 2016
1 parent badee7a commit 737599c
Show file tree
Hide file tree
Showing 49 changed files with 1,911 additions and 2,585 deletions.
8 changes: 3 additions & 5 deletions game/shared/shareddefs.h
Expand Up @@ -153,11 +153,7 @@ class CViewVectors
// The Source engine is really designed for 32 or less players. If you raise this number above 32, you better know what you are doing
// and have a good answer for a bunch of perf question related to player simulation, thinking logic, tracelines, networking overhead, etc.
// But if you are brave or are doing something interesting, go for it... ywb 9/22/03
#if defined( CSTRIKE_DLL )
#define MAX_PLAYERS 64 // Absolute max players supported
#else
#define MAX_PLAYERS 32 // Absolute max players supported
#endif
#define MAX_PLAYERS 128 // Absolute max players supported

#define MAX_PLACE_NAME_LENGTH 18

Expand Down Expand Up @@ -695,6 +691,7 @@ struct EmitSound_t
m_SoundLevel( SNDLVL_NONE ),
m_nFlags( 0 ),
m_nPitch( PITCH_NORM ),
m_nSpecialDSP( 0 ),
m_pOrigin( 0 ),
m_flSoundTime( 0.0f ),
m_pflSoundDuration( 0 ),
Expand All @@ -715,6 +712,7 @@ struct EmitSound_t
soundlevel_t m_SoundLevel;
int m_nFlags;
int m_nPitch;
int m_nSpecialDSP;
const Vector *m_pOrigin;
float m_flSoundTime; ///< NOT DURATION, but rather, some absolute time in the future until which this sound should be delayed
float *m_pflSoundDuration;
Expand Down
File renamed without changes.
File renamed without changes.
Binary file modified lib/linux/mathlib_i486.a
Binary file not shown.
Binary file modified lib/linux/tier1_i486.a
Binary file not shown.
Binary file modified lib/public/mathlib.lib
Binary file not shown.
Binary file modified lib/public/tier1.lib
Binary file not shown.
53 changes: 39 additions & 14 deletions linux_sdk/Makefile
Expand Up @@ -3,6 +3,8 @@
#
#

OS := $(shell uname -s)

#############################################################################
# Developer configurable items
#############################################################################
Expand All @@ -24,10 +26,17 @@ SRCDS_DIR = ~/srcds/orangebox
GAME_DIR = $(SRCDS_DIR)/scratchmod

# compiler options (gcc 3.4.1 or above is required - 4.1.2+ recommended)
CC = /usr/bin/gcc-4.2
CPLUS = /usr/bin/g++-4.2
CLINK = /usr/bin/gcc-4.2
CPP_LIB = "libstdc++.a libgcc_eh.a"
#ifeq "$(OS)" "Darwin"
CC = /usr/bin/clang-3.8
CPLUS = /usr/bin/clang++-3.8
CLINK = /usr/bin/clang-3.8
CPP_LIB =
#else
#CC = /usr/bin/gcc
#CPLUS = /usr/bin/g++
#CLINK = /usr/bin/gcc
#CPP_LIB = $(SRCDS_DIR)/bin/libstdc++.so.6 $(SRCDS_DIR)/bin/libgcc_s.so.1
#endif

# put any compiler flags you want passed here
USER_CFLAGS =
Expand Down Expand Up @@ -58,21 +67,37 @@ BUILD_OBJ_DIR = $(BUILD_DIR)/obj

# the location of the source code
SRC_DIR = ..
# the location of the Linux static libraries

# the location of the static libraries
ifeq "$(OS)" "Darwin"
LIB_DIR = $(SRC_DIR)/lib/mac
else
LIB_DIR = $(SRC_DIR)/lib/linux
endif

# the CPU target for the build, must be i486 for now
ARCH = i486
ARCH_CFLAGS = -mtune=i686 -march=pentium3 -mmmx -m32

DEFINES = -D_LINUX -DLINUX -DVPROF_LEVEL=1 -DSWDS -D_finite=finite -Dstricmp=strcasecmp -D_stricmp=strcasecmp \
-D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp
ifeq "$(OS)" "Darwin"
DEFINES = -D_OSX -DOSX
SHLIBEXT = dylib
SHLIBLDFLAGS = -dynamiclib -mmacosx-version-min=10.5
SHLIBSUFFIX =
else
DEFINES = -D_LINUX -DLINUX
SHLIBEXT = so
SHLIBLDFLAGS = -shared -Wl,-Map,$@_map.txt -Wl
SHLIBSUFFIX = _srv
endif

DEFINES +=-DGNUC -D_POSIX -DPOSIX -DVPROF_LEVEL=1 -DSWDS -DNO_MALLOC_OVERRIDE -D_finite=finite -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp \
-Dstrnicmp=strncasecmp -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp
UNDEF = -Usprintf -Ustrncpy -UPROTECTED_THINGS_ENABLE

BASE_CFLAGS = -fno-strict-aliasing -Wall -Werror -Wconversion -Wno-non-virtual-dtor -Wno-invalid-offsetof
SHLIBEXT = so
BASE_CFLAGS = -fno-strict-aliasing -Wall -Wsign-compare -Werror -Wno-conversion -Wno-overloaded-virtual -Wno-non-virtual-dtor -Wno-invalid-offsetof \
-Wno-delete-non-virtual-dtor -Wno-unused-const-variable
SHLIBCFLAGS = -fPIC
SHLIBLDFLAGS = -shared -Wl,-Map,$@_map.txt -Wl

# Flags passed to the c compiler
CFLAGS = $(DEFINES) $(ARCH_CFLAGS) -O3 $(BASE_CFLAGS)
Expand All @@ -88,7 +113,7 @@ DBG_CFLAGS = "$(DEFINES) $(ARCH_CFLAGS) -g -ggdb $(BASE_CFLAGS) $(UNDEF)"
# define list passed to make for the sub makefile
BASE_DEFINES = CC=$(CC) AR=$(AR) CPLUS=$(CPLUS) CPP_LIB=$(CPP_LIB) DEBUG=$(DEBUG) \
BUILD_DIR=$(BUILD_DIR) BUILD_OBJ_DIR=$(BUILD_OBJ_DIR) SRC_DIR=$(SRC_DIR) \
LIB_DIR=$(LIB_DIR) SHLIBLDFLAGS=$(SHLIBLDFLAGS) SHLIBEXT=$(SHLIBEXT) \
LIB_DIR=$(LIB_DIR) SHLIBLDFLAGS="$(SHLIBLDFLAGS)" SHLIBEXT=$(SHLIBEXT) SHLIBSUFFIX=$(SHLIBSUFFIX) \
CLINK=$(CLINK) CFLAGS="$(CFLAGS)" DBG_CFLAGS=$(DBG_CFLAGS) LDFLAGS=$(LDFLAGS) \
DEFINES="$(DEFINES)" DBG_DEFINES=$(DBG_DEFINES) \
ARCH=$(ARCH) SRCDS_DIR=$(SRCDS_DIR) MOD_CONFIG=$(MOD_CONFIG) NAME=$(NAME) \
Expand All @@ -111,9 +136,9 @@ check:
if [ ! -e "$(LIB_DIR)/tier1_i486.a" ]; then $(MAKE) tier1;fi
if [ ! -e "$(LIB_DIR)/mathlib_i486.a" ]; then $(MAKE) mathlib;fi
if [ ! -e "$(LIB_DIR)/choreoobjects_i486.a" ]; then $(MAKE) choreo;fi
if [ ! -f "tier0_i486.so" ]; then ln -s $(SRCDS_DIR)/bin/tier0_i486.so .; fi
if [ ! -f "vstdlib_i486.so" ]; then ln -s $(SRCDS_DIR)/bin/vstdlib_i486.so .; fi
if [ ! -f "steam_api_i486.so" ]; then ln -s $(SRCDS_DIR)/bin/steam_api_i486.so .; fi
if [ ! -f "libtier0$(SHLIBSUFFIX).$(SHLIBEXT)" ]; then ln -fs $(LIB_DIR)/libtier0$(SHLIBSUFFIX).$(SHLIBEXT) .; fi
if [ ! -f "libvstdlib$(SHLIBSUFFIX).$(SHLIBEXT)" ]; then ln -fs $(LIB_DIR)/libvstdlib$(SHLIBSUFFIX).$(SHLIBEXT) .; fi
if [ ! -f "libsteam_api.$(SHLIBEXT)" ]; then ln -fs $(LIB_DIR)/libsteam_api.$(SHLIBEXT) .; fi

vcpm: check
if [ ! -e "vcpm" ]; then $(MAKE) -f $(MAKE_VCPM) $(BASE_DEFINES);fi
Expand Down
1 change: 0 additions & 1 deletion linux_sdk/Makefile.mathlib
Expand Up @@ -30,7 +30,6 @@ DO_CC += -o $@ -c $<
#####################################################################

LIB_OBJS= \
$(LIB_OBJ_DIR)/3dnow.o \
$(LIB_OBJ_DIR)/anorms.o \
$(LIB_OBJ_DIR)/bumpvects.o \
$(LIB_OBJ_DIR)/color_conversion.o \
Expand Down
1 change: 0 additions & 1 deletion linux_sdk/Makefile.tier1
Expand Up @@ -42,7 +42,6 @@ LIB_OBJS= \
$(LIB_OBJ_DIR)/interface.o \
$(LIB_OBJ_DIR)/KeyValues.o \
$(LIB_OBJ_DIR)/mempool.o \
$(LIB_OBJ_DIR)/memstack.o \
$(LIB_OBJ_DIR)/NetAdr.o \
$(LIB_OBJ_DIR)/newbitbuf.o \
$(LIB_OBJ_DIR)/processor_detect.o \
Expand Down
193 changes: 0 additions & 193 deletions mathlib/3dnow.cpp

This file was deleted.

16 changes: 0 additions & 16 deletions mathlib/3dnow.h

This file was deleted.

1 change: 1 addition & 0 deletions mathlib/imagequant.cpp
Expand Up @@ -6,6 +6,7 @@
//
//=============================================================================//
#include <quantize.h>
#include <tier0/basetypes.h>

#define N_EXTRAVALUES 1
#define N_DIMENSIONS (3+N_EXTRAVALUES)
Expand Down
22 changes: 22 additions & 0 deletions mathlib/mathlib-2005.sln
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mathlib", "mathlib-2005.vcxproj", "{884C66F2-7F84-4570-AE6C-B634C1113D69}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{884C66F2-7F84-4570-AE6C-B634C1113D69}.Debug|x86.ActiveCfg = Debug|Win32
{884C66F2-7F84-4570-AE6C-B634C1113D69}.Debug|x86.Build.0 = Debug|Win32
{884C66F2-7F84-4570-AE6C-B634C1113D69}.Release|x86.ActiveCfg = Release|Win32
{884C66F2-7F84-4570-AE6C-B634C1113D69}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

3 comments on commit 737599c

@jordanbriere
Copy link

@jordanbriere jordanbriere commented on 737599c Aug 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!! We had to update ../game/shared/collisionproperty.h to fix some errors with our CBaseEntity wrapper and now we are getting the following:

1>mathlib.lib(mathlib_base.obj) : error LNK2019: unresolved external symbol ___vdecl_sin2 referenced in function "void __cdecl InitSinCosTable(void)" (?InitSinCosTable@@YAXXZ)
1>mathlib.lib(color_conversion.obj) : error LNK2019: unresolved external symbol ___vdecl_pow2 referenced in function "void __cdecl BuildGammaTable(float,float,float,int)" (?BuildGammaTable@@YAXMMMH@Z)
1>mathlib.lib(color_conversion.obj) : error LNK2019: unresolved external symbol ___vdecl_powf4 referenced in function "void __cdecl BuildGammaTable(float,float,float,int)" (?BuildGammaTable@@YAXMMMH@Z)

I assume mathlib.lib need to be recompiled with updated ../public/mathlib/color_convention.cpp and ../public/mathlib/mathlib_base.cpp files.

Thanks again!

EDIT: Using mathlib.lib from the css branch is compiling fine.

@psychonic
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated collisionproperty.h

I'll try to find some time to look at mathlib tomorrow. I'm not sure what's wrong with it. The only change from the headers/source for it from the css branch are some fixes in sse.cpp from the sdk2013 branch that I needed to fix the build on the compiler version I started with. (Clang 3.9, then later changed to 3.8 rather than fix some new errors found).

@jordanbriere
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you very much! 😃

Please sign in to comment.