/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see .
*/
#include "precompiled.h"
#include "ScenarioEditor.h"
#include "wx/busyinfo.h"
#include "wx/clipbrd.h"
#include "wx/config.h"
#include "wx/dir.h"
#include "wx/evtloop.h"
#include "wx/ffile.h"
#include "wx/filename.h"
#include "wx/image.h"
#include "wx/sstream.h"
#include "wx/sysopt.h"
#include "wx/tooltip.h"
#include "wx/xml/xml.h"
#include "General/AtlasEventLoop.h"
#include "General/Datafile.h"
#include "CustomControls/Buttons/ToolButton.h"
#include "CustomControls/Canvas/Canvas.h"
#include "CustomControls/HighResTimer/HighResTimer.h"
#include "CustomControls/MapDialog/MapDialog.h"
#include "GameInterface/MessagePasser.h"
#include "GameInterface/Messages.h"
#include "Misc/KeyMap.h"
#include "Tools/Common/Tools.h"
#include "Tools/Common/Brushes.h"
#include "Tools/Common/MiscState.h"
static HighResTimer g_Timer;
/**
* wxWidgets only registers the double click on mousedown.
*/
static int g_Clicks = 1;
using namespace AtlasMessage;
enum TIMER_TYPE
{
TIMER_TOOL,
TIMER_RENDER
};
const int TIMER_TOOL_INTERVAL = 16;
const int TIMER_RENDER_INTERVAL = 16;
const int TIMER_RENDER_SLOW_INTERVAL = 200;
// This records the last activity on the WX side.
double last_wx_user_activity = 0.0;
//////////////////////////////////////////////////////////////////////////
// GL functions exported from DLL, and called by game (in a separate
// thread to the standard wx one)
ATLASDLLIMPEXP void Atlas_GLSetCurrent(void* canvas)
{
static_cast