Rev 18 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18 | Rev 20 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | #define HARNESS_HOOKS_H |
2 | #define HARNESS_HOOKS_H |
3 | 3 | ||
4 | #include "brender.h" |
4 | #include "brender/br_types.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); |
|
15 | // Render a fullscreen quad using the specified pixel data |
21 | // 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 |
|
16 | void (* |
28 | void (*Renderer_BufferTexture)(br_pixelmap* pm); |
- | 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); |
|
17 | // Set the 256 color palette to use (BGRA format) |
35 | // Set the 256 color palette to use (BGRA format) |
18 | void (*Renderer_SetPalette)(PALETTEENTRY_* palette); |
36 | void (*Renderer_SetPalette)(PALETTEENTRY_* palette); |
- | 37 | // Set the viewport for 3d rendering |
|
- | 38 | void (*Renderer_SetViewport)(int x, int y, int width, int height); |
|
19 | // Create a window. Return a handle to the window |
39 | // Create a window. Return a handle to the window |
20 | void* (*CreateWindowAndRenderer)(char* title, int x, int y, int nWidth, int nHeight); |
40 | void* (*CreateWindowAndRenderer)(char* title, int x, int y, int nWidth, int nHeight); |
21 | // Get mouse button state |
41 | // Get mouse button state |
22 | int (*GetMouseButtons)(int* button_1, int* button_2); |
42 | int (*GetMouseButtons)(int* button_1, int* button_2); |
23 | // Get mouse position |
43 | // Get mouse position |
Line 34... | Line 54... | ||
34 | void (*GetKeyboardState)(unsigned int count, uint8_t* buffer); |
54 | void (*GetKeyboardState)(unsigned int count, uint8_t* buffer); |
35 | // Sleep |
55 | // Sleep |
36 | void (*Sleep)(uint32_t dwMilliseconds); |
56 | void (*Sleep)(uint32_t dwMilliseconds); |
37 | // Get ticks |
57 | // Get ticks |
38 | uint32_t (*GetTicks)(void); |
58 | uint32_t (*GetTicks)(void); |
- | 59 | // Swap window |
|
- | 60 | void (*SwapWindow)(void); |
|
39 | // Show error message |
61 | // Show error message |
40 | int (*ShowErrorMessage)(void* window, char* text, char* caption); |
62 | int (*ShowErrorMessage)(void* window, char* text, char* caption); |
41 | 63 | ||
42 | } tHarness_platform; |
64 | } tHarness_platform; |
43 | 65 | ||
44 | extern tHarness_platform gHarness_platform; |
66 | extern tHarness_platform gHarness_platform; |
45 | 67 | ||
46 | void Harness_Init(int* argc, char* argv[]); |
68 | void Harness_Init(int* argc, char* argv[]); |
47 | 69 | ||
48 | // Hooks are called from original game code. |
70 | // 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); |
|
49 | 80 | ||
50 | // Filesystem hooks |
81 | // Filesystem hooks |
51 | FILE* Harness_Hook_fopen(const char* pathname, const char* mode); |
82 | FILE* Harness_Hook_fopen(const char* pathname, const char* mode); |
- | 83 | ||
- | 84 | void Harness_RenderLastScreen(void); |
|
52 | 85 | ||
53 | #endif |
86 | #endif |