Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
static_sort_list.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 : G *
24 * *
25 * $Archive:: $*
26 * *
27 * Creator::Scott K. Bowen - 7/15/2002 *
28 * *
29 * $Author:: $*
30 * *
31 * $Modtime:: $*
32 * *
33 * $Revision:: $*
34 * *
35 *---------------------------------------------------------------------------------------------------------------*
36 * Functions: *
37 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
38#if defined(_MSC_VER)
39#pragma once
40#endif
41
42#ifndef STATIC_SORT_LIST_H
43#define STATIC_SORT_LIST_H
44
45#include "robjlist.h"
46#include "w3d_file.h"
47
48class RenderInfoClass;
49
50// Just defines the interface for the class as used by WW3D..
52{
53 public:
55 // Construction.
57 virtual ~StaticSortListClass(void) {}
58
59 virtual void Add_To_List(RenderObjClass * robj, unsigned int sort_level) = 0;
60 virtual void Render_And_Clear(RenderInfoClass & rinfo) = 0;
61
62}; // end StaticSortListClass
63
64// The actual implementation for the standard ww3d StaticSortList.
66{
67 public:
69 // Construction.
71 virtual ~DefaultStaticSortListClass(void);
72
73 virtual void Add_To_List(RenderObjClass * robj, unsigned int sort_level);
74 virtual void Render_And_Clear(RenderInfoClass & rinfo);
75
76
77 unsigned int Get_Min_Sort(void) const {return MinSort;};
78 unsigned int Get_Max_Sort(void) const {return MaxSort;};
79
80 void Set_Min_Sort(unsigned int value) {MinSort = (value > MAX_SORT_LEVEL) ? MAX_SORT_LEVEL : value;}
81 void Set_Max_Sort(unsigned int value) {MaxSort = (value > MAX_SORT_LEVEL) ? MAX_SORT_LEVEL : value;}
82
83 private:
84 // These are for use by controlling classes to allow control of what levels
85 // to render when Render_And_Clear() is called. As for this class, the values
86 // are set to 1..MAX_SORT_LEVEL and then never changed.
87 unsigned int MinSort;
88 unsigned int MaxSort;
89
90 // An array of lists - each object in a given list has same SortLevel.
92
93}; // end StaticSortListClass
94
95
96
97
98#endif //STATIC_SORT_LIST_H
99
void const char * value
#define MAX_SORT_LEVEL
Definition w3d_file.h:1196
void Set_Max_Sort(unsigned int value)
unsigned int Get_Max_Sort(void) const
virtual void Render_And_Clear(RenderInfoClass &rinfo)
virtual void Add_To_List(RenderObjClass *robj, unsigned int sort_level)
unsigned int Get_Min_Sort(void) const
virtual ~DefaultStaticSortListClass(void)
void Set_Min_Sort(unsigned int value)
virtual ~StaticSortListClass(void)
virtual void Add_To_List(RenderObjClass *robj, unsigned int sort_level)=0
virtual void Render_And_Clear(RenderInfoClass &rinfo)=0
RefMultiListClass< RenderObjClass > RefRenderObjListClass
Definition robjlist.h:59