mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Rewrite rendering engine (#6253)
* Clean draw_*() arguments * Split rendering core * Add anaglyph 3D * Interlaced 3D * Drop obsolete methods
This commit is contained in:
parent
65c5539035
commit
28841961ba
25 changed files with 1008 additions and 618 deletions
22
src/game.cpp
22
src/game.cpp
|
@ -1656,6 +1656,8 @@ bool Game::startup(bool *kill,
|
|||
if (!createClient(playername, password, address, port))
|
||||
return false;
|
||||
|
||||
RenderingEngine::initialize(client, hud);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1745,6 +1747,7 @@ void Game::run()
|
|||
|
||||
void Game::shutdown()
|
||||
{
|
||||
RenderingEngine::finalize();
|
||||
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR <= 8
|
||||
if (g_settings->get("3d_mode") == "pageflip") {
|
||||
driver->setRenderTarget(irr::video::ERT_STEREO_BOTH_BUFFERS);
|
||||
|
@ -4339,9 +4342,20 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
|
|||
TimeTaker tt_draw("mainloop: draw");
|
||||
driver->beginScene(true, true, skycolor);
|
||||
|
||||
RenderingEngine::draw_scene(camera, client, player, hud, mapper,
|
||||
guienv, screensize, skycolor, flags.show_hud,
|
||||
flags.show_minimap);
|
||||
bool draw_wield_tool = (flags.show_hud &&
|
||||
(player->hud_flags & HUD_FLAG_WIELDITEM_VISIBLE) &&
|
||||
(camera->getCameraMode() == CAMERA_MODE_FIRST));
|
||||
bool draw_crosshair = (
|
||||
(player->hud_flags & HUD_FLAG_CROSSHAIR_VISIBLE) &&
|
||||
(camera->getCameraMode() != CAMERA_MODE_THIRD_FRONT));
|
||||
#ifdef HAVE_TOUCHSCREENGUI
|
||||
try {
|
||||
draw_crosshair = !g_settings->getBool("touchtarget");
|
||||
} catch (SettingNotFoundException) {
|
||||
}
|
||||
#endif
|
||||
RenderingEngine::draw_scene(skycolor, flags.show_hud, flags.show_minimap,
|
||||
draw_wield_tool, draw_crosshair);
|
||||
|
||||
/*
|
||||
Profiler graph
|
||||
|
@ -4402,7 +4416,7 @@ inline static const char *yawToDirectionString(int yaw)
|
|||
|
||||
void Game::updateGui(const RunStats &stats, f32 dtime, const CameraOrientation &cam)
|
||||
{
|
||||
v2u32 screensize = driver->getScreenSize();
|
||||
v2u32 screensize = RenderingEngine::get_instance()->getWindowSize();
|
||||
LocalPlayer *player = client->getEnv().getLocalPlayer();
|
||||
v3f player_position = player->getPosition();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue