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//
53const int DEF_CLASSID_START = 0x00001000;
54const 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//
69enum
70{
86};
87
88
90//
91// SuperClassID_From_ClassID
92//
94inline uint32
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
unsigned long uint32
Definition bittype.h:46
#define NEXT_SUPER_CLASSID(n)
const int DEF_CLASSID_RANGE
@ CLASSID_DUMMY_OBJECTS
@ CLASSID_PHYSICS
@ CLASSID_GLOBAL_SETTINGS
@ CLASSID_TERRAIN
@ CLASSID_LIGHT
@ CLASSID_TILE
@ CLASSID_ZONE
@ CLASSID_MUNITIONS
@ CLASSID_SOUND
@ CLASSID_TWIDDLERS
@ CLASSID_BUILDINGS
@ CLASSID_TRANSITION
@ CLASSID_EDITOR_OBJECTS
@ CLASSID_WAYPATH
@ CLASSID_GAME_OBJECTS
const int DEF_CLASSID_START
uint32 SuperClassID_From_ClassID(uint32 class_id)