Rev 1 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1 | Rev 18 | ||
|---|---|---|---|
| Line 2... | Line 2... | ||
| 2 | #define HARNESS_HOOKS_H |
2 | #define HARNESS_HOOKS_H |
| 3 | 3 | ||
| 4 | #include "brender |
4 | #include "brender.h" |
| 5 | #include "harness/win95_polyfill_defs.h" |
5 | #include "harness/win95_polyfill_defs.h" |
| 6 | #include <stdio.h> |
6 | #include <stdio.h> |
| 7 | 7 | ||
| 8 | typedef enum { |
8 | typedef enum { |
| 9 | eFlush_all, |
9 | eFlush_all, |
| 10 | eFlush_color_buffer |
10 | eFlush_color_buffer |
| 11 | } tRenderer_flush_type; |
11 | } tRenderer_flush_type; |
| 12 | 12 | ||
| 13 | // Platform implementation functions |
13 | // Platform implementation functions |
| 14 | typedef struct tHarness_platform { |
14 | typedef struct tHarness_platform { |
| 15 | // Initialize the renderer |
- | |
| 16 | void (*Renderer_Init)(int width, int height, int pRender_width, int pRender_height); |
- | |
| 17 | // Called when beginning a 3D scene |
- | |
| 18 | void (*Renderer_BeginScene)(br_actor* camera, br_pixelmap* colour_buffer, br_pixelmap* depth_buffer); |
- | |
| 19 | // Called at the end of a 3D scene |
- | |
| 20 | void (*Renderer_EndScene)(void); |
- | |
| 21 | // Render a fullscreen quad using the specified pixel data |
15 | // Render a fullscreen quad using the specified pixel data |
| 22 | void (*Renderer_FullScreenQuad)(uint8_t* src); |
- | |
| 23 | // Render a model |
- | |
| 24 | void (*Renderer_Model)(br_actor* actor, br_model* model, br_material* material, br_token render_type, br_matrix34 model_matrix); |
- | |
| 25 | // Clear frame and depth buffers |
- | |
| 26 | void (*Renderer_ClearBuffers)(void); |
- | |
| 27 | // Load pixelmap into video memory |
- | |
| 28 | void (* |
16 | void (*Renderer_Present)(br_pixelmap* src); |
| 29 | // Load material |
- | |
| 30 | void (*Renderer_BufferMaterial)(br_material* mat); |
- | |
| 31 | // Load model into video memory |
- | |
| 32 | void (*Renderer_BufferModel)(br_model* model); |
- | |
| 33 | // Pull contents of frame and depth buffers from video into main memory for software effects |
- | |
| 34 | void (*Renderer_FlushBuffers)(void); |
- | |
| 35 | // Set the 256 color palette to use (BGRA format) |
17 | // Set the 256 color palette to use (BGRA format) |
| 36 | void (*Renderer_SetPalette)(PALETTEENTRY_* palette); |
18 | void (*Renderer_SetPalette)(PALETTEENTRY_* palette); |
| 37 | // Set the viewport for 3d rendering |
- | |
| 38 | void (*Renderer_SetViewport)(int x, int y, int width, int height); |
- | |
| 39 | // Create a window. Return a handle to the window |
19 | // Create a window. Return a handle to the window |
| 40 | void* (*CreateWindowAndRenderer)(char* title, int x, int y, int nWidth, int nHeight); |
20 | void* (*CreateWindowAndRenderer)(char* title, int x, int y, int nWidth, int nHeight); |
| 41 | // Get mouse button state |
21 | // Get mouse button state |
| 42 | int (*GetMouseButtons)(int* button_1, int* button_2); |
22 | int (*GetMouseButtons)(int* button_1, int* button_2); |
| 43 | // Get mouse position |
23 | // Get mouse position |
| Line 54... | Line 34... | ||
| 54 | void (*GetKeyboardState)(unsigned int count, uint8_t* buffer); |
34 | void (*GetKeyboardState)(unsigned int count, uint8_t* buffer); |
| 55 | // Sleep |
35 | // Sleep |
| 56 | void (*Sleep)(uint32_t dwMilliseconds); |
36 | void (*Sleep)(uint32_t dwMilliseconds); |
| 57 | // Get ticks |
37 | // Get ticks |
| 58 | uint32_t (*GetTicks)(void); |
38 | uint32_t (*GetTicks)(void); |
| 59 | // Swap window |
- | |
| 60 | void (*SwapWindow)(void); |
- | |
| 61 | // Show error message |
39 | // Show error message |
| 62 | int (*ShowErrorMessage)(void* window, char* text, char* caption); |
40 | int (*ShowErrorMessage)(void* window, char* text, char* caption); |
| 63 | 41 | ||
| 64 | } tHarness_platform; |
42 | } tHarness_platform; |
| 65 | 43 | ||
| 66 | extern tHarness_platform gHarness_platform; |
44 | extern tHarness_platform gHarness_platform; |
| 67 | 45 | ||
| 68 | void Harness_Init(int* argc, char* argv[]); |
46 | void Harness_Init(int* argc, char* argv[]); |
| 69 | 47 | ||
| 70 | // Hooks are called from original game code. |
48 | // Hooks are called from original game code. |
| 71 | - | ||
| 72 | // BRender hooks |
- | |
| 73 | void Harness_Hook_BrPixelmapDoubleBuffer(br_pixelmap* dst, br_pixelmap* src); |
- | |
| 74 | void Harness_Hook_BrV1dbRendererBegin(br_v1db_state* v1db); |
- | |
| 75 | void Harness_Hook_renderActor(br_actor* actor, br_model* model, br_material* material, br_token type); |
- | |
| 76 | - | ||
| 77 | // Sound hooks |
- | |
| 78 | void Harness_Hook_S3Service(int unk1, int unk2); |
- | |
| 79 | void Harness_Hook_S3StopAllOutletSounds(void); |
- | |
| 80 | 49 | ||
| 81 | // Filesystem hooks |
50 | // Filesystem hooks |
| 82 | FILE* Harness_Hook_fopen(const char* pathname, const char* mode); |
51 | FILE* Harness_Hook_fopen(const char* pathname, const char* mode); |
| 83 | - | ||
| 84 | void Harness_RenderLastScreen(void); |
- | |
| 85 | 52 | ||
| 86 | #endif |
53 | #endif |