MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / GameRenderWorld

Function GameRenderWorld

Descent3/GameLoop.cpp:2453–2499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2451#endif
2452
2453void GameRenderWorld(object *viewer, vector *viewer_eye, int viewer_roomnum, matrix *viewer_orient, float zoom,
2454 bool rear_view) {
2455 matrix temp_orient, save_orient;
2456
2457 // Get the viewer orientation
2458 if (rear_view) {
2459 temp_orient.fvec = -viewer_orient->fvec;
2460 temp_orient.rvec = -viewer_orient->rvec;
2461 temp_orient.uvec = viewer_orient->uvec;
2462 viewer_orient = &temp_orient;
2463 save_orient = viewer->orient;
2464 viewer->orient = temp_orient;
2465 }
2466
2467 // Start the 3D
2468 g3_StartFrame(viewer_eye, viewer_orient, zoom);
2469
2470 // Reset fog,zbuffer
2471 Num_fogged_rooms_this_frame = 0;
2472 rend_SetZBufferState(1);
2473 rend_SetZBufferWriteMask(1);
2474
2475 // Reset our postrenderings
2476 ResetPostrenderList();
2477
2478 // Render!
2479 if (ROOMNUM_OUTSIDE(viewer_roomnum))
2480 RenderTerrain(0);
2481 else {
2482 bool flag_automap = (viewer != NULL) ? (viewer->type != OBJ_ROBOT) : 0;
2483 RenderMine(viewer_roomnum, flag_automap, 0);
2484
2485#ifdef _DEBUG
2486 if (Game_show_portal_vis_pnts) {
2487 DrawRoomVisPnts(Player_object);
2488 }
2489#endif
2490 }
2491
2492 // Done with 3D
2493 PostRender(viewer_roomnum);
2494 g3_EndFrame();
2495
2496 // Restore viewer orientation
2497 if (rear_view)
2498 viewer->orient = save_orient;
2499}
2500
2501// Render into the big window
2502void GameDrawMainView() {

Callers 3

GameDrawMainViewFunction · 0.85
SGSSnapshotFunction · 0.85
RenderSmallWindowFunction · 0.85

Calls 9

g3_StartFrameFunction · 0.85
ResetPostrenderListFunction · 0.85
RenderTerrainFunction · 0.85
RenderMineFunction · 0.85
DrawRoomVisPntsFunction · 0.85
PostRenderFunction · 0.85
g3_EndFrameFunction · 0.85
rend_SetZBufferStateFunction · 0.50
rend_SetZBufferWriteMaskFunction · 0.50

Tested by

no test coverage detected