coastline 0.0.4
Loading...
Searching...
No Matches
displaylist.h
Go to the documentation of this file.
1#pragma once
2
8
9#include <array>
10
11#include <windows.h>
12
14#include "common/gbicommand.h"
16#include "common/vecmath.h"
17
18#if TGR_BRD3D
19#include <d3d.h>
20#else
21#include <glide.h>
22#endif
23
25#define GBI_DISPLAY_LIST_STACK_SIZE 10
26
28#define GBI_MATRIX_STACK_RESET_DEPTH 10
29
36extern float g_fTexRectScaleW;
37
44extern float g_fTexRectDepth;
45
52extern unsigned g_dwGbiCombineModeHi;
53
60extern unsigned g_dwGbiCombineModeLo;
61
68extern unsigned g_dwGbiGeometryMode;
69
76extern unsigned g_dwGbiPrevGeometryMode;
77
85
93
101
102#ifdef __cplusplus
103extern "C" {
104#endif
105
116void SelectVertexSubmitterForCombineMode(unsigned dwCombineHi, unsigned dwCombineLo);
117
126
136
146
156
166
176
186
197
207
214extern unsigned g_dwGbiRenderMode;
215
223void ApplyRdpRenderMode(unsigned dwRenderMode);
224
234
245
256void DrawFillRectangle(int nLeft, int nTop, int nRight, int nBottom);
257
269
281
288extern unsigned char g_bGbiFillColorR;
289
296extern unsigned char g_bGbiFillColorG;
297
304extern unsigned char g_bGbiFillColorB;
305
312extern unsigned char g_bGbiFillColorA;
313
323
330extern float g_fGbiEnvColorR;
331
338extern float g_fGbiEnvColorG;
339
346extern float g_fGbiEnvColorB;
347
354extern float g_fGbiEnvColorA;
355
362extern float g_fGbiPrimColorR;
363
370extern float g_fGbiPrimColorG;
371
378extern float g_fGbiPrimColorB;
379
386extern float g_fGbiPrimColorA;
387
397
410 int nUpperLeftX, int nUpperLeftY, int nLowerRightX, int nLowerRightY, int nTile);
411
423
435
442extern float g_fViewportScaleX;
443
450extern float g_fViewportScaleY;
451
458extern float g_fViewportTranslateX;
459
466extern float g_fViewportTranslateY;
467
478#ifdef __cplusplus
479}
480#endif
481
484
486#define GBI_LIGHT_COUNT 8
487
488#ifdef __cplusplus
489extern "C" {
490#endif
491
499
507#ifdef __cplusplus
508}
509#endif
510
517extern int g_dwGbiNumLights;
518
526
533extern int g_bGbiLightsTransformed;
534
535#ifdef __cplusplus
536extern "C" {
537#endif
538
548
555extern float g_GbiMvpMatrix[4][4];
556
563extern float g_GbiProjectionMatrix[4][4];
564
572
579extern const Light *g_pGbiLookAtY;
580
587extern const Light *g_pGbiLookAtX;
588
598
610
617extern int g_dwTileSizeUls;
618
625extern int g_dwTileSizeUlt;
626
633extern int g_dwTileSizeLrs;
634
641extern int g_dwTileSizeLrt;
642
649extern int g_dwTileSizeWidth;
650
657extern int g_dwTileSizeHeight;
658
669
676extern void (*g_pfnUploadTextureEntryToSurface)(int nEntry, TextureUploadData payload);
677
687#ifdef __cplusplus
688}
689#endif
690
693
697 float fX;
698 float fY;
699 float fZ;
700 float fS;
701 float fT;
702 float fW;
703 float fRed;
704 float fGreen;
705 float fBlue;
706};
707
708#if TGR_BRD3D
710struct GbiVertex {
711 float fX;
712 float fY;
713 float fZ;
714 float fRed;
715 float fGreen;
716 float fBlue;
718 char abUnknown18[8]; /* +0x18 */
720 float fRhw;
721 float fU;
722 float fV;
724 char abUnknown2C[0x10]; /* +0x2C */
726 int nClipFlags;
728 int nRenderBufferIndex;
729};
730#else
737#endif /* TGR_BRD3D */
738
745extern float g_fGbiLight0ColorR;
752extern float g_fGbiLight0ColorG;
759extern float g_fGbiLight0ColorB;
773extern float g_fGbiAmbientColorR;
780extern float g_fGbiAmbientColorG;
787extern float g_fGbiAmbientColorB;
788
789#ifdef __cplusplus
790extern "C" {
791#endif
792
800
801#if TGR_BRD3D
807extern float g_fDepthScale;
813extern float g_fDepthOffset;
814#endif /* TGR_BRD3D */
815
824
825#if TGR_BRD3D
837 GbiVertex *pDest, const GbiVertexSource *pSource, float fRed, float fGreen, float fBlue);
838#else
851 GrVertex *pDest, const GbiVertexSource *pSource, float fRed, float fGreen, float fBlue);
852#endif /* TGR_BRD3D */
853
855#define GBI_VERTEX_CACHE_SIZE 128
856
858#define GBI_CLIP_VERTEX_POOL_SIZE 64
859
867
875
883LerpVertexFromPool(const GbiVertexSource *pFirst, const GbiVertexSource *pSecond, float fFraction);
884
890
940
948extern int g_bRdpBlendStateOverride;
949
957
958#if TGR_BRD3D
960#define RENDER_BUFFER_SIZE 512
961
967extern GbiVertex *g_apVertexPool[GBI_VERTEX_CACHE_SIZE];
968
974extern int g_nVertexPoolCount;
975
981extern D3DTLVERTEX g_renderBuffer[RENDER_BUFFER_SIZE];
982
988extern int g_nRenderBufferIndex;
989
995extern WORD g_awRenderIndexBuffer[RENDER_BUFFER_SIZE];
996
1002extern int g_nRenderIndexCount;
1003
1010void ResetRenderBufferAndVertexPool(void);
1011
1017extern float g_fVertexFogRange;
1018
1024extern int g_dwFogAlphaCutoff;
1025
1031void UpdateD3DFogRenderState(void);
1032
1041int SubmitVertexToRenderBuffer(GbiVertex *pVertex);
1042
1051int SubmitVertexToRenderBufferEx(GbiVertex *pVertex);
1052
1061int SubmitVertexToRenderBufferConstColor(GbiVertex *pVertex);
1062
1071int SubmitVertexToRenderBufferFogged(GbiVertex *pVertex);
1072
1078extern int (*g_pfnSubmitVertexToRenderBuffer)(GbiVertex *pVertex);
1079#endif /* TGR_BRD3D */
1080
1087extern float g_fTexCoordScaleS;
1088
1095extern float g_fTexCoordScaleT;
1096
1097#if TGR_BRD3D
1105void ScaleVertexTexCoords(GbiVertex *pVertex, const GbiVertexSource *pSource);
1106#else
1115void ScaleVertexTexCoords(GrVertex *pVertex, const GbiVertexSource *pSource);
1116#endif /* TGR_BRD3D */
1117
1127void ClipAndSubmitTriangle(GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2);
1128
1142 GbiVertex *pVertex1,
1143 GbiVertex *pVertex2,
1144 float fRed,
1145 float fGreen,
1146 float fBlue);
1147
1161 GbiVertex *pVertex1,
1162 GbiVertex *pVertex2,
1163 float fRed,
1164 float fGreen,
1165 float fBlue);
1166
1176void ClipAndSubmitTriangleAtFarDepth(GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2);
1177
1178#if TGR_BRD3D
1179
1189void SubmitTriangleToRenderBuffer(GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2);
1190
1201void SubmitIndexedTriangle(int nVertex0, int nVertex1, int nVertex2);
1202
1212void SubmitIndexedTriangleRasterized(int nVertex0, int nVertex1, int nVertex2);
1213
1219void FlushIndexedRenderBuffer(void);
1220
1227void FlushDirtyRenderStates(void);
1228
1234extern DWORD g_dwD3DAlphaFunc;
1235#endif /* TGR_BRD3D */
1236
1238#define OVERLAY_DISPLAY_LIST_SIZE 0x8000
1240#define OVERLAY_TEXT_SIZE 20
1242#define OVERLAY_TEXT_X 0
1244#define OVERLAY_TEXT_Y 60
1246#define GBI_END_DISPLAY_LIST_W0 0xb8000000
1247
1249#define DEBUG_OVERLAY_TEXT_SIZE 0x408
1250
1259
1267
1275
1287
1294extern void (*g_pfnBindTextureEntry)(int nEntry);
1295
1302extern int g_nBoundTextureEntry;
1303
1311void BindTextureEntry(int nEntry);
1312#ifdef __cplusplus
1313}
1314#endif
1315
1316#ifdef __cplusplus
1317extern "C" {
1318#endif
1319
1331
1341
1351
1358extern int g_dwScissorLeft;
1359
1366extern int g_dwScissorTop;
1367
1374extern int g_dwScissorRight;
1375
1382extern int g_dwScissorBottom;
1383
1395
1406
1416
1426
1436
1447
1458
1468
1478
1488
1497 GbiVertexSource *pSource);
1498
1507 GbiVertexSource *pSource);
1508
1518
1528
1538
1548void DrawFlatShadedTriangle(int nVertex0, int nVertex1, int nVertex2);
1549
1561
1572
1582void DrawFlatShadedTriangleDepthScaled(int nVertex0, int nVertex1, int nVertex2);
1583
1595
1607
1620
1632
1633#if TGR_BRD3D
1640extern DWORD g_dwD3DZFunc;
1641#endif /* TGR_BRD3D */
1642
1650
1651#if TGR_BRD3D
1652
1658extern D3DCOLOR g_dwVertexConstantColor;
1659#endif /* TGR_BRD3D */
1660
1662typedef GbiCommand *(*GbiHandler)(GbiCommand *pCommand);
1663
1665#define GBI_HANDLER_COUNT 256
1666
1675
1684#ifdef __cplusplus
1685}
1686#endif
float g_aGbiModelViewStack[GBI_MATRIX_STACK_RESET_DEPTH][4][4]
The stack of model-view matrices used by display-list matrix commands.
GbiCommand * HandleGbiBindTextureEntry(GbiCommand *pCommand)
Draw the triangles waiting, and bind a texture the game loaded in place of the commands that load it ...
GbiCommand * HandleGbiPopMatrix(GbiCommand *pCommand)
Pop the stack of matrices.
unsigned char g_bGbiFillColorA
The alpha of the fill colour, 0 or 255.
GbiCommand * HandleGbiMatrix(GbiCommand *pCommand)
Multiply or load the projection or the model view matrix, and update g_GbiMvpMatrix.
void SelectVertexSubmitterForCombineMode(unsigned dwCombineHi, unsigned dwCombineLo)
Choose the routine that submits vertices for a combine mode, and the colour of the combine modes that...
unsigned char g_bGbiFillColorR
The red of the fill colour.
int g_nBoundTextureEntry
The entry whose texture is bound, or -1 after texture initialization.
unsigned g_dwGbiCombineModeLo
The second word of the combine mode set last.
GbiCommand * HandleGbiSetScissorIntCoords(GbiCommand *pCommand)
Set the scissor from corners in whole pixels of the console, and clip the device to it.
void ComputeVertexDirectionalLight(const ConvertedModelVertex *pVertex, GbiVertexSource *pDest)
Light a vertex normal with the first directional light and the ambient colour.
void ScaleVertexTexCoords(GrVertex *pVertex, const GbiVertexSource *pSource)
Scale the texture coordinates of a vertex as it was loaded into those of both units of the vertex,...
GbiCommand * HandleGbiSetTexRectW(GbiCommand *pCommand)
Set the scale of the width of a texture rectangle.
const Light * g_pGbiLookAtY
The second vector of the look-at of the display lists, as a move memory command gives it.
GbiCommand * HandleGbiSetTileSize(GbiCommand *pCommand)
Set the edges of the tile, and its width and height in whole texels.
int g_dwTileSizeUls
The left edge of the tile, in texels with two bits of fraction.
GbiCommand * HandleGbiDisplayList(GbiCommand *pCommand)
Branch to a display list, or call it when bits 16 to 23 of the first word are clear.
int g_dwGbiMatrixStackDepth
The depth of the stack of matrices.
void TransformVertexToScreen(GrVertex *pDest, const GbiVertexSource *pSource, float fRed, float fGreen, float fBlue)
Take a vertex inside the view to the screen with a colour, its position snapped to a quarter of a pix...
void ClipPolygonTopPlane(GbiClipPolygon *pPolygon)
Clip a polygon against the top plane, where Y is at most W.
GbiCommand * HandleGbiSetGeometryMode(GbiCommand *pCommand)
Set bits of the geometry mode.
void DrawFillRectangle(int nLeft, int nTop, int nRight, int nBottom)
Fill a rectangle of the screen with the fill colour.
void GenerateGbiVertexTextureCoordinates(const ConvertedModelVertex *pInput, GbiVertexSource *pSource)
Generate tile-relative texture coordinates from the transformed vertex normal.
GbiCommand * HandleGbiTri1Flat(GbiCommand *pCommand)
Draw one triangle with flat shading, after giving the device the dirty render states.
void ApplyRdpRenderMode(unsigned dwRenderMode)
Apply the blending, the depth, and the test of alpha of a render mode of the console.
void DrawTextureRectangle(int nUpperLeftX, int nUpperLeftY, int nLowerRightX, int nLowerRightY, int nTile)
Draw a rectangle of a tile of texture.
Vec3f g_GbiLight0Direction
The direction of the first directional light.
GbiCommand * HandleGbiMoveMem(GbiCommand *pCommand)
Set the viewport, a vector of the look-at, a light, or g_GbiMvpMatrix from memory.
GbiCommand * HandleGbiSetViewport(GbiCommand *pCommand)
Set the viewport.
int g_bRdpBlendStateOverride
Whether a render mode set the blend of the frame.
int g_dwScissorTop
The top edge of the scissor, in pixels from the bottom of the screen.
GbiCommand * HandleGbiSetScissor(GbiCommand *pCommand)
Set the scissor from corners in pixels of the console with two bits of fraction, dropping the fractio...
float g_fGbiAmbientColorG
The green channel of the ambient light.
int g_dwTileSizeHeight
The height of the tile, in whole texels.
GbiVertexSource * LerpVertexFromPool(const GbiVertexSource *pFirst, const GbiVertexSource *pSecond, float fFraction)
Take a clipping vertex from the free list and interpolate its attributes.
unsigned char g_bGbiFillColorB
The blue of the fill colour.
DWORD g_dwGbiLastFrameTime
The time the last frame was shown, in milliseconds.
GbiCommand * HandleGbiSetFillColor(GbiCommand *pCommand)
Set the fill colour from the RGBA 5551 colour in the low 16 bits of the command.
int g_dwGbiNumLights
The number of lights the display lists set, as their command gives it.
float g_fGbiPrimColorG
The green of the primitive colour, from 0 to 1.
GbiCommand * HandleGbiSetFogColor(GbiCommand *pCommand)
Set the colour of the fog of the device from the RGBA colour of the command.
float g_fViewportScaleX
The scale of x of the viewport, in pixels.
GbiCommand * HandleGbiNoOp(GbiCommand *pCommand)
Skip a command.
void ExecuteGbiDisplayList(GbiCommand *pCommand)
Run a display list through g_apfnGbiHandlers until a handler returns nullptr.
int g_bCombineModeSpecialSubmitter
Whether the combine mode takes the routine that modulates the lighting by the environment colour.
void(* g_pfnBindTextureEntry)(int nEntry)
Bind a texture the game loaded, set by InitializeTextureSubsystem().
unsigned g_dwGbiGeometryMode
The geometry mode.
GbiCommand * HandleGbiTextureRectangle(GbiCommand *pCommand)
Draw a texture rectangle of a command of one word pair, its corners in pixels with two bits of fracti...
float g_fGbiEnvColorB
The blue of the environment colour, from 0 to 1.
GbiCommand * HandleGbiTri1SmoothNoZBuffer(GbiCommand *pCommand)
Draw one triangle with smooth shading without the depth buffer, after giving the device the dirty ren...
const Light * g_pGbiLookAtX
The first vector of the look-at of the display lists, as a move memory command gives it.
GbiCommand * HandleGbiSetOtherModeL(GbiCommand *pCommand)
Set the low word of the other modes.
float g_fViewportScaleY
The scale of y of the viewport, in pixels, negative for Direct3D.
float g_fGbiEnvColorG
The green of the environment colour, from 0 to 1.
int g_bGbiLightsTransformed
Whether the lights were transformed since they last changed.
float g_fGbiLight0ColorG
The green channel of the first directional light.
void BindTextureEntry(int nEntry)
Bind an entry's device texture and stage its addressing, scale and active tile bounds.
GbiCommand * HandleGbiTri1Smooth(GbiCommand *pCommand)
Draw one triangle with smooth shading, after giving the device the dirty render states.
GbiCommand * HandleGbiSetPrimColor(GbiCommand *pCommand)
Set the primitive colour from the RGBA colour of the command.
GbiCommand * HandleGbiVertexLitNoZBuffer(GbiCommand *pCommand)
Load vertices with lighting without the depth buffer.
std::array< GbiHandler, GBI_HANDLER_COUNT > g_apfnGbiHandlers
The handlers of the commands of the display lists, by the opcode in the high byte of the first word.
unsigned g_dwGbiCombineModeHi
The first word of the combine mode set last.
float g_fViewportTranslateY
The translation of y of the viewport, in pixels, from the bottom of the screen for Glide.
void ApplyGeometryModeChanges(void)
Apply the geometry mode after a change: the culling and the comparison of depth of the device when th...
int g_dwScissorRight
The right edge of the scissor, in pixels.
float g_fGbiEnvColorA
The alpha of the environment colour, from 0 to 1.
GbiCommand * HandleGbiVertexLitEnvColorModulated(GbiCommand *pCommand)
Load vertices with lighting modulated by the environment colour.
int g_dwScissorBottom
The bottom edge of the scissor, in pixels from the bottom of the screen.
GbiVertexSource * g_pVertexFreeList
The first available clipping vertex in the pool, or NULL when the pool is full.
float g_fGbiAmbientColorR
The red channel of the ambient light.
void DrawFlatShadedTriangle(int nVertex0, int nVertex1, int nVertex2)
Draw a triangle of g_aGbiVertexCache in the colour of its first vertex.
GbiCommand * HandleGbiLoadPreparedTexture(GbiCommand *pCommand)
Upload a texture the game loaded to its surface.
void RenderGbiDisplayListFrame(GbiCommand *pDisplayList)
Draw a frame of the game: set the render states the display lists start from, run the display list an...
float g_fTexRectScaleW
The scale of the width of a texture rectangle.
void ClipAndSubmitTriangleAtFarDepth(GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2)
Clip a triangle to the planes of the view and submit what remains at the far depth.
void(* g_pfnUploadTextureEntryToSurface)(int nEntry, TextureUploadData payload)
Upload a texture the game loaded to its surface, set by InitializeTextureSubsystem().
GbiCommand * g_apGbiDisplayListReturnStack[GBI_DISPLAY_LIST_STACK_SIZE]
The commands that follow the calls of display lists, to return to.
GbiCommand * HandleGbiTri1FlatNoZBuffer(GbiCommand *pCommand)
Draw one triangle with flat shading without the depth buffer, after giving the device the dirty rende...
GbiCommand * HandleGbiTri2SmoothNoZBuffer(GbiCommand *pCommand)
Draw two triangles with smooth shading without the depth buffer, after giving the device the dirty re...
void ClipPolygonNearZPlane(GbiClipPolygon *pPolygon)
Clip a polygon against the near plane, where Z is at least negative W.
GbiCommand * HandleGbiLoadMatrix(GbiCommand *pCommand)
Copy the matrix of the command into g_GbiMvpMatrix.
int ComputeVertexClipCodes(const GbiVertexSource *pVertex)
Mark every homogeneous clip plane outside pVertex, including unordered coordinates.
GbiCommand * HandleGbiFillRectangleIntCoords(GbiCommand *pCommand)
Fill a rectangle given in whole pixels of the console, whose rows run up from the bottom of the scree...
GbiCommand * HandleGbiMoveWord(GbiCommand *pCommand)
Set the number of lights or the colour of a light.
GbiCommand * HandleGbiClearGeometryMode(GbiCommand *pCommand)
Clear bits of the geometry mode.
float g_fGbiPrimColorB
The blue of the primitive colour, from 0 to 1.
void ClipPolygonLeftPlane(GbiClipPolygon *pPolygon)
Clip a polygon against the left plane, where X is at least negative W.
void DrawFlatShadedTriangleDepthScaled(int nVertex0, int nVertex1, int nVertex2)
Draw a triangle of g_aGbiVertexCache in the colour of its first vertex, without the depth buffer.
GbiCommand * HandleGbiSetTexRectDepth(GbiCommand *pCommand)
Set the depth of a texture rectangle.
float g_fGbiPrimColorA
The alpha of the primitive colour, from 0 to 1.
float g_fGbiAmbientColorB
The blue channel of the ambient light.
float g_fViewportTranslateX
The translation of x of the viewport, in pixels.
void HalveGbiTriangleVertexIndices(GbiCommand *pCommand)
Convert the packed indices of a single-triangle command from doubled byte offsets to vertices.
float g_GbiProjectionMatrix[4][4]
The current projection matrix of the display-list interpreter.
GbiVertexSource g_aClipVertexPool[GBI_CLIP_VERTEX_POOL_SIZE]
The temporary vertices used while clipping display-list geometry.
GbiCommand * HandleGbiEndDisplayList(GbiCommand *pCommand)
Return from a display list to the command after its call.
GbiCommand * HandleGbiTextureRectangleNative(GbiCommand *pCommand)
Draw a texture rectangle of the console, which takes three commands, its corners as the console gives...
float g_fTexCoordScaleS
The scale from the s of a vertex to its u.
GbiLight g_aGbiLights[GBI_LIGHT_COUNT]
The lights of the display lists.
void GenerateGbiVertexTextureCoordinatesLinear(const ConvertedModelVertex *pInput, GbiVertexSource *pSource)
Generate texture coordinates with the linear-mode vertical arcsine mapping.
GbiCommand * HandleGbiTri2Smooth(GbiCommand *pCommand)
Draw two triangles with smooth shading, after giving the device the dirty render states.
void HalveGbiTrianglePairVertexIndices(GbiCommand *pCommand)
Convert both packed triangle index triples from doubled byte offsets to vertices.
int g_dwScissorLeft
The left edge of the scissor, in pixels.
float g_fTexCoordScaleT
The scale from the t of a vertex to its v.
void ClipPolygonAndSubmitFlat(GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2, float fRed, float fGreen, float fBlue)
Clip and submit a triangle with one colour for all surviving vertices.
char g_szDebugOverlayText[DEBUG_OVERLAY_TEXT_SIZE]
The text drawn over each frame.
GbiCommand * HandleGbiFillRectangle(GbiCommand *pCommand)
Fill a rectangle given in pixels of the console with two bits of fraction, whose rows run up from the...
GbiCommand * HandleGbiSetRenderMode(GbiCommand *pCommand)
Set the render mode.
unsigned g_dwGbiRenderMode
The render mode of the console the display lists set last.
unsigned char g_bGbiFillColorG
The green of the fill colour.
int g_dwTileSizeUlt
The top edge of the tile, in texels with two bits of fraction.
int g_dwTileSizeWidth
The width of the tile, in whole texels.
int g_dwTileSizeLrt
The bottom edge of the tile, in texels with two bits of fraction.
void ClipPolygonRightPlane(GbiClipPolygon *pPolygon)
Clip a polygon against the right plane, where X is at most W.
GbiCommand * HandleGbiTri2FlatNoZBuffer(GbiCommand *pCommand)
Draw two triangles with flat shading without the depth buffer, after giving the device the dirty rend...
GbiCommand * HandleGbiTri2Flat(GbiCommand *pCommand)
Draw two triangles with flat shading, after giving the device the dirty render states.
float g_fGbiLight0ColorR
The red channel of the first directional light.
float g_fGbiPrimColorR
The red of the primitive colour, from 0 to 1.
void ClipPolygonFarZPlane(GbiClipPolygon *pPolygon)
Clip a polygon against the far plane, where Z is at most W.
#define DEBUG_OVERLAY_TEXT_SIZE
The size of g_szDebugOverlayText, the room before the next datum.
Definition displaylist.h:1249
unsigned g_dwGbiPrevGeometryMode
The geometry mode before the last change.
void ClipPolygonBottomPlane(GbiClipPolygon *pPolygon)
Clip a polygon against the bottom plane, where Y is at least negative W.
GbiCommand * HandleGbiVertexUnlitNoZBuffer(GbiCommand *pCommand)
Load vertices without lighting without the depth buffer.
Light GbiLight
A light of the display lists, in the shared console format.
Definition displaylist.h:483
void ClipAndSubmitTriangle(GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2)
Clip a triangle to the planes of the view and submit what remains.
float g_fGbiLight0ColorB
The blue channel of the first directional light.
GbiCommand * HandleGbiSetEnvColor(GbiCommand *pCommand)
Set the environment colour from the RGBA colour of the command.
float g_GbiMvpMatrix[4][4]
The matrix that takes a vertex of the display lists to the screen.
int g_dwTileSizeLrs
The right edge of the tile, in texels with two bits of fraction.
GbiCommand * HandleGbiSetCombine(GbiCommand *pCommand)
Set the combine mode and choose the routine that submits vertices for it.
float g_fGbiEnvColorR
The red of the environment colour, from 0 to 1.
GbiCommand * HandleGbiVertexLit(GbiCommand *pCommand)
Load vertices with lighting.
DWORD g_dwGbiFrameDeltaTime
The time between the last two frames shown, in milliseconds.
#define GBI_MATRIX_STACK_RESET_DEPTH
The depth g_dwGbiMatrixStackDepth takes when a pop empties it.
Definition displaylist.h:28
GbiCommand * HandleGbiVertexTexGen(GbiCommand *pCommand)
Load vertices that generate their texture coordinates.
GbiVertex g_aGbiVertexCache[GBI_VERTEX_CACHE_SIZE]
The vertices the display lists loaded.
#define GBI_DISPLAY_LIST_STACK_SIZE
The number of entries of g_apGbiDisplayListReturnStack.
Definition displaylist.h:25
void ClipPolygonPositiveWPlane(GbiClipPolygon *pPolygon)
Clip a polygon to vertices with nonnegative homogeneous W.
void ClipPolygonAndSubmitDepthScaled(GbiVertex *pVertex0, GbiVertex *pVertex1, GbiVertex *pVertex2, float fRed, float fGreen, float fBlue)
Clip and submit a triangle with one colour at the fixed far depth.
#define GBI_CLIP_VERTEX_POOL_SIZE
The number of vertices available while clipping display-list geometry.
Definition displaylist.h:858
#define GBI_LIGHT_COUNT
The number of entries of g_aGbiLights.
Definition displaylist.h:486
float g_fTexRectDepth
The depth of a texture rectangle.
#define GBI_VERTEX_CACHE_SIZE
The number of entries of g_aGbiVertexCache and g_apVertexPool.
Definition displaylist.h:855
int g_dwGbiDisplayListStackDepth
The number of entries of g_apGbiDisplayListReturnStack in use.
GbiCommand * HandleGbiVertexTexGenLinear(GbiCommand *pCommand)
Load vertices that generate their texture coordinates linearly.
GbiCommand * HandleGbiVertexUnlit(GbiCommand *pCommand)
Load vertices without lighting.
A model vertex converted into the renderer's working format.
Definition convertedvertex.h:7
A circular list of vertices undergoing homogeneous clipping.
Definition displaylist.h:886
int nCount
Definition displaylist.h:888
GbiVertexSource * pHead
Definition displaylist.h:887
A command of a display list of the game.
Definition gbicommand.h:30
The vertex a command of the display lists loaded.
Definition displaylist.h:695
GbiVertexSource * pNext
Definition displaylist.h:696
float fT
Definition displaylist.h:701
float fBlue
Definition displaylist.h:705
float fRed
Definition displaylist.h:703
float fX
Definition displaylist.h:697
float fY
Definition displaylist.h:698
float fZ
Definition displaylist.h:699
float fS
Definition displaylist.h:700
float fGreen
Definition displaylist.h:704
float fW
Definition displaylist.h:702
A vertex of the display lists after its transform.
Definition displaylist.h:732
int nClipFlags
Definition displaylist.h:734
GrVertex vertex
Definition displaylist.h:733
GbiVertexSource source
Definition displaylist.h:735
A point or direction in space.
Definition vecmath.h:17
A directional light, aligned for the RSP.
Definition gbi.h:33
A texture upload receives numeric command data or a pixel buffer.
Definition textureupload.h:7
The vector and matrix arithmetic of the game, its arctangent and power, the triangle and segment test...
typedef DWORD
typedef WORD