Richard Boegli's CnC_Generals_Zero_Hour Fork
WIP
This is documentation of Richard Boegil's Zero Hour Fork
Loading...
Searching...
No Matches
definitionclassids.h
Go to the documentation of this file.
1
/*
2
** Command & Conquer Generals Zero Hour(tm)
3
** Copyright 2025 Electronic Arts Inc.
4
**
5
** This program is free software: you can redistribute it and/or modify
6
** it under the terms of the GNU General Public License as published by
7
** the Free Software Foundation, either version 3 of the License, or
8
** (at your option) any later version.
9
**
10
** This program is distributed in the hope that it will be useful,
11
** but WITHOUT ANY WARRANTY; without even the implied warranty of
12
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
** GNU General Public License for more details.
14
**
15
** You should have received a copy of the GNU General Public License
16
** along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
/***********************************************************************************************
20
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
21
***********************************************************************************************
22
* *
23
* Project Name : WWSaveLoad *
24
* *
25
* $Archive:: /Commando/Code/wwsaveload/definitionclassids.h $*
26
* *
27
* Author:: Patrick Smith *
28
* *
29
* $Modtime:: 8/03/00 5:44p $*
30
* *
31
* $Revision:: 15 $*
32
* *
33
*---------------------------------------------------------------------------------------------*
34
* Functions: *
35
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
37
38
#if defined(_MSC_VER)
39
#pragma once
40
#endif
41
42
#ifndef __DEFINITION_CLASS_ID_H
43
#define __DEFINITION_CLASS_ID_H
44
45
#include "always.h"
46
#include "bittype.h"
47
49
//
50
// Constants
51
//
53
const
int
DEF_CLASSID_START
= 0x00001000;
54
const
int
DEF_CLASSID_RANGE
= 0x00001000;
55
#define NEXT_SUPER_CLASSID(n) DEF_CLASSID_START + (n * DEF_CLASSID_RANGE)
56
57
59
//
60
// DefinitionClassID
61
//
62
// Note: The following enum should contain ALL of the class ids for
63
// definitions in the entire system (to guarantee they are unique). Each
64
// super-class is allocated a range of class ids. Use the
65
// SuperClassID_From_ClassID function to determine which super class
66
// a particular class id belongs to.
67
//
69
enum
70
{
71
CLASSID_TERRAIN
=
NEXT_SUPER_CLASSID
(0),
72
CLASSID_TILE
=
NEXT_SUPER_CLASSID
(1),
73
CLASSID_GAME_OBJECTS
=
NEXT_SUPER_CLASSID
(2),
74
CLASSID_LIGHT
=
NEXT_SUPER_CLASSID
(3),
75
CLASSID_SOUND
=
NEXT_SUPER_CLASSID
(4),
76
CLASSID_WAYPATH
=
NEXT_SUPER_CLASSID
(5),
77
CLASSID_ZONE
=
NEXT_SUPER_CLASSID
(6),
78
CLASSID_TRANSITION
=
NEXT_SUPER_CLASSID
(7),
79
CLASSID_PHYSICS
=
NEXT_SUPER_CLASSID
(8),
80
CLASSID_EDITOR_OBJECTS
=
NEXT_SUPER_CLASSID
(9),
81
CLASSID_MUNITIONS
=
NEXT_SUPER_CLASSID
(10),
82
CLASSID_DUMMY_OBJECTS
=
NEXT_SUPER_CLASSID
(11),
83
CLASSID_BUILDINGS
=
NEXT_SUPER_CLASSID
(12),
84
CLASSID_TWIDDLERS
=
NEXT_SUPER_CLASSID
(13),
85
CLASSID_GLOBAL_SETTINGS
=
NEXT_SUPER_CLASSID
(14),
86
};
87
88
90
//
91
// SuperClassID_From_ClassID
92
//
94
inline
uint32
95
SuperClassID_From_ClassID
(
uint32
class_id)
96
{
97
//
98
// Which id-range does it fall under?
99
//
100
int
delta = class_id -
DEF_CLASSID_START
;
101
int
num_ranges = delta /
DEF_CLASSID_RANGE
;
102
103
return
DEF_CLASSID_START
+ (num_ranges *
DEF_CLASSID_RANGE
);
104
}
105
106
107
#endif
//__DEFINITION_CLASS_ID_H
108
uint32
unsigned long uint32
Definition
bittype.h:46
NEXT_SUPER_CLASSID
#define NEXT_SUPER_CLASSID(n)
Definition
definitionclassids.h:55
DEF_CLASSID_RANGE
const int DEF_CLASSID_RANGE
Definition
definitionclassids.h:54
CLASSID_DUMMY_OBJECTS
@ CLASSID_DUMMY_OBJECTS
Definition
definitionclassids.h:82
CLASSID_PHYSICS
@ CLASSID_PHYSICS
Definition
definitionclassids.h:79
CLASSID_GLOBAL_SETTINGS
@ CLASSID_GLOBAL_SETTINGS
Definition
definitionclassids.h:85
CLASSID_TERRAIN
@ CLASSID_TERRAIN
Definition
definitionclassids.h:71
CLASSID_LIGHT
@ CLASSID_LIGHT
Definition
definitionclassids.h:74
CLASSID_TILE
@ CLASSID_TILE
Definition
definitionclassids.h:72
CLASSID_ZONE
@ CLASSID_ZONE
Definition
definitionclassids.h:77
CLASSID_MUNITIONS
@ CLASSID_MUNITIONS
Definition
definitionclassids.h:81
CLASSID_SOUND
@ CLASSID_SOUND
Definition
definitionclassids.h:75
CLASSID_TWIDDLERS
@ CLASSID_TWIDDLERS
Definition
definitionclassids.h:84
CLASSID_BUILDINGS
@ CLASSID_BUILDINGS
Definition
definitionclassids.h:83
CLASSID_TRANSITION
@ CLASSID_TRANSITION
Definition
definitionclassids.h:78
CLASSID_EDITOR_OBJECTS
@ CLASSID_EDITOR_OBJECTS
Definition
definitionclassids.h:80
CLASSID_WAYPATH
@ CLASSID_WAYPATH
Definition
definitionclassids.h:76
CLASSID_GAME_OBJECTS
@ CLASSID_GAME_OBJECTS
Definition
definitionclassids.h:73
DEF_CLASSID_START
const int DEF_CLASSID_START
Definition
definitionclassids.h:53
SuperClassID_From_ClassID
uint32 SuperClassID_From_ClassID(uint32 class_id)
Definition
definitionclassids.h:95
Code
Libraries
Source
WWVegas
WWSaveLoad
definitionclassids.h
Generated by
1.13.2