diff --git a/common/xash3d_types.h b/common/xash3d_types.h index ac86cdea..6564cf93 100644 --- a/common/xash3d_types.h +++ b/common/xash3d_types.h @@ -145,7 +145,9 @@ typedef void (*setpair_t)( const char *key, const void *value, void *buffer, voi #define MAX_QPATH 64 // max length of a game pathname #if XASH_LOW_MEMORY == 2 -#define MAX_QPATH 32 +#define MAX_QPATH 32 // should be enough for singleplayer +#elif XASH_LOW_MEMORY == 1 +#define MAX_QPATH 48 #endif #define MAX_OSPATH 260 // max length of a filesystem pathname #define CS_SIZE 64 // size of one config string diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 5fed0b8c..e70c6708 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -2754,8 +2754,11 @@ void CL_LegacyUpdateUserinfo( sizebuf_t *msg ) } else memset( player, 0, sizeof( *player )); } +#define MAX_LEGACY_RESOURCES 2048 #if XASH_LOW_MEMORY == 2 -#define MAX_RESOURCES 64 +#define MAX_LEGACY_RESOURCES 1 +#elif XASH_LOW_MEMORY == 1 +#define MAX_LEGACY_RESOURCES 512 #endif /* ============== @@ -2770,13 +2773,16 @@ void CL_LegacyParseResourceList( sizebuf_t *msg ) static struct { int rescount; - int restype[MAX_RESOURCES]; - char resnames[MAX_RESOURCES][MAX_QPATH]; + int restype[MAX_LEGACY_RESOURCES]; + char resnames[MAX_LEGACY_RESOURCES][MAX_QPATH]; } reslist; memset( &reslist, 0, sizeof( reslist )); reslist.rescount = MSG_ReadWord( msg ) - 1; + if( reslist.rescount > MAX_LEGACY_RESOURCES ) + Host_Error("MAX_RESOURCES reached\n"); + for( i = 0; i < reslist.rescount; i++ ) { reslist.restype[i] = MSG_ReadWord( msg ); diff --git a/engine/common/common.h b/engine/common/common.h index c5f9d46b..0d3b1ce2 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -144,6 +144,8 @@ typedef enum #if XASH_LOW_MEMORY == 2 #define MAX_DECALS 256 // touching TE_DECAL messages, etc #define MAX_STATIC_ENTITIES 32 // static entities that moved on the client when level is spawn +#elif XASH_LOW_MEMORY == 1 +#define MAX_STATIC_ENTITIES 128 // static entities that moved on the client when level is spawn #endif // filesystem flags diff --git a/engine/common/net_ws.h b/engine/common/net_ws.h index c7b1ac09..1b4c6671 100644 --- a/engine/common/net_ws.h +++ b/engine/common/net_ws.h @@ -30,7 +30,7 @@ typedef enum #define MAX_MULTICAST 8192 // some mods spamming for rain effect #define MAX_INIT_MSG 0x20000 // max length of possible message -#if XASH_LOW_MEMORY == 2 +#if XASH_LOW_MEMORY #define MAX_INIT_MSG 0x8000 #endif // net packets type diff --git a/engine/common/netchan.h b/engine/common/netchan.h index d6c11775..23ff2f7c 100644 --- a/engine/common/netchan.h +++ b/engine/common/netchan.h @@ -94,6 +94,11 @@ GNU General Public License for more details. #define NUM_PACKET_ENTITIES 32 #define MAX_CUSTOM_BASELINES 8 #define NET_MAX_FRAGMENT 32768 +#elif XASH_LOW_MEMORY == 1 +#define SINGLEPLAYER_BACKUP 4 +#define NUM_PACKET_ENTITIES 64 +#define MAX_CUSTOM_BASELINES 8 +#define NET_MAX_FRAGMENT 32768 #endif typedef struct netsplit_chain_packet_s diff --git a/engine/common/protocol.h b/engine/common/protocol.h index 404fabbb..8727c6e5 100644 --- a/engine/common/protocol.h +++ b/engine/common/protocol.h @@ -183,7 +183,7 @@ GNU General Public License for more details. #define FRAGMENT_LOCAL_SIZE FRAGMENT_MAX_SIZE // local connection #if XASH_LOW_MEMORY == 2 -// memory reduced protocol, not for use in multiplayer +// memory reduced protocol, not for use in multiplayer (but still compatible) #define MAX_VISIBLE_PACKET 128 #define MAX_VISIBLE_PACKET_VIS_BYTES ((MAX_VISIBLE_PACKET + 7) / 8) @@ -194,16 +194,28 @@ GNU General Public License for more details. #define MAX_MODELS 512 -#define MAX_SOUNDS 512 // do not change MAX_SOUND_BITS -#define MAX_SOUNDS_NONSENTENCE 2048 - +#define MAX_SOUNDS 512 #define MAX_CUSTOM 32 #define MAX_DLIGHTS 16 // dynamic lights (rendered per one frame) #define MAX_ELIGHTS 32 // entity only point lights #define MAX_RENDER_DECALS 64 // max rendering decals per a level +#define MAX_RESOURCES 1024 +#elif XASH_LOW_MEMORY == 1 +#define MAX_VISIBLE_PACKET 256 +#define MAX_VISIBLE_PACKET_VIS_BYTES ((MAX_VISIBLE_PACKET + 7) / 8) + +#define MAX_EVENTS 128 + +#define MAX_SUPPORTED_MODELS 1024 + +#define MAX_MODELS 1024 + +#define MAX_CUSTOM 512 + #define MAX_RESOURCES 1024 #endif + // Quake1 Protocol #define PROTOCOL_VERSION_QUAKE 15