Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
bwrender.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 : ww3d2 *
24 * *
25 * $Archive:: /Commando/Code/ww3d2/bwrender.h $*
26 * *
27 * Original Author:: Jani Penttinen *
28 * *
29 * $Author:: Greg_h $*
30 * *
31 * $Modtime:: 4/04/01 10:36a $*
32 * *
33 * $Revision:: 2 $*
34 * *
35 *---------------------------------------------------------------------------------------------*
36 * Functions: *
37 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
38
39#if defined(_MSC_VER)
40#pragma once
41#endif
42
43#ifndef BWRENDER_H
44#define BWRENDER_H
45
46
47#include "always.h"
48#include "vector2.h"
49#include "vector3.h"
50#include "vector3i.h"
51
62{
63 // Internal pixel buffer used by the triangle renderer
64 // The buffer is not allocated or freed by this class.
65 class Buffer
66 {
67 unsigned char* buffer;
68 int scale;
69 int minv;
70 int maxv;
71 public:
72 Buffer(unsigned char* buffer, int scale);
73 ~Buffer();
74
75 void Set_H_Line(int start_x, int end_x, int y);
76 void Fill(unsigned char c);
77 inline int Scale() const { return scale; }
78 } pixel_buffer;
79
80 Vector2* vertices;
81
82 void Render_Preprocessed_Triangle(Vector3& xcf,Vector3i& yci);
83
84public:
85 BWRenderClass(unsigned char* buffer, int scale);
87
88 void Fill(unsigned char c);
89 void Set_Vertex_Locations(Vector2* vertices,int count); // Warning! Contents are modified!
90 void Render_Triangles(const unsigned long* indices,int index_count);
91 void Render_Triangle_Strip(const unsigned long* indices,int index_count);
92};
93
94
95#endif //BWRENDER_H
96
Color scale(const Color &a, const Color &b)
Definition GameMtl.cpp:722
void Set_Vertex_Locations(Vector2 *vertices, int count)
Definition bwrender.cpp:104
void Render_Triangle_Strip(const unsigned long *indices, int index_count)
Definition bwrender.cpp:132
void Render_Triangles(const unsigned long *indices, int index_count)
Definition bwrender.cpp:162
BWRenderClass(unsigned char *buffer, int scale)
Definition bwrender.cpp:88
void Fill(unsigned char c)
Definition bwrender.cpp:98