Skip to content

Commit

Permalink
Cleaned up commented-out code
Browse files Browse the repository at this point in the history
  • Loading branch information
apples committed Jul 19, 2024
1 parent d445ea7 commit 7bacef0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 52 deletions.
54 changes: 4 additions & 50 deletions servers/display_server_offscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,6 @@ DisplayServer::WindowID DisplayServerOffscreen::create_sub_window(WindowMode p_m
wd.layered_window = true;
}

#ifdef RD_ENABLED
if (rendering_device) {
//rendering_device->screen_create(window_id);
}
#endif

return window_id;
}

Expand Down Expand Up @@ -163,16 +157,6 @@ void DisplayServerOffscreen::delete_sub_window(WindowID p_window) {
window_set_transient(p_window, INVALID_WINDOW_ID);
}

#ifdef RD_ENABLED
if (rendering_device) {
//rendering_device->screen_free(p_window);
}

if (rendering_context) {
//rendering_context->window_destroy(p_window);
}
#endif

windows.erase(p_window);

if (last_focused_window == p_window) {
Expand Down Expand Up @@ -376,12 +360,6 @@ void DisplayServerOffscreen::window_set_size(const Size2i p_size, WindowID p_win
}

wd.size = p_size;

#if defined(RD_ENABLED)
if (rendering_context) {
//rendering_context->window_set_size(p_window, p_size.width, p_size.height);
}
#endif
}

Size2i DisplayServerOffscreen::window_get_size(WindowID p_window) const {
Expand Down Expand Up @@ -477,8 +455,6 @@ bool DisplayServerOffscreen::window_is_maximize_allowed(WindowID p_window) const

ERR_FAIL_COND_V(!windows.has(p_window), false);

// FIXME: Implement this, or confirm that it should always be true.

return true;
}

Expand Down Expand Up @@ -602,32 +578,23 @@ void DisplayServerOffscreen::force_process_and_drop_events() {
}

void DisplayServerOffscreen::release_rendering_thread() {
// Do nothing.
}

void DisplayServerOffscreen::swap_buffers() {
// Do nothing.
}

void DisplayServerOffscreen::window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window) {
_THREAD_SAFE_METHOD_
#if defined(RD_ENABLED)
if (rendering_context) {
//rendering_context->window_set_vsync_mode(p_window, p_vsync_mode);
}
#endif
// Do nothing.
}

DisplayServer::VSyncMode DisplayServerOffscreen::window_get_vsync_mode(WindowID p_window) const {
_THREAD_SAFE_METHOD_
#if defined(RD_ENABLED)
if (rendering_context) {
// return rendering_context->window_get_vsync_mode(p_window);
}
#endif

return DisplayServer::VSYNC_ENABLED;
}

void DisplayServerOffscreen::set_context(Context p_context) {
// Do nothing.
}

DisplayServer::WindowID DisplayServerOffscreen::window_get_active_popup() const {
Expand Down Expand Up @@ -802,7 +769,6 @@ DisplayServerOffscreen::DisplayServerOffscreen(const String &p_rendering_driver,
if (rendering_context) {
rendering_device = memnew(RenderingDevice);
rendering_device->initialize(rendering_context, INVALID_WINDOW_ID);
//rendering_device->screen_create(MAIN_WINDOW_ID);

RendererCompositorRD::make_current();
}
Expand Down Expand Up @@ -858,18 +824,6 @@ DisplayServer *DisplayServerOffscreen::create_func(const String &p_rendering_dri
}

DisplayServerOffscreen::~DisplayServerOffscreen() {
if (windows.has(MAIN_WINDOW_ID)) {
#ifdef RD_ENABLED
if (rendering_device) {
//rendering_device->screen_free(MAIN_WINDOW_ID);
}

if (rendering_context) {
//rendering_context->window_destroy(MAIN_WINDOW_ID);
}
#endif
}

#ifdef RD_ENABLED
if (rendering_device) {
memdelete(rendering_device);
Expand Down
1 change: 0 additions & 1 deletion servers/display_server_offscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class DisplayServerOffscreen : public DisplayServer {
RenderingDevice *rendering_device = nullptr;
#endif

int pressrc;
String rendering_driver;

struct WindowData {
Expand Down
2 changes: 1 addition & 1 deletion servers/rendering_context_driver_vulkan_headless.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class RenderingContextDriverVulkanHeadless : public RenderingContextDriverVulkan
struct WindowPlatformData {};

RenderingContextDriverVulkanHeadless();
~RenderingContextDriverVulkanHeadless() override final;
~RenderingContextDriverVulkanHeadless() override;
};

#endif // VULKAN_ENABLED
Expand Down

0 comments on commit 7bacef0

Please sign in to comment.