Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements depth effects #95

Merged
merged 6 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/BRSRC13/CORE/PIXELMAP/pmdsptch.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void BrPixelmapDirtyRectangleDoubleBuffer(br_pixelmap* dst, br_pixelmap* src, br
// IDA: void __cdecl BrPixelmapPixelSet(br_pixelmap *dst, br_int_32 x, br_int_32 y, br_uint_32 colour)
void BrPixelmapPixelSet(br_pixelmap* dst, br_int_32 x, br_int_32 y, br_uint_32 colour) {
br_point p;
//LOG_TRACE("(%p, %d, %d, %d)", dst, x, y, colour);
// LOG_TRACE("(%p, %d, %d, %d)", dst, x, y, colour);
br_uint_8* dst_pix = (br_uint_8*)dst->pixels;
dst_pix[(y * dst->row_bytes) + x] = (br_uint_8)colour;
}
Expand All @@ -267,8 +267,8 @@ void BrPixelmapCopy(br_pixelmap* dst, br_pixelmap* src) {

// IDA: void __cdecl BrPixelmapLine(br_pixelmap *dst, br_int_32 x1, br_int_32 y1, br_int_32 x2, br_int_32 y2, br_uint_32 colour)
void BrPixelmapLine(br_pixelmap* dst, br_int_32 x1, br_int_32 y1, br_int_32 x2, br_int_32 y2, br_uint_32 colour) {
//br_point s;
//br_point e;
// br_point s;
// br_point e;
LOG_TRACE("(%p, %d, %d, %d, %d, %d)", dst, x1, y1, x2, y2, colour);

// Thanks Errol!
Expand Down
21 changes: 12 additions & 9 deletions src/BRSRC13/CORE/PIXELMAP/pmmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ br_device_pixelmap* DevicePixelmapMemAllocate(br_uint_8 type, br_uint_16 w, br_u

tip = &pmTypeInfo[type];
pm = BrResAllocate(_pixelmap.res, sizeof(br_device_pixelmap), BR_MEMORY_PIXELMAP);
//pm->dispatch = &devicePixelmapDispatch;
// pm->dispatch = &devicePixelmapDispatch;
pm->pm_identifier = NULL;
pm->pm_map = NULL;
pm->pm_flags = BR_PMF_LINEAR;
Expand All @@ -129,11 +129,11 @@ br_device_pixelmap* DevicePixelmapMemAllocate(br_uint_8 type, br_uint_16 w, br_u
pm->pm_type = type;
pm->pm_width = w;
pm->pm_height = h;
//8 bits, 1, 4 align, 1
// 8 bits, 1, 4 align, 1

//v11 = (tip->align + w - 1) / tip->align * tip->align * tip->bits;
//pm->pm_row_bytes = (v11 - (__CFSHL__(v11 >> 31, 3) + 8 * (v11 >> 31))) >> 3;
// TODO: calculate this differently
// v11 = (tip->align + w - 1) / tip->align * tip->align * tip->bits;
// pm->pm_row_bytes = (v11 - (__CFSHL__(v11 >> 31, 3) + 8 * (v11 >> 31))) >> 3;
// TODO: calculate this differently
pm->pm_row_bytes = w;
pm->pm_row_bytes = tip->bits * tip->align * ((w + tip->align - 1) / tip->align) / 8;

Expand All @@ -147,8 +147,8 @@ br_device_pixelmap* DevicePixelmapMemAllocate(br_uint_8 type, br_uint_16 w, br_u
pm->pm_pixels = BrResAllocate(pm, pm->pm_height * pm->pm_row_bytes, BR_MEMORY_PIXELS);
}
}
//TODO: not sure we need this
//pm->pm_pixels_qualifier = (unsigned __int16)_GetSysQual();
// TODO: not sure we need this
// pm->pm_pixels_qualifier = (unsigned __int16)_GetSysQual();
if (flags & BR_PMAF_INVERTED) {
pm->pm_pixels = (char*)pm->pm_pixels + (pm->pm_height - 1) * pm->pm_row_bytes;
pm->pm_row_bytes *= -1;
Expand Down Expand Up @@ -183,7 +183,7 @@ br_error _M_br_device_pixelmap_mem_allocateSub(br_device_pixelmap* self, br_devi
pm->pm_stored = 0;
pm->dispatch = &devicePixelmapDispatch;
if (pm->pm_width != self->pm_width) {
pm->pm_flags &= 0xFDu; //unset BR_PMF_LINEAR
pm->pm_flags &= 0xFDu; // unset BR_PMF_LINEAR
}
*newpm = pm;
return 0;
Expand Down Expand Up @@ -301,6 +301,9 @@ br_error _M_br_device_pixelmap_mem_match(br_device_pixelmap* self, br_device_pix
// }

if (mt.use == BRT_DEPTH) {

// TODO: hack this to make it work
mt.pixel_type = BR_PMT_DEPTH_16;
pm = DevicePixelmapMemAllocate(mt.pixel_type, mt.width, mt.height, NULL, (self->pm_row_bytes < 0) | BR_PMAF_NO_PIXELS);
r = abs(self->pm_row_bytes);
bytes = (signed int)pmTypeInfo[self->pm_type].bits >> 3;
Expand All @@ -322,7 +325,7 @@ br_error _M_br_device_pixelmap_mem_match(br_device_pixelmap* self, br_device_pix
}
pm->pm_origin_x = self->pm_origin_x;
pm->pm_origin_y = self->pm_origin_y;
//self->dispatch = pm;
// self->dispatch = pm;
*newpm = pm;
return 0;

Expand Down
68 changes: 34 additions & 34 deletions src/BRSRC13/CORE/V1DB/modrend.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,40 @@
#include "harness/trace.h"

render_style_cbfn RenderStyleCalls[8] = {
renderFaces, /* BR_RSTYLE_DEFAULT */
nullRender, /* BR_RSTYLE_NONE */
renderPoints, /* BR_RSTYLE_POINTS */
renderEdges, /* BR_RSTYLE_EDGES */
renderFaces, /* BR_RSTYLE_FACES */
boundingBoxRenderPoints, /* BR_RSTYLE_BOUNDING_POINTS */
boundingBoxRenderEdges, /* BR_RSTYLE_BOUNDING_EDGES */
boundingBoxRenderFaces, /* BR_RSTYLE_BOUNDING_FACES */
renderFaces, /* BR_RSTYLE_DEFAULT */
nullRender, /* BR_RSTYLE_NONE */
renderPoints, /* BR_RSTYLE_POINTS */
renderEdges, /* BR_RSTYLE_EDGES */
renderFaces, /* BR_RSTYLE_FACES */
boundingBoxRenderPoints, /* BR_RSTYLE_BOUNDING_POINTS */
boundingBoxRenderEdges, /* BR_RSTYLE_BOUNDING_EDGES */
boundingBoxRenderFaces, /* BR_RSTYLE_BOUNDING_FACES */
};

v11face bounds_faces[12] = {
{ { 5, 6, 7 }, { 0, 13, 14}, { { 1.0f, 0.0f, 0.0f, 1.0f } } },
{ { 5, 4, 6 }, { 3, 4, 0}, { { 1.0f, 0.0f, 0.0f, 1.0f } } },
{ { 7, 6, 2 }, { 13, 6, 0}, { { 0.0f, 1.0f, 0.0f, 1.0f } } },
{ { 7, 2, 3 }, { 0, 5, 16}, { { 0.0f, 1.0f, 0.0f, 1.0f } } },
{ { 1, 5, 7 }, { 11, 14, 0}, { { 0.0f, 0.0f, 1.0f, 1.0f } } },
{ { 1, 7, 3 }, { 0, 16, 12}, { { 0.0f, 0.0f, 1.0f, 1.0f } } },
{ { 3, 0, 1 }, { 0, 8, 12}, { { -1.0f, 0.0f, 0.0f, 1.0f } } },
{ { 3, 2, 0 }, { 5, 1, 0}, { { -1.0f, 0.0f, 0.0f, 1.0f } } },
{ { 1, 0, 4 }, { 8, 9, 0}, { { 0.0f, -1.0f, 0.0f, 1.0f } } },
{ { 1, 4, 5 }, { 0, 3, 11}, { { 0.0f, -1.0f, 0.0f, 1.0f } } },
{ { 0, 6, 4 }, { 0, 4, 9}, { { 0.0f, 0.0f, -1.0f, 1.0f } } },
{ { 0, 2, 6 }, { 1, 6, 0}, { { 0.0f, 0.0f, -1.0f, 1.0f } } },
{ { 5, 6, 7 }, { 0, 13, 14 }, { { 1.0f, 0.0f, 0.0f, 1.0f } } },
{ { 5, 4, 6 }, { 3, 4, 0 }, { { 1.0f, 0.0f, 0.0f, 1.0f } } },
{ { 7, 6, 2 }, { 13, 6, 0 }, { { 0.0f, 1.0f, 0.0f, 1.0f } } },
{ { 7, 2, 3 }, { 0, 5, 16 }, { { 0.0f, 1.0f, 0.0f, 1.0f } } },
{ { 1, 5, 7 }, { 11, 14, 0 }, { { 0.0f, 0.0f, 1.0f, 1.0f } } },
{ { 1, 7, 3 }, { 0, 16, 12 }, { { 0.0f, 0.0f, 1.0f, 1.0f } } },
{ { 3, 0, 1 }, { 0, 8, 12 }, { { -1.0f, 0.0f, 0.0f, 1.0f } } },
{ { 3, 2, 0 }, { 5, 1, 0 }, { { -1.0f, 0.0f, 0.0f, 1.0f } } },
{ { 1, 0, 4 }, { 8, 9, 0 }, { { 0.0f, -1.0f, 0.0f, 1.0f } } },
{ { 1, 4, 5 }, { 0, 3, 11 }, { { 0.0f, -1.0f, 0.0f, 1.0f } } },
{ { 0, 6, 4 }, { 0, 4, 9 }, { { 0.0f, 0.0f, -1.0f, 1.0f } } },
{ { 0, 2, 6 }, { 1, 6, 0 }, { { 0.0f, 0.0f, -1.0f, 1.0f } } },
};
br_colour bounds_colours[12] = { 0 };
fmt_vertex bounds_vertices[8] = {
{ {{ -1.0f, -1.0f, -1.0f }}, {{ 0.0f, 0.0f }}, {{ -0.666f, -0.333f, -0.666f }} },
{ {{ -1.0f, -1.0f, 1.0f }}, {{ 0.0f, 0.0f }}, {{ -0.333f, -0.666f, 0.666f }} },
{ {{ -1.0f, 1.0f, -1.0f }}, {{ 0.0f, 1.0f }}, {{ -0.408f, 0.816f, -0.408f }} },
{ {{ -1.0f, 1.0f, 1.0f }}, {{ 0.0f, 1.0f }}, {{ -0.816f, 0.408f, 0.408f }} },
{ {{ 1.0f, -1.0f, -1.0f }}, {{ 1.0f, 0.0f }}, {{ 0.408f, -0.816f, -0.408f }} },
{ {{ 1.0f, -1.0f, 1.0f }}, {{ 1.0f, 0.0f }}, {{ 0.816f, -0.408f, 0.408f }} },
{ {{ 1.0f, 1.0f, -1.0f }}, {{ 1.0f, 1.0f }}, {{ 0.666f, 0.333f, -0.666f }} },
{ {{ 1.0f, 1.0f, 1.0f }}, {{ 1.0f, 1.0f }}, {{ 0.333f, 0.666f, 0.666f }} },
{ { { -1.0f, -1.0f, -1.0f } }, { { 0.0f, 0.0f } }, { { -0.666f, -0.333f, -0.666f } } },
{ { { -1.0f, -1.0f, 1.0f } }, { { 0.0f, 0.0f } }, { { -0.333f, -0.666f, 0.666f } } },
{ { { -1.0f, 1.0f, -1.0f } }, { { 0.0f, 1.0f } }, { { -0.408f, 0.816f, -0.408f } } },
{ { { -1.0f, 1.0f, 1.0f } }, { { 0.0f, 1.0f } }, { { -0.816f, 0.408f, 0.408f } } },
{ { { 1.0f, -1.0f, -1.0f } }, { { 1.0f, 0.0f } }, { { 0.408f, -0.816f, -0.408f } } },
{ { { 1.0f, -1.0f, 1.0f } }, { { 1.0f, 0.0f } }, { { 0.816f, -0.408f, 0.408f } } },
{ { { 1.0f, 1.0f, -1.0f } }, { { 1.0f, 1.0f } }, { { 0.666f, 0.333f, -0.666f } } },
{ { { 1.0f, 1.0f, 1.0f } }, { { 1.0f, 1.0f } }, { { 0.333f, 0.666f, 0.666f } } },
};
v11group bounds_face_groups[1] = {
{ NULL, bounds_faces, bounds_colours, NULL, bounds_vertices, bounds_colours, NULL, BR_ASIZE(bounds_faces), BR_ASIZE(bounds_vertices), 18 },
Expand All @@ -64,7 +64,7 @@ br_model bounds_model = {
// IDA: void __usercall renderFaces(br_actor *actor@<EAX>, br_model *model@<EDX>, br_material *material@<EBX>, void *render_data@<ECX>, br_uint_8 style, int on_screen)
void renderFaces(br_actor* actor, br_model* model, br_material* material, void* render_data, br_uint_8 style, int on_screen) {
LOG_TRACE9("(%p, %p, %p, %p, %d, %d)", actor, model, material, render_data, style, on_screen);
Harness_Hook_renderFaces(model, material, BRT_TRIANGLE);
Harness_Hook_renderFaces(actor, model, material, BRT_TRIANGLE);
}

// IDA: void __usercall renderEdges(br_actor *actor@<EAX>, br_model *model@<EDX>, br_material *material@<EBX>, void *render_data@<ECX>, br_uint_8 style, int on_screen)
Expand Down Expand Up @@ -123,11 +123,11 @@ br_model* makeMeshFromBounds(br_bounds* b) {
bounds_vertices[7].p.v[2] = b->max.v[2];

// 2. Modify d in the face equation (a*x+b*y+c*y+d=0)
for (i = 0; i < BR_ASIZE(bounds_faces)/4; i++) {
bounds_faces[2*i+0].eqn.v[3] = b->min.v[i];
bounds_faces[2*i+1].eqn.v[3] = b->min.v[i];
bounds_faces[2*i+6].eqn.v[3] = b->max.v[i];
bounds_faces[2*i+7].eqn.v[3] = b->max.v[i];
for (i = 0; i < BR_ASIZE(bounds_faces) / 4; i++) {
bounds_faces[2 * i + 0].eqn.v[3] = b->min.v[i];
bounds_faces[2 * i + 1].eqn.v[3] = b->min.v[i];
bounds_faces[2 * i + 6].eqn.v[3] = b->max.v[i];
bounds_faces[2 * i + 7].eqn.v[3] = b->max.v[i];
}

// 3. Copy bounds
Expand Down
107 changes: 97 additions & 10 deletions src/DETHRACE/common/depth.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "errors.h"
#include "globvars.h"
#include "globvrkm.h"
#include "harness/hooks.h"
#include "harness/trace.h"
#include "spark.h"
#include "utility.h"
Expand Down Expand Up @@ -261,7 +262,66 @@ void DoDepthByShadeTable(br_pixelmap* pRender_buffer, br_pixelmap* pDepth_buffer
int depth_line_skip;
int render_line_skip;
LOG_TRACE("(%p, %p, %p, %d, %d, %d)", pRender_buffer, pDepth_buffer, pShade_table, pShade_table_power, pStart, pEnd);
NOT_IMPLEMENTED();

// Added to ensure we've copied the framebuffer+depthbuffer back into main memory
Harness_Hook_FlushRenderer();

too_near = 0xffff - (1 << pStart);
shade_table_pixels = pShade_table->pixels;
depth_shift_amount = pShade_table_power + 8 - pStart - pEnd;
render_ptr = (tU8*)pRender_buffer->pixels + pRender_buffer->base_x + pRender_buffer->base_y * pRender_buffer->row_bytes;
depth_ptr = pDepth_buffer->pixels;
render_line_skip = pRender_buffer->row_bytes - pRender_buffer->width;
depth_line_skip = pDepth_buffer->row_bytes / 2 - pRender_buffer->width;

if (depth_shift_amount <= 0) {
if (depth_shift_amount >= 0) {
for (y = 0; pRender_buffer->height > y; ++y) {
for (x = 0; pRender_buffer->width > x; ++x) {
if (*depth_ptr != 0xFFFF) {
depth_value = *depth_ptr - too_near;
if (depth_value < -(int16_t)too_near) {
*render_ptr = shade_table_pixels[(depth_value & 0xFF00) + *render_ptr];
}
}
++render_ptr;
++depth_ptr;
}
render_ptr += render_line_skip;
depth_ptr += depth_line_skip;
}
} else {
for (y = 0; pRender_buffer->height > y; ++y) {
for (x = 0; pRender_buffer->width > x; ++x) {
if (*depth_ptr != 0xFFFF) {
depth_value = *depth_ptr - too_near;
if (depth_value < -(int16_t)too_near) {
*render_ptr = shade_table_pixels[*render_ptr + ((depth_value >> (pEnd - (pShade_table_power + 8 - pStart))) & 0xFF00)];
}
}
++render_ptr;
++depth_ptr;
}
render_ptr += render_line_skip;
depth_ptr += depth_line_skip;
}
}
} else {
for (y = 0; pRender_buffer->height > y; ++y) {
for (x = 0; pRender_buffer->width > x; ++x) {
if (*depth_ptr != 0xFFFF) {
depth_value = *depth_ptr - too_near;
if (depth_value < -(int16_t)too_near) {
*render_ptr = shade_table_pixels[*render_ptr + ((depth_value << depth_shift_amount) & 0xFF00)];
}
}
++render_ptr;
++depth_ptr;
}
render_ptr += render_line_skip;
depth_ptr += depth_line_skip;
}
}
}

// IDA: void __usercall ExternalSky(br_pixelmap *pRender_buffer@<EAX>, br_pixelmap *pDepth_buffer@<EDX>, br_actor *pCamera@<EBX>, br_matrix34 *pCamera_to_world@<ECX>)
Expand All @@ -288,6 +348,8 @@ void ExternalSky(br_pixelmap* pRender_buffer, br_pixelmap* pDepth_buffer, br_act
int repetitions;
br_pixelmap* col_map;
LOG_TRACE("(%p, %p, %p, %p)", pRender_buffer, pDepth_buffer, pCamera, pCamera_to_world);

// TODO: Remove commented block in `ConditionallyFillWithSky` when we implement this properly
return;
dx = 0;
col_map = gHorizon_material->colour_map;
Expand Down Expand Up @@ -369,31 +431,56 @@ void DoHorizon(br_pixelmap* pRender_buffer, br_pixelmap* pDepth_buffer, br_actor
br_angle yaw;
br_actor* actor;
LOG_TRACE("(%p, %p, %p, %p)", pRender_buffer, pDepth_buffer, pCamera, pCamera_to_world);
NOT_IMPLEMENTED();

STUB_ONCE();
}

// IDA: void __usercall DoDepthCue(br_pixelmap *pRender_buffer@<EAX>, br_pixelmap *pDepth_buffer@<EDX>)
void DoDepthCue(br_pixelmap* pRender_buffer, br_pixelmap* pDepth_buffer) {
LOG_TRACE("(%p, %p)", pRender_buffer, pDepth_buffer);
NOT_IMPLEMENTED();

DoDepthByShadeTable(
pRender_buffer,
pDepth_buffer,
gDepth_shade_table,
gDepth_shade_table_power,
gProgram_state.current_depth_effect.start,
gProgram_state.current_depth_effect.end);
}

// IDA: void __usercall DoFog(br_pixelmap *pRender_buffer@<EAX>, br_pixelmap *pDepth_buffer@<EDX>)
void DoFog(br_pixelmap* pRender_buffer, br_pixelmap* pDepth_buffer) {
LOG_TRACE("(%p, %p)", pRender_buffer, pDepth_buffer);
NOT_IMPLEMENTED();

DoDepthByShadeTable(
pRender_buffer,
pDepth_buffer,
gFog_shade_table,
gFog_shade_table_power,
gProgram_state.current_depth_effect.start,
gProgram_state.current_depth_effect.end);
}

// IDA: void __usercall DepthEffect(br_pixelmap *pRender_buffer@<EAX>, br_pixelmap *pDepth_buffer@<EDX>, br_actor *pCamera@<EBX>, br_matrix34 *pCamera_to_world@<ECX>)
void DepthEffect(br_pixelmap* pRender_buffer, br_pixelmap* pDepth_buffer, br_actor* pCamera, br_matrix34* pCamera_to_world) {
LOG_TRACE("(%p, %p, %p, %p)", pRender_buffer, pDepth_buffer, pCamera, pCamera_to_world);
STUB_ONCE();

if (gProgram_state.current_depth_effect.type == eDepth_effect_darkness) {
DoDepthCue(pRender_buffer, pDepth_buffer);
}
if (gProgram_state.current_depth_effect.type == eDepth_effect_fog) {
DoFog(pRender_buffer, pDepth_buffer);
}
}

// IDA: void __usercall DepthEffectSky(br_pixelmap *pRender_buffer@<EAX>, br_pixelmap *pDepth_buffer@<EDX>, br_actor *pCamera@<EBX>, br_matrix34 *pCamera_to_world@<ECX>)
void DepthEffectSky(br_pixelmap* pRender_buffer, br_pixelmap* pDepth_buffer, br_actor* pCamera, br_matrix34* pCamera_to_world) {
LOG_TRACE("(%p, %p, %p, %p)", pRender_buffer, pDepth_buffer, pCamera, pCamera_to_world);
STUB_ONCE();

if (gProgram_state.current_depth_effect.sky_texture
&& (!gLast_camera_special_volume || gLast_camera_special_volume->sky_col < 0)) {
DoHorizon(pRender_buffer, pDepth_buffer, pCamera, pCamera_to_world);
}
}

// IDA: void __usercall DoWobbleCamera(br_actor *pCamera@<EAX>)
Expand Down Expand Up @@ -584,8 +671,8 @@ void IncreaseAngle() {

for (i = 0; i < COUNT_OF(gCamera_list); i++) {
camera_ptr = gCamera_list[i]->type_data;
camera_ptr->field_of_view += 0x1c7; // 2.4993896484375 degrees
if (camera_ptr->field_of_view > 0x78e3) { // 169.9969482421875 degrees
camera_ptr->field_of_view += 0x1c7; // 2.4993896484375 degrees
if (camera_ptr->field_of_view > 0x78e3) { // 169.9969482421875 degrees
camera_ptr->field_of_view = 0x78e3;
}
#ifdef DETHRACE_FIX_BUGS
Expand All @@ -606,8 +693,8 @@ void DecreaseAngle() {

for (i = 0; i < COUNT_OF(gCamera_list); i++) {
camera_ptr = gCamera_list[i]->type_data;
camera_ptr->field_of_view -= 0x1c7; // 2.4993896484375 degrees
if (camera_ptr->field_of_view < 0x71c) { // 9.99755859375 degrees
camera_ptr->field_of_view -= 0x1c7; // 2.4993896484375 degrees
if (camera_ptr->field_of_view < 0x71c) { // 9.99755859375 degrees
camera_ptr->field_of_view = 0x71c;
}
#ifdef DETHRACE_FIX_BUGS
Expand Down
22 changes: 19 additions & 3 deletions src/DETHRACE/common/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,24 @@ int ConditionallyFillWithSky(br_pixelmap* pPixelmap) {
int bgnd_col;
LOG_TRACE("(%p)", pPixelmap);

STUB_ONCE();
return 0;
// TODO: Uncomment when ExternalSky is fully implemented
dethrace-labs marked this conversation as resolved.
Show resolved Hide resolved
// if (gProgram_state.current_depth_effect.sky_texture
// && (!gLast_camera_special_volume || gLast_camera_special_volume->sky_col < 0)) {
// return 0;
// }
if (gProgram_state.current_depth_effect.type == eDepth_effect_fog || gSwap_depth_effect_type == eDepth_effect_fog) {
bgnd_col = 255;
} else if (gProgram_state.current_depth_effect.type && gSwap_depth_effect_type) {
if (gLast_camera_special_volume && gLast_camera_special_volume->sky_col >= 0) {
bgnd_col = gLast_camera_special_volume->sky_col;
} else {
bgnd_col = 0;
}
} else {
bgnd_col = 0;
}
BrPixelmapFill(pPixelmap, bgnd_col);
return 1;
}

// IDA: void __usercall RenderAFrame(int pDepth_mask_on@<EAX>)
Expand Down Expand Up @@ -2295,7 +2311,7 @@ void TellyOutImage(br_pixelmap* pImage, int pLeft, int pTop) {
// IDA: void __usercall SetShadowLevel(tShadow_level pLevel@<EAX>)
void SetShadowLevel(tShadow_level pLevel) {
LOG_TRACE("(%d)", pLevel);

gShadow_level = pLevel;
}

Expand Down
Loading