Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
linegrp.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 : Lingegroup.h *
24 * *
25 * $Archive:: $*
26 * *
27 * Original Author:: Hector Yee *
28 * *
29 * $Author:: $*
30 * *
31 * $Modtime:: $*
32 * *
33 * $Revision:: $*
34 * *
35 *---------------------------------------------------------------------------------------------*
36 * Functions: *
37 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
38
39#if defined(_MSC_VER)
40#pragma once
41#endif
42
43#ifndef LINEGRP_H
44#define LINEGRP_H
45
46#include "shader.h"
47#include "vector4.h"
48#include "vector3.h"
49#include "vector2.h"
50
51class RenderInfoClass;
52class TextureClass;
53
54template <class T> class ShareBufferClass;
55
56/*
57** LineGroupClass -- a custom object for rendering
58** groups of lines (such as motion blurred particle systems).
59*/
61{
62public:
63
64 enum FlagsType {
65 TRANSFORM, // transform points w. modelview matrix (worldspace points)
66 };
67
72
73 LineGroupClass(void);
74 virtual ~LineGroupClass(void);
75
76 // LineGroupClass interface:
77 void Set_Arrays(
81 ShareBufferClass<Vector4> *taildiffuse = NULL,
85 int active_line_count = -1
86 );
87 void Set_Line_Size(float size);
88 float Get_Line_Size(void);
89 void Set_Line_Color(const Vector3 &color);
91 void Set_Tail_Diffuse(const Vector4 &tdiffuse);
93 void Set_Line_Alpha(float alpha);
94 float Get_Line_Alpha(void);
95 void Set_Line_UCoord(float ucoord);
96 float Get_Line_UCoord(void);
97 void Set_Flag(FlagsType flag, bool on);
99 void Set_Texture(TextureClass* texture);
102 void Set_Shader(const ShaderClass &shader);
104 void Set_Line_Mode(LineModeType linemode);
106 int Get_Polygon_Count(void);
107
108 void Render(RenderInfoClass &rinfo);
109
110protected:
111
112 ShareBufferClass<Vector3> * StartLineLoc; // World/cameraspace point locs
113 ShareBufferClass<Vector3> * EndLineLoc; // World/cameraspace point locs
114 ShareBufferClass<Vector4> * LineDiffuse; // (NULL if not used) RGBA values
115 ShareBufferClass<Vector4> * TailDiffuse; // (NULL if not used) RGBA values
116 ShareBufferClass<unsigned int> * ALT; // (NULL if not used) active line table
117 ShareBufferClass<float> * LineSize; // (NULL if not used) size override table
118 ShareBufferClass<float> * LineUCoord; // (NULL if not used) U coordinates
119 int LineCount; // Active (if ALT) or total point count
120
122 ShaderClass Shader; // (default created in CTor)
123
124 // Internal state:
125 unsigned int Flags; // operation control flags
126 float DefaultLineSize; // Line size (size array overrides if present)
127 Vector3 DefaultLineColor; // Line color (color array overrides if present)
128 float DefaultLineAlpha; // Line alpha (alpha array overrides if present)
129 float DefaultLineUCoord; // Line texture Ucoord (ucoord array overrides if present)
130 Vector4 DefaultTailDiffuse; // Tail diffuse RGBA
132};
133
134#endif
#define NULL
Definition BaseType.h:92
UnicodeString alt
void Set_Texture(TextureClass *texture)
Definition linegrp.cpp:193
float DefaultLineSize
Definition linegrp.h:126
TextureClass * Peek_Texture(void)
Definition linegrp.cpp:204
void Set_Shader(const ShaderClass &shader)
Definition linegrp.cpp:209
Vector4 DefaultTailDiffuse
Definition linegrp.h:130
TextureClass * Get_Texture(void)
Definition linegrp.cpp:198
ShaderClass Shader
Definition linegrp.h:122
ShareBufferClass< float > * LineUCoord
Definition linegrp.h:118
void Set_Line_Color(const Vector3 &color)
Definition linegrp.cpp:141
float Get_Line_UCoord(void)
Definition linegrp.cpp:176
ShareBufferClass< Vector4 > * LineDiffuse
Definition linegrp.h:114
LineGroupClass(void)
Definition linegrp.cpp:59
float Get_Line_Alpha(void)
Definition linegrp.cpp:166
virtual ~LineGroupClass(void)
Definition linegrp.cpp:80
int Get_Flag(FlagsType flag)
Definition linegrp.cpp:188
void Render(RenderInfoClass &rinfo)
Definition linegrp.cpp:229
void Set_Line_Mode(LineModeType linemode)
Definition linegrp.cpp:219
ShareBufferClass< Vector3 > * StartLineLoc
Definition linegrp.h:112
Vector4 Get_Tail_Diffuse(void)
Definition linegrp.cpp:156
void Set_Line_UCoord(float ucoord)
Definition linegrp.cpp:171
ShareBufferClass< unsigned int > * ALT
Definition linegrp.h:116
void Set_Line_Alpha(float alpha)
Definition linegrp.cpp:161
void Set_Line_Size(float size)
Definition linegrp.cpp:131
Vector3 DefaultLineColor
Definition linegrp.h:127
float DefaultLineAlpha
Definition linegrp.h:128
Vector3 Get_Line_Color(void)
Definition linegrp.cpp:146
ShareBufferClass< Vector4 > * TailDiffuse
Definition linegrp.h:115
ShareBufferClass< float > * LineSize
Definition linegrp.h:117
ShaderClass Get_Shader(void)
Definition linegrp.cpp:214
ShareBufferClass< Vector3 > * EndLineLoc
Definition linegrp.h:113
TextureClass * Texture
Definition linegrp.h:121
LineModeType LineMode
Definition linegrp.h:131
void Set_Flag(FlagsType flag, bool on)
Definition linegrp.cpp:181
LineModeType Get_Line_Mode(void)
Definition linegrp.cpp:224
float Get_Line_Size(void)
Definition linegrp.cpp:136
void Set_Tail_Diffuse(const Vector4 &tdiffuse)
Definition linegrp.cpp:151
void Set_Arrays(ShareBufferClass< Vector3 > *startlocs, ShareBufferClass< Vector3 > *endlocs, ShareBufferClass< Vector4 > *diffuse=NULL, ShareBufferClass< Vector4 > *taildiffuse=NULL, ShareBufferClass< unsigned int > *alt=NULL, ShareBufferClass< float > *sizes=NULL, ShareBufferClass< float > *ucoords=NULL, int active_line_count=-1)
Definition linegrp.cpp:92
unsigned int Flags
Definition linegrp.h:125
int Get_Polygon_Count(void)
Definition linegrp.cpp:486
float DefaultLineUCoord
Definition linegrp.h:129
unsigned char flag
Definition vchannel.cpp:273