| 2940 | } |
| 2941 | |
| 2942 | bool GDRESettings::main_iteration() { |
| 2943 | // For testing, we can't call Main::iteration() because Main hasn't been set up. |
| 2944 | // We only attempt to sync the renderingserver to flush the messages queue during testing. |
| 2945 | #ifdef TESTS_ENABLED |
| 2946 | if (GDRESettings::testing) { |
| 2947 | if (RenderingServer::get_singleton()) { |
| 2948 | RenderingServer::get_singleton()->sync(); |
| 2949 | if (MessageQueue::get_singleton() && !MessageQueue::get_singleton()->is_flushing()) { |
| 2950 | MessageQueue::get_singleton()->flush(); |
| 2951 | } |
| 2952 | } |
| 2953 | return false; |
| 2954 | } |
| 2955 | #endif |
| 2956 | return Main::iteration(); |
| 2957 | } |
| 2958 | |
| 2959 | #ifdef TESTS_ENABLED |
| 2960 | bool GDRESettings::testing = false; |