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