coastline 0.0.4
Loading...
Searching...
No Matches
relocation.h
Go to the documentation of this file.
1#ifndef COASTLINE_RELOCATION_H
2#define COASTLINE_RELOCATION_H
3
8
9#include "common/gbicommand.h"
10#include "common/render.h"
11#include "common/track.h"
12#include "common/vecmath.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
26
33#if TGR_PLATFORM != TGR_PLATFORM_SDL
34extern unsigned char *g_pTrackTextureTable;
35#endif
36
45
54
63void ByteSwapTextureDescriptorArray(ModelTexture *pTextures, int nCount);
64
72
74#define RELOCATED_POINTER_COUNT 0x800
75
83
91void AddPointerToRelocatedList(void *pPointer);
92
101int IsPointerInRelocatedList(void *pPointer);
102
111void RelocatePointerValue(unsigned *pdwPointer);
112
121void ByteSwapArray16(unsigned short *pData, int nCount);
122
131
140void ByteSwapShortQuadArray(TrackSurface *pData, int nCount);
141
150
159void ByteSwap3DWordsArray(Vec3f *pData, int nCount);
160
168
178void SetPointerRelocationBase(unsigned dwOldBase, unsigned dwNewBase);
179
188
195#if TGR_PLATFORM != TGR_PLATFORM_SDL
196extern unsigned g_dwTextureMapAddressBias;
197#endif
198
199#ifdef __cplusplus
200}
201#endif
202
203#endif /* COASTLINE_RELOCATION_H */
The state the renderer shares between the parts of a frame.
void ByteSwapAndRelocateTextureDescriptor(ModelTexture *pTexture)
Relocate a texture's image and palette pointers and byte-swap its dimensions and flags.
void RelocatePointerValue(unsigned *pdwPointer)
Move a pointer from g_dwOldBaseAddress to g_dwNewBaseAddress.
void AddPointerToRelocatedList(void *pPointer)
Add a pointer to g_apRelocatedPointers while it has room.
void ByteSwap3DWordsArray(Vec3f *pData, int nCount)
Reverse the bytes of each component of a run of vectors.
void SetCopyTextureDataOnRelocate(int bCopy)
Set whether the data of a texture is copied when its pointers are relocated.
void * g_apRelocatedPointers[RELOCATED_POINTER_COUNT]
The pointers relocated, g_dwRelocatedPointerCount of them.
void ByteSwapArray16(unsigned short *pData, int nCount)
Swap the two bytes of each of a run of halfwords.
void ByteSwapTextureDescriptorArray(ModelTexture *pTextures, int nCount)
Apply texture descriptor relocation to nCount consecutive textures.
void ResetVertexConversionCache(void)
Empty the cache of converted vertices and the count of relocated pointers.
void ByteSwapAndRelocateDisplayList(GbiCommand *pCommands)
Byte-swap a display list through its end command and relocate texture and vertex pointers.
int g_dwRelocatedPointerCount
The number of pointers relocated.
void ByteSwapShortQuadArray(TrackSurface *pData, int nCount)
Swap the bytes of each halfword of a run of groups of four halfwords.
#define RELOCATED_POINTER_COUNT
The most entries of g_apRelocatedPointers.
Definition relocation.h:74
int IsPointerInRelocatedList(void *pPointer)
Report whether a pointer was relocated already.
void SetPointerRelocationBase(unsigned dwOldBase, unsigned dwNewBase)
Empty the cache of converted vertices and record the address the pointers to relocate are based at an...
void ByteSwapTextureVariantTable(TextureAnimation *pAnimation)
The source table used when copying track texture images during relocation.
void ByteSwap3DWords(Vec3f *pData)
Reverse the four bytes of each component of a vector.
void ByteSwapFourShorts(TrackSurface *pData)
Swap the two bytes of each of the four halfwords of a triangle of the track.
A command of a display list of the game.
Definition gbicommand.h:30
A texture of a model and its palette.
Definition render.h:63
The frames of an animated texture.
Definition render.h:52
A triangle of the track: its corners and what it belongs to.
Definition track.h:139
A point or direction in space.
Definition vecmath.h:17
The track data a race loads below the program: its triangles and placed models, and the route the veh...
The vector and matrix arithmetic of the game, its arctangent and power, the triangle and segment test...