Subversion Repositories Games.Carmageddon

Rev

Rev 18 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18 Rev 20
Line 1... Line 1...
1
#include "graphics.h"
1
#include "graphics.h"
2
 
2
 
3
#include "brender.h"
3
#include "brender/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
    br_pixelmap* the_palette;
710
    //br_pixelmap* the_palette; // Pierre-Marie Baty -- unused variable
711
    LOG_TRACE("(\"%s\")", pPal_name);
711
    LOG_TRACE("(\"%s\")", pPal_name);
712
 
-
 
713
    the_palette = BrTableFind(pPal_name);
-
 
714
    if (the_palette != NULL) {
712
    NOT_IMPLEMENTED();
715
        DRSetPalette(the_palette);
-
 
716
    }
-
 
717
}
713
}
718
 
714
 
719
// IDA: void __cdecl ClearEntireScreen()
715
// IDA: void __cdecl ClearEntireScreen()
720
void ClearEntireScreen(void) {
716
void ClearEntireScreen(void) {
721
    LOG_TRACE("()");
717
    LOG_TRACE("()");
Line 832... Line 828...
832
        gScreen_wobble_y = gCurrent_graf_data->cock_margin_y;
828
        gScreen_wobble_y = gCurrent_graf_data->cock_margin_y;
833
    } else if (gScreen_wobble_y < -gCurrent_graf_data->cock_margin_y) {
829
    } else if (gScreen_wobble_y < -gCurrent_graf_data->cock_margin_y) {
834
        gScreen_wobble_y = -gCurrent_graf_data->cock_margin_y;
830
        gScreen_wobble_y = -gCurrent_graf_data->cock_margin_y;
835
    }
831
    }
836
    PipeSingleScreenShake(gScreen_wobble_x, gScreen_wobble_y);
832
    PipeSingleScreenShake(gScreen_wobble_x, gScreen_wobble_y);
837
}
833
}
838
 
834
 
839
// IDA: void __usercall CalculateConcussion(tU32 pThe_time@<EAX>)
835
// IDA: void __usercall CalculateConcussion(tU32 pThe_time@<EAX>)
840
void CalculateConcussion(tU32 pThe_time) {
836
void CalculateConcussion(tU32 pThe_time) {
841
    tU32 time_difference;
837
    tU32 time_difference;
842
    int i;
838
    int i;
843
    int j;
839
    int j;
Line 1676... Line 1672...
1676
        BrZbSceneRenderBegin(gUniverse_actor, gCamera, gRender_screen, gDepth_buffer);
1672
        BrZbSceneRenderBegin(gUniverse_actor, gCamera, gRender_screen, gDepth_buffer);
1677
        ProcessNonTrackActors(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world, &old_camera_matrix);
1673
        ProcessNonTrackActors(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world, &old_camera_matrix);
1678
        ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gCamera, &gCamera_to_world, 0);
1674
        ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gCamera, &gCamera_to_world, 0);
1679
        RenderLollipops();
1675
        RenderLollipops();
1680
 
1676
 
-
 
1677
        // dethrace: must flush gpu buffer before rendering depth effect into framebuffer
-
 
1678
        gHarness_platform.Renderer_FlushBuffers();
1681
        DepthEffectSky(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world);
1679
        DepthEffectSky(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world);
1682
        DepthEffect(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world);
1680
        DepthEffect(gRender_screen, gDepth_buffer, gCamera, &gCamera_to_world);
1683
        if (!gAusterity_mode) {
1681
        if (!gAusterity_mode) {
1684
            ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gCamera, &gCamera_to_world, 1);
1682
            ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gCamera, &gCamera_to_world, 1);
1685
        }
1683
        }
1686
        RenderSplashes();
1684
        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");
1694
        BrPixelmapFill(gRearview_depth_buffer, 0xFFFFFFFF);
1695
        // BrPixelmapFill(gRearview_depth_buffer, 0xFFFFFFFF);
1695
        gRendering_mirror = 1;
1696
        // gRendering_mirror = 1;
1696
        DoSpecialCameraEffect(gRearview_camera, &gRearview_camera_to_world);
1697
        // DoSpecialCameraEffect(gRearview_camera, &gRearview_camera_to_world);
1697
        ConditionallyFillWithSky(gRearview_screen);
1698
        // ConditionallyFillWithSky(gRearview_screen);
1698
        BrZbSceneRenderBegin(gUniverse_actor, gRearview_camera, gRearview_screen, gRearview_depth_buffer);
1699
        // BrZbSceneRenderBegin(gUniverse_actor, gRearview_camera, gRearview_screen, gRearview_depth_buffer);
1699
        ProcessNonTrackActors(
1700
        // ProcessNonTrackActors(
1700
            gRearview_screen,
1701
        //     gRearview_screen,
1701
            gRearview_depth_buffer,
1702
        //     gRearview_depth_buffer,
1702
            gRearview_camera,
1703
        //     gRearview_camera,
1703
            &gRearview_camera_to_world,
1704
        //     &gRearview_camera_to_world,
1704
            &old_mirror_cam_matrix);
1705
        //     &old_mirror_cam_matrix);
1705
        ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gRearview_camera, &gRearview_camera_to_world, 0);
1706
        // ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gRearview_camera, &gRearview_camera_to_world, 0);
1706
        RenderLollipops();
1707
        // RenderLollipops();
1707
        DepthEffectSky(gRearview_screen, gRearview_depth_buffer, gRearview_camera, &gRearview_camera_to_world);
1708
        // DepthEffectSky(gRearview_screen, gRearview_depth_buffer, gRearview_camera, &gRearview_camera_to_world);
1708
        DepthEffect(gRearview_screen, gRearview_depth_buffer, gRearview_camera, &gRearview_camera_to_world);
1709
        // DepthEffect(gRearview_screen, gRearview_depth_buffer, gRearview_camera, &gRearview_camera_to_world);
1709
        if (!gAusterity_mode) {
1710
        // if (!gAusterity_mode) {
1710
            ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gRearview_camera, &gRearview_camera_to_world, 1);
1711
        //     ProcessTrack(gUniverse_actor, &gProgram_state.track_spec, gRearview_camera, &gRearview_camera_to_world, 1);
1711
        }
1712
        // }
1712
        RenderSplashes();
1713
        // RenderSplashes();
1713
        BrZbSceneRenderEnd();
1714
        // BrZbSceneRenderEnd();
1714
        BrMatrix34Copy(&gRearview_camera->t.t.mat, &old_mirror_cam_matrix);
1715
        // BrMatrix34Copy(&gRearview_camera->t.t.mat, &old_mirror_cam_matrix);
1715
        gRendering_mirror = 0;
1716
        // gRendering_mirror = 0;
1716
    }
1717
    }
1717
    if (gMap_mode) {
1718
    if (gMap_mode) {
1718
        if (gNet_mode == eNet_mode_none) {
1719
        if (gNet_mode == eNet_mode_none) {
1719
            GetTimerString(the_text, 0);
1720
            GetTimerString(the_text, 0);
1720
            map_timer_width = DRTextWidth(&gFonts[2], the_text);
1721
            map_timer_width = DRTextWidth(&gFonts[2], the_text);