Renamed MAX_CHANNELS to MAX_SKELETOR_CHANNELS to avoid conflict with sound channels (MAX_CHANNELS)

This commit is contained in:
smallmodel 2023-08-16 20:51:19 +02:00
parent 42ad1cb41c
commit 0347a5ca0b
No known key found for this signature in database
GPG key ID: A96F163ED4891440
3 changed files with 15 additions and 18 deletions

View file

@ -330,18 +330,18 @@ int ChannelNameTable::RegisterChannel( const char *name )
return m_Channels[ index ].channelNum;
}
if( m_iNumChannels >= MAX_CHANNELS )
if( m_iNumChannels >= MAX_SKELETOR_CHANNELS)
{
Com_Printf( "==========================================================================\n" );
Com_Printf( "Skeletor channel name table, contents (in order of addition):\n" );
for( index = 0; index < MAX_CHANNELS; index++ )
for( index = 0; index < MAX_SKELETOR_CHANNELS; index++ )
{
Com_Printf( "%s\n", m_Channels[ m_lookup [ index ] ].name );
}
Com_Printf( "==========================================================================\n" );
SKEL_Error( "Channel name table already has %i channels, can't add any more.", MAX_CHANNELS );
SKEL_Error( "Channel name table already has %i channels, can't add any more.", MAX_SKELETOR_CHANNELS );
return -1;
}
else

View file

@ -22,11 +22,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// skeletor_name_lists.h : Skeletor name lists
#ifndef __SKELETOR_NAME_LISTS_FORMAT_H__
#define __SKELETOR_NAME_LISTS_FORMAT_H__
#pragma once
#define MAX_CHANNELS 16384
#define MAX_CHANNEL_NAME 32
#define MAX_SKELETOR_CHANNELS 16384
#define MAX_CHANNEL_NAME 32
typedef struct ChannelName_s {
char name[ MAX_CHANNEL_NAME ];
@ -37,8 +36,8 @@ typedef struct ChannelName_s {
class ChannelNameTable {
short int m_iNumChannels;
ChannelName_t m_Channels[ MAX_CHANNELS ];
short int m_lookup[ MAX_CHANNELS ];
ChannelName_t m_Channels[MAX_SKELETOR_CHANNELS];
short int m_lookup[MAX_SKELETOR_CHANNELS];
public:
ChannelNameTable();
@ -63,10 +62,8 @@ int GetChannelTypeFromName( const char *name );
typedef struct {
short int m_iNumChannels;
ChannelName_t m_Channels[ MAX_CHANNELS ];
short int m_lookup[ MAX_CHANNELS ];
ChannelName_t m_Channels[MAX_SKELETOR_CHANNELS];
short int m_lookup[MAX_SKELETOR_CHANNELS];
} ChannelNameTable;
#endif
#endif // __SKELETOR_NAME_LISTS_FORMAT_H__

View file

@ -93,10 +93,10 @@ void skelChannelList_s::ZeroChannels()
int i;
m_numChannels = 0;
m_chanLocalFromGlobal = ( short * )Skel_Alloc( MAX_CHANNELS * sizeof( short ) );
m_numLocalFromGlobal = MAX_CHANNELS;
m_chanLocalFromGlobal = ( short * )Skel_Alloc( MAX_SKELETOR_CHANNELS * sizeof( short ) );
m_numLocalFromGlobal = MAX_SKELETOR_CHANNELS;
for( i = 0; i < MAX_CHANNELS; i++ )
for( i = 0; i < MAX_SKELETOR_CHANNELS; i++ )
{
m_chanLocalFromGlobal[ i ] = -1;
}
@ -104,7 +104,7 @@ void skelChannelList_s::ZeroChannels()
void skelChannelList_s::PackChannels()
{
m_numLocalFromGlobal = MAX_CHANNELS - 1;
m_numLocalFromGlobal = MAX_SKELETOR_CHANNELS - 1;
if( m_chanLocalFromGlobal[ m_numLocalFromGlobal ] == -1 )
{
@ -114,7 +114,7 @@ void skelChannelList_s::PackChannels()
} while( m_chanLocalFromGlobal[ m_numLocalFromGlobal ] == -1 && m_numLocalFromGlobal >= 0 );
}
if( m_numLocalFromGlobal < MAX_CHANNELS )
if( m_numLocalFromGlobal < MAX_SKELETOR_CHANNELS )
{
m_numLocalFromGlobal++;
}