Rev 15 | Rev 20 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 15 | Rev 18 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include "graphics.h" |
1 | #include "graphics.h" |
2 | 2 | ||
3 | #include " |
3 | #include "brender.h" |
4 | #include "car.h" |
4 | #include "car.h" |
5 | #include "constants.h" |
5 | #include "constants.h" |
6 | #include "controls.h" |
6 | #include "controls.h" |
7 | #include "depth.h" |
7 | #include "depth.h" |
8 | #include "displays.h" |
8 | #include "displays.h" |
Line 705... | Line 705... | ||
705 | gEval_1 = LoadPixelmap("Evalu01.PIX"); |
705 | gEval_1 = LoadPixelmap("Evalu01.PIX"); |
706 | } |
706 | } |
707 | 707 | ||
708 | // IDA: void __usercall SwitchToPalette(char *pPal_name@<EAX>) |
708 | // IDA: void __usercall SwitchToPalette(char *pPal_name@<EAX>) |
709 | void SwitchToPalette(char* pPal_name) { |
709 | void SwitchToPalette(char* pPal_name) { |
710 |
|
710 | br_pixelmap* the_palette; |
711 | LOG_TRACE("(\"%s\")", pPal_name); |
711 | LOG_TRACE("(\"%s\")", pPal_name); |
- | 712 | ||
- | 713 | the_palette = BrTableFind(pPal_name); |
|
712 |
|
714 | if (the_palette != NULL) { |
- | 715 | DRSetPalette(the_palette); |
|
- | 716 | } |
|
713 | } |
717 | } |
714 | 718 | ||
715 | // IDA: void __cdecl ClearEntireScreen() |
719 | // IDA: void __cdecl ClearEntireScreen() |
716 | void ClearEntireScreen(void) { |
720 | void ClearEntireScreen(void) { |
717 | LOG_TRACE("()"); |
721 | LOG_TRACE("()"); |
Line 828... | Line 832... | ||
828 | gScreen_wobble_y = gCurrent_graf_data->cock_margin_y; |
832 | gScreen_wobble_y = gCurrent_graf_data->cock_margin_y; |
829 | } else if (gScreen_wobble_y < -gCurrent_graf_data->cock_margin_y) { |
833 | } else if (gScreen_wobble_y < -gCurrent_graf_data->cock_margin_y) { |
830 | gScreen_wobble_y = -gCurrent_graf_data->cock_margin_y; |
834 | gScreen_wobble_y = -gCurrent_graf_data->cock_margin_y; |
831 | } |
835 | } |
832 | PipeSingleScreenShake(gScreen_wobble_x, gScreen_wobble_y); |
836 | PipeSingleScreenShake(gScreen_wobble_x, gScreen_wobble_y); |
833 | } |
837 | } |
834 | 838 | ||
835 | // IDA: void __usercall CalculateConcussion(tU32 pThe_time@<EAX>) |
839 | // IDA: void __usercall CalculateConcussion(tU32 pThe_time@<EAX>) |
836 | void CalculateConcussion(tU32 pThe_time) { |
840 | void CalculateConcussion(tU32 pThe_time) { |
837 | tU32 time_difference; |
841 | tU32 time_difference; |
838 | int i; |
842 | int i; |
839 | int j; |
843 | int j; |
Line 1672... | Line 1676... | ||
1672 | BrZbSceneRenderBegin(gUniverse_actor, gCamera, gRender_screen, gDepth_buffer); |
1676 | BrZbSceneRenderBegin(gUniverse_actor, gCamera, gRender_screen, gDepth_buffer); |
1673 | ProcessNonTrackActors(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world, &old_camera_matrix); |
1677 | ProcessNonTrackActors(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world, &old_camera_matrix); |
1674 | ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gCamera, &gCamera_to_world, 0); |
1678 | ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gCamera, &gCamera_to_world, 0); |
1675 | RenderLollipops(); |
1679 | RenderLollipops(); |
1676 | 1680 | ||
1677 | // dethrace: must flush gpu buffer before rendering depth effect into framebuffer |
- | |
1678 | gHarness_platform.Renderer_FlushBuffers(); |
- | |
1679 | DepthEffectSky(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world); |
1681 | DepthEffectSky(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world); |
1680 | DepthEffect(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world); |
1682 | DepthEffect(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world); |
1681 | if (!gAusterity_mode) { |
1683 | if (!gAusterity_mode) { |
1682 | ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gCamera, &gCamera_to_world, 1); |
1684 | ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gCamera, &gCamera_to_world, 1); |
1683 | } |
1685 | } |
1684 | RenderSplashes(); |
1686 | RenderSplashes(); |
1685 | // dethrace: must flush gpu buffer before rendering smoke into framebuffer |
- | |
1686 | gHarness_platform.Renderer_FlushBuffers(); |
- | |
1687 | RenderSmoke(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world, gFrame_period); |
1687 | RenderSmoke(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world, gFrame_period); |
1688 | RenderSparks(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world, gFrame_period); |
1688 | RenderSparks(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world, gFrame_period); |
1689 | RenderProximityRays(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world, gFrame_period); |
1689 | RenderProximityRays(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world, gFrame_period); |
1690 | BrZbSceneRenderEnd(); |
1690 | BrZbSceneRenderEnd(); |
1691 | } |
1691 | } |
1692 | BrMatrix34Copy(&gCamera->t.t.mat, &old_camera_matrix); |
1692 | BrMatrix34Copy(&gCamera->t.t.mat, &old_camera_matrix); |
1693 | if (gMirror_on__graphics) { |
1693 | if (gMirror_on__graphics) { |
1694 | LOG_WARN_ONCE("rearview mirror not implemented"); |
- | |
1695 |
|
1694 | BrPixelmapFill(gRearview_depth_buffer, 0xFFFFFFFF); |
1696 |
|
1695 | gRendering_mirror = 1; |
1697 |
|
1696 | DoSpecialCameraEffect(gRearview_camera, &gRearview_camera_to_world); |
1698 |
|
1697 | ConditionallyFillWithSky(gRearview_screen); |
1699 |
|
1698 | BrZbSceneRenderBegin(gUniverse_actor, gRearview_camera, gRearview_screen, gRearview_depth_buffer); |
1700 |
|
1699 | ProcessNonTrackActors( |
1701 |
|
1700 | gRearview_screen, |
1702 |
|
1701 | gRearview_depth_buffer, |
1703 |
|
1702 | gRearview_camera, |
1704 |
|
1703 | &gRearview_camera_to_world, |
1705 |
|
1704 | &old_mirror_cam_matrix); |
1706 |
|
1705 | ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gRearview_camera, &gRearview_camera_to_world, 0); |
1707 |
|
1706 | RenderLollipops(); |
1708 |
|
1707 | DepthEffectSky(gRearview_screen, gRearview_depth_buffer, gRearview_camera, &gRearview_camera_to_world); |
1709 |
|
1708 | DepthEffect(gRearview_screen, gRearview_depth_buffer, gRearview_camera, &gRearview_camera_to_world); |
1710 |
|
1709 | if (!gAusterity_mode) { |
1711 |
|
1710 | ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gRearview_camera, &gRearview_camera_to_world, 1); |
1712 |
|
1711 | } |
1713 |
|
1712 | RenderSplashes(); |
1714 |
|
1713 | BrZbSceneRenderEnd(); |
1715 |
|
1714 | BrMatrix34Copy(&gRearview_camera->t.t.mat, &old_mirror_cam_matrix); |
1716 |
|
1715 | gRendering_mirror = 0; |
1717 | } |
1716 | } |
1718 | if (gMap_mode) { |
1717 | if (gMap_mode) { |
1719 | if (gNet_mode == eNet_mode_none) { |
1718 | if (gNet_mode == eNet_mode_none) { |
1720 | GetTimerString(the_text, 0); |
1719 | GetTimerString(the_text, 0); |
1721 | map_timer_width = DRTextWidth(&gFonts[2], the_text); |
1720 | map_timer_width = DRTextWidth(&gFonts[2], the_text); |