1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _FS2_MULTI_DATA_RATE_HEADER_FILE
#define _FS2_MULTI_DATA_RATE_HEADER_FILE
// keep this defined to compile in rate checking
#if !defined(NDEBUG)
#define MULTI_RATE
#endif
// -----------------------------------------------------------------------------------------------------------------------
// MULTI RATE DEFINES/VARS
//
#define MAX_RATE_TYPE_LEN 50 // max length of a type string
#define MAX_RATE_PLAYERS 12 // how many player we'll keep track of
#define MAX_RATE_TYPES 32 // how many types we'll keep track of per player
// -----------------------------------------------------------------------------------------------------------------------
// MULTI RATE FUNCTIONS
//
#ifdef MULTI_RATE
// notify of a player join
void multi_rate_reset(int np_index);
// add data of the specified type to datarate processing, returns 0 on fail (if we ran out of types, etc, etc)
int multi_rate_add(int np_index, char *type, int size);
// process. call _before_ doing network operations each frame
void multi_rate_process();
// display
void multi_rate_display(int np_index, int x, int y);
#else
// stubs using #defines (c.f. NO_SOUND)
#define multi_rate_reset(np_index)
#define multi_rate_add(np_index, type, size) do { } while (0)
#define multi_rate_process()
#define multi_rate_display(np_index, x, y)
#endif
#endif // header define
|