Public Member Functions | |
Abstract in parent class | |
UBOOL | Init (UViewport *InViewport, INT NewX, INT NewY, INT NewColorBytes, UBOOL Fullscreen) |
UBOOL | SetRes (INT NewX, INT NewY, INT NewColorBytes, UBOOL Fullscreen) |
void | Exit () |
void | Flush (UBOOL AllowPrecache) |
void | Lock (FPlane FlashScale, FPlane FlashFog, FPlane ScreenClear, DWORD RenderLockFlags, BYTE *HitData, INT *HitSize) |
void | Unlock (UBOOL Blit) |
void | DrawComplexSurface (FSceneNode *Frame, FSurfaceInfo &Surface, FSurfaceFacet &Facet) |
void | DrawGouraudPolygon (FSceneNode *Frame, FTextureInfo &Info, FTransTexture **Pts, int NumPts, DWORD PolyFlags, FSpanBuffer *Span) |
void | DrawTile (FSceneNode *Frame, FTextureInfo &Info, FLOAT X, FLOAT Y, FLOAT XL, FLOAT YL, FLOAT U, FLOAT V, FLOAT UL, FLOAT VL, class FSpanBuffer *Span, FLOAT Z, FPlane Color, FPlane Fog, DWORD PolyFlags) |
void | Draw2DLine (FSceneNode *Frame, FPlane Color, DWORD LineFlags, FVector P1, FVector P2) |
void | Draw2DPoint (FSceneNode *Frame, FPlane Color, DWORD LineFlags, FLOAT X1, FLOAT Y1, FLOAT X2, FLOAT Y2, FLOAT Z) |
void | ClearZ (FSceneNode *Frame) |
void | PushHit (const BYTE *Data, INT Count) |
void | PopHit (INT Count, UBOOL bForce) |
void | GetStats (TCHAR *Result) |
void | ReadPixels (FColor *Pixels) |
Optional but implemented | |
UBOOL | Exec (const TCHAR *Cmd, FOutputDevice &Ar) |
void | SetSceneNode (FSceneNode *Frame) |
void | PrecacheTexture (FTextureInfo &Info, DWORD PolyFlags) |
void | EndFlash () |
void | StaticConstructor () |
Private Attributes | |
D3D::Options | D3DOptions |
struct { | |
int precache | |
} | options |
Helpers | |
static void | debugs (char *s) |
int | getOption (TCHAR *name, int defaultVal, bool isBool) |
Called UD3D10RenderDevice as Unreal leaves out first letter when accessing the class; now it can be accessed as D3D10RenderDevice.
void UD3D10RenderDevice::ClearZ | ( | FSceneNode * | Frame | ) |
Clear the depth buffer. Used to draw the skybox behind the rest of the geometry, and weapon in front.
void UD3D10RenderDevice::debugs | ( | char * | s | ) | [static] |
Prints text to the game's log and the standard output if in debug mode.
s | A the message to print. |
void UD3D10RenderDevice::Draw2DLine | ( | FSceneNode * | Frame, | |
FPlane | Color, | |||
DWORD | LineFlags, | |||
FVector | P1, | |||
FVector | P2 | |||
) |
For UnrealED.
void UD3D10RenderDevice::Draw2DPoint | ( | FSceneNode * | Frame, | |
FPlane | Color, | |||
DWORD | LineFlags, | |||
FLOAT | X1, | |||
FLOAT | Y1, | |||
FLOAT | X2, | |||
FLOAT | Y2, | |||
FLOAT | Z | |||
) |
For UnrealED.
void UD3D10RenderDevice::DrawComplexSurface | ( | FSceneNode * | Frame, | |
FSurfaceInfo & | Surface, | |||
FSurfaceFacet & | Facet | |||
) |
Complex surfaces are used for map geometry. They consists of facets which in turn consist of polys (triangle fans).
Frame | The scene. See SetSceneNode(). | |
Surface | Holds information on the various texture passes and the surface's PolyFlags.
| |
Facet | Contains coordinates and polygons.
|
D3D10 renderer handles DetailTexture range in shader.
void UD3D10RenderDevice::DrawGouraudPolygon | ( | FSceneNode * | Frame, | |
FTextureInfo & | Info, | |||
FTransTexture ** | Pts, | |||
int | NumPts, | |||
DWORD | PolyFlags, | |||
FSpanBuffer * | Span | |||
) |
Gouraud shaded polygons are used for 3D models and surprisingly shadows. They are sent with a call of this function per triangle fan, worldview transformed and lit. They do have normals and texture coordinates (no panning).
Frame | The scene. See SetSceneNode(). | |
Info | The texture for the model. Models only come with diffuse textures. | |
Pts | A triangle fan stored as an array. Each element has a normal, light (i.e. color) and fog (color due to being in fog). | |
NumPts | Number of verts in fan. | |
PolyFlags | Contains the correct flags for this model. See polyflags.h | |
Span | Probably for software renderers. |
void UD3D10RenderDevice::DrawTile | ( | FSceneNode * | Frame, | |
FTextureInfo & | Info, | |||
FLOAT | X, | |||
FLOAT | Y, | |||
FLOAT | XL, | |||
FLOAT | YL, | |||
FLOAT | U, | |||
FLOAT | V, | |||
FLOAT | UL, | |||
FLOAT | VL, | |||
class FSpanBuffer * | Span, | |||
FLOAT | Z, | |||
FPlane | Color, | |||
FPlane | Fog, | |||
DWORD | PolyFlags | |||
) |
Used for 2D UI elements, coronas, etc. Done by converting pixel coordinates to -1,1 ranges in vertex shader and drawing quads with X/Y perspective transform disabled. The Z coordinate however is transformed and divided by W; then W is set to 1 in the shader to get correct depth and yet preserve X and Y. Other renderers take the opposite approach and multiply X by RProjZ*Z and Y by RProjZ*Z*aspect so they are preserved and then tranform everything.
Frame | The scene. See SetSceneNode(). | |
Info | The texture for the quad. | |
X | X coord in screen space. | |
Y | Y coord in screen space. | |
XL | Width in pixels | |
YL | Height in pixels | |
U | Texure U coordinate for left. | |
V | Texture V coordinate for top. | |
UL | U+UL is coordinate for right. | |
VL | V+VL is coordinate for bottom. | |
Span | Probably for software renderers. | |
Z | coordinate (similar to that of other primitives). | |
Color | color | |
Fog | fog | |
PolyFlags | Contains the correct flags for this tile. See polyflags.h |
void UD3D10RenderDevice::EndFlash | ( | ) |
Other renderers handle flashes here by saving the related structures; this one does it in Lock().
UBOOL UD3D10RenderDevice::Exec | ( | const TCHAR * | Cmd, | |
FOutputDevice & | Ar | |||
) |
Various command from the game. Can be used to intercept input. First let the parent class handle the command.
Cmd | The command
| |
Ar | A class to which to log responses using Ar.Log(). |
void UD3D10RenderDevice::Exit | ( | ) |
Cleanup.
void UD3D10RenderDevice::Flush | ( | UBOOL | AllowPrecache | ) |
Empty texture cache.
AllowPrecache | Enabled if the game allows us to precache; respond by setting URenderDevice::PrecacheOnFlip = 1 if wanted. This does make load times longer. |
int UD3D10RenderDevice::getOption | ( | TCHAR * | name, | |
int | defaultVal, | |||
bool | isBool | |||
) |
Attempts to read a property from the game's config file; on failure, a default is written (so it can be changed by the user) and returned.
name | A string identifying the config file options. | |
defaultVal | The default value to write and return if the option is not found. | |
isBool | Whether the parameter's a boolean or integer |
void UD3D10RenderDevice::GetStats | ( | TCHAR * | Result | ) |
Something to do with FPS counters etc, not needed.
UBOOL UD3D10RenderDevice::Init | ( | UViewport * | InViewport, | |
INT | NewX, | |||
INT | NewY, | |||
INT | NewColorBytes, | |||
UBOOL | Fullscreen | |||
) |
Initialization of renderer.
InViewport | viewport parameters, can get the window handle. | |
NewX | Viewport width. | |
NewY | Viewport height. | |
NewColorBytes | Color depth. | |
Fullscreen | Whether fullscreen mode should be used. |
void UD3D10RenderDevice::Lock | ( | FPlane | FlashScale, | |
FPlane | FlashFog, | |||
FPlane | ScreenClear, | |||
DWORD | RenderLockFlags, | |||
BYTE * | InHitData, | |||
INT * | InHitSize | |||
) |
Clear screen and depth buffer, prepare buffers to receive data.
FlashScale | To do with flash effects, see notes. | |
FlashFog | To do with flash effects, see notes. | |
ScreenClear | The color with which to clear the screen. Used for Rune fog. | |
RenderLockFlags | Signify whether the screen should be cleared. Depth buffer should always be cleared. | |
InHitData | Something to do with clipping planes; safe to ignore. | |
InHitSize | Something to do with clipping planes; safe to ignore. |
RenderLockFlags aren't always properly set, this results in for example glitching in the Unreal castle flyover, in the wall of the tower with the Nali on it.
void UD3D10RenderDevice::PopHit | ( | INT | Count, | |
UBOOL | bForce | |||
) |
Something to do with clipping planes, not needed.
void UD3D10RenderDevice::PrecacheTexture | ( | FTextureInfo & | Info, | |
DWORD | PolyFlags | |||
) |
Store a texture in the renderer-kept texture cache. Only called by the game if URenderDevice::PrecacheOnFlip is 1.
Info | Texture (meta)data. Includes a CacheID with which to index. | |
PolyFlags | Contains the correct flags for this texture. See polyflags.h |
Extra care is taken to recache textures that aren't saved as masked, but now have flags indicating they should be (masking is not always properly set). as this couldn't be anticipated in advance, the texture needs to be deleted and recreated.
void UD3D10RenderDevice::PushHit | ( | const BYTE * | Data, | |
INT | Count | |||
) |
Something to do with clipping planes, not needed.
void UD3D10RenderDevice::ReadPixels | ( | FColor * | Pixels | ) |
Used for screenshots and savegame previews.
Pixels | An array of 32 bit pixels in which to dump the back buffer. |
UBOOL UD3D10RenderDevice::SetRes | ( | INT | NewX, | |
INT | NewY, | |||
INT | NewColorBytes, | |||
UBOOL | Fullscreen | |||
) |
Resize buffers and viewport.
Fullscreen can have values other than 0 and 1 for some reason.
This function MUST call URenderDevice::Viewport->ResizeViewport() or the game will stall.
void UD3D10RenderDevice::SetSceneNode | ( | FSceneNode * | Frame | ) |
This optional function can be used to set the frustum and viewport parameters per scene change instead of per drawXXXX() call.
Frame | Contains various information with which to build frustum and viewport. |
void UD3D10RenderDevice::StaticConstructor | ( | ) |
Constructor called by the game when the renderer is first created.
Binding settings to the preferences window needs to done here instead of in init() or the game crashes when starting a map if the renderer's been restarted at least once.
void UD3D10RenderDevice::Unlock | ( | UBOOL | Blit | ) |
Finish rendering. /param Blit Whether the front and back buffers should be swapped.
struct { ... } UD3D10RenderDevice::options [private] |
User configurable options
Turn on precaching