mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-25 07:44:38 +01:00
Fix Linux build errors
This commit is contained in:
@@ -39,7 +39,7 @@ namespace OpenRCT2
|
||||
|
||||
public:
|
||||
bool IsActive();
|
||||
TextInputSession * TextComposition::Start(utf8 * buffer, size_t bufferSize);
|
||||
TextInputSession * Start(utf8 * buffer, size_t bufferSize);
|
||||
void Stop();
|
||||
void HandleMessage(const SDL_Event * e);
|
||||
|
||||
|
||||
@@ -16,10 +16,14 @@
|
||||
|
||||
#ifndef _MSC_VER
|
||||
|
||||
#include <openrct2/audio/AudioContext.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/ui/UiContext.h>
|
||||
#include "audio/AudioContext.h"
|
||||
#include "UiContext.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
using namespace OpenRCT2::Audio;
|
||||
using namespace OpenRCT2::Ui;
|
||||
|
||||
/**
|
||||
@@ -28,8 +32,10 @@ using namespace OpenRCT2::Ui;
|
||||
int main(int argc, char * * argv)
|
||||
{
|
||||
// Run OpenRCT2 with a UI context
|
||||
IContext * context = CreateContext();
|
||||
IUiContext * uiContext = CreateContext(context);
|
||||
|
||||
IAudioContext * audioContext = CreateAudioContext();
|
||||
IUiContext * uiContext = CreateUiContext();
|
||||
IContext * context = CreateContext(audioContext, uiContext);
|
||||
int exitCode = context->RunOpenRCT2(argc, argv);
|
||||
delete uiContext;
|
||||
delete context;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <sstream>
|
||||
#include <openrct2/common.h>
|
||||
#include <openrct2/core/String.hpp>
|
||||
@@ -154,13 +155,13 @@ namespace OpenRCT2 { namespace Ui
|
||||
|
||||
log_verbose("filename = %s", result.c_str());
|
||||
|
||||
if (desc.Type == FILE_DIALOG_TYPE::OPEN && access(result, F_OK) == -1)
|
||||
if (desc.Type == FILE_DIALOG_TYPE::OPEN && access(result.c_str(), F_OK) == -1)
|
||||
{
|
||||
std::string msg = String::StdFormat("\"%s\" not found: %s, please choose another file\n", result.c_str(), strerror(errno));
|
||||
ShowMessageBox(window, msg);
|
||||
return ShowFileDialog(window, desc);
|
||||
}
|
||||
else if (desc.Type == FILE_DIALOG_TYPE::SAVE && access(result, F_OK) != -1 && dtype == DIALOG_TYPE::KDIALOG)
|
||||
else if (desc.Type == FILE_DIALOG_TYPE::SAVE && access(result.c_str(), F_OK) != -1 && dtype == DIALOG_TYPE::KDIALOG)
|
||||
{
|
||||
std::string cmd = String::StdFormat("%s --yesno \"Overwrite %s?\"", executablePath, result.c_str());
|
||||
if (Execute(cmd) != 0)
|
||||
@@ -274,7 +275,7 @@ namespace OpenRCT2 { namespace Ui
|
||||
{
|
||||
// KDialog wants filters space-delimited and we don't expect ';' anywhere else
|
||||
std::string pattern = filter.Pattern;
|
||||
for (sint32 i = 0; i < pattern.size(); i++)
|
||||
for (size_t i = 0; i < pattern.size(); i++)
|
||||
{
|
||||
if (pattern[i] == ';')
|
||||
{
|
||||
@@ -299,7 +300,6 @@ namespace OpenRCT2 { namespace Ui
|
||||
{
|
||||
// Zenity seems to be case sensitive, while KDialog isn't
|
||||
std::stringstream filtersb;
|
||||
bool first = true;
|
||||
for (const auto &filter : filters)
|
||||
{
|
||||
filtersb << " --file-filter='" << filter.Name << " | ";
|
||||
|
||||
@@ -23,6 +23,7 @@ extern "C"
|
||||
{
|
||||
#include "audio/audio.h"
|
||||
#include "platform/platform.h"
|
||||
#include "rct2.h"
|
||||
}
|
||||
|
||||
extern "C"
|
||||
|
||||
@@ -46,23 +46,6 @@
|
||||
utf8 _userDataDirectoryPath[MAX_PATH] = { 0 };
|
||||
utf8 _openrctDataDirectoryPath[MAX_PATH] = { 0 };
|
||||
|
||||
/**
|
||||
* The main entry point for non-Windows platforms.
|
||||
*/
|
||||
sint32 main(sint32 argc, const char **argv)
|
||||
{
|
||||
core_init();
|
||||
|
||||
sint32 exitCode = cmdline_run(argv, argc);
|
||||
if (exitCode == 1)
|
||||
{
|
||||
openrct2_launch();
|
||||
exitCode = gExitCode;
|
||||
}
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
void platform_get_date_utc(rct2_date *out_date)
|
||||
{
|
||||
assert(out_date != NULL);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../common.h"
|
||||
#include "../Context.h"
|
||||
|
||||
Reference in New Issue
Block a user