This commit is contained in:
DepressedTWM 2026-07-06 23:30:39 +04:00
parent 6b4dd52ae0
commit 98abf1ecd8
17 changed files with 161 additions and 51 deletions

View file

@ -78,6 +78,7 @@ set(MAIN_HEADERS
src/modloader.h src/modloader.h
src/sunshine.h src/sunshine.h
src/lightmap.h src/lightmap.h
src/define.h
) )
set(MAIN_SOURCE set(MAIN_SOURCE
@ -311,7 +312,8 @@ else()
add_compile_options(-march=native -mtune=native) add_compile_options(-march=native -mtune=native)
endif() endif()
if(DEBUG) if(DEBUG)
add_compile_options(-g3 -O0 -fno-omit-frame-pointer -ggdb -fcheck-new -gbtf) add_compile_options(-g3 -fno-omit-frame-pointer)
#add_compile_options(-g3 -O0 -fno-omit-frame-pointer -ggdb -fcheck-new -gbtf)
else() else()
add_compile_options(-O2 -ffast-math -fipa-pta -ftree-vectorize -fstdarg-opt -fomit-frame-pointer -frename-registers add_compile_options(-O2 -ffast-math -fipa-pta -ftree-vectorize -fstdarg-opt -fomit-frame-pointer -frename-registers
-ffunction-sections -fdata-sections -fvisibility=hidden) -ffunction-sections -fdata-sections -fvisibility=hidden)

View file

@ -1,10 +1,9 @@
# О состоянии портов # Операционные системы
| Платформа | Завершено | Состояние | | Платформа | Завершено | Состояние |
| Platform | Done % | State | | Platform | Done % | State |
| :--- | :---: | :--- | | :--- | :---: | :--- |
| Windows | 100% | Играбельно | | Windows | 100% | Играбельно |
| Linux | 90% | В работе, но уже играбельно<br>TODO:<br>&nbsp;* Fix Wallpaper manager | | Linux | 91% | В работе, но уже играбельно<br>TODO:<br>&nbsp;* Fix Wallpaper manager |
| *BSD | 15% | в работе | | *BSD | 15% | в работе |
| GNU/Hurd | 1% | В работе | | GNU/Hurd | 1% | В работе |
| Solaris/OpenSolaris | 1% | В работе | | Solaris/OpenSolaris | 1% | В работе |
@ -19,3 +18,48 @@
| Аврора ОС | 0% | Возможно, но пока не в работе | | Аврора ОС | 0% | Возможно, но пока не в работе |
| ChromeOS/ChromiumOS | 0.4% | Неизвестное | | ChromeOS/ChromiumOS | 0.4% | Неизвестное |
| MacOS | 10% | Неизвестное, но работа ведётся | | MacOS | 10% | Неизвестное, но работа ведётся |
# Окружения рабочего стола
| Окружение | Завершено |
| LXDE | 100% |
| XFCE | 0% |
| GNOME | 0% |
| KDE | 0% |
| LXQt | 0% |
| MATE | 0% |
| Cinnamon | 0% |
| Budgie | 0% |
| Deepin | 0% |
| COSMIC | 0% |
| Pantheon | 0% |
| Enlightenment | 0% |
| Unity | 0% |
| Sugar Desktop | 0% |
| ROX Desktop | 0% |
| Fluxbox | 0% |
| Openbox | 0% |
| Trinity | 0% |
| Blackbox | 0% |
| AwesomeWM | 0% |
| DWM | 0% |
| hyperland | 0% |
| niri | 0% |
| Fish | 0% |
| Lumina | 0% |
| IceWM | 0% |
| Window Maker | 0% |
| I3 | 0% |
| Sway | 0% |
| Wayfire | 0% |
| bspwm | 0% |
| herbstluftwm | 0% |
| xmonad | 0% |
| qtile | 0% |
| CDE | 0% |
| Fvwm95 | 0% |
| OpenWindows | 0% |
| Dt | 0% |
| 9wm | 0% |
| Twm | 0% |
| WindowLab | 0% |

View file

@ -31,6 +31,7 @@
#include "audio.h" #include "audio.h"
#include "boost-hash.h" #include "boost-hash.h"
#include "meow.h" #include "meow.h"
#include "sunshine.h"
#include <ruby.h> #include <ruby.h>
#include <ruby/debug.h> #include <ruby/debug.h>
@ -129,7 +130,7 @@ void fileIntBindingInit();
void journalBindingInit(); void journalBindingInit();
void wallpaperBindingInit(); void wallpaperBindingInit();
#ifdef __linux__ #ifdef unix_like
void wallpaperBindingTerminate(); void wallpaperBindingTerminate();
#endif #endif
void nikoBindingInit(); void nikoBindingInit();
@ -591,7 +592,7 @@ static void mriBindingExecute(){
static void mriBindingTerminate(){ static void mriBindingTerminate(){
rb_raise(rb_eSystemExit, " "); rb_raise(rb_eSystemExit, " ");
#ifdef __linux__ #ifdef unix_like
wallpaperBindingTerminate(); wallpaperBindingTerminate();
#endif #endif
} }

View file

@ -3,11 +3,12 @@
#include "pipe.h" #include "pipe.h"
#include "debugwriter.h" #include "debugwriter.h"
#include "i18n.h" #include "i18n.h"
#include "define.h"
//OS-Specific code //OS-Specific code
#if defined _WIN32 #if defined _WIN32
#define OS_W32 #define OS_W32
#elif defined __APPLE__ || __linux__ #elif unix_like
#define LINUX #define LINUX
#ifdef __APPLE__ #ifdef __APPLE__
#define OS_OSX #define OS_OSX
@ -38,7 +39,7 @@ static volatile char message_buffer[BUFFER_SIZE];
static volatile bool active = false; static volatile bool active = false;
static volatile int message_len = 0; static volatile int message_len = 0;
#ifdef LINUX #ifdef unix_like
static std::string PIPE_PATH = std::string(getpwuid(getuid())->pw_dir) + "/.oneshot-pipe"; static std::string PIPE_PATH = std::string(getpwuid(getuid())->pw_dir) + "/.oneshot-pipe";
static volatile int out_pipe = -1; static volatile int out_pipe = -1;
void cleanup_pipe(){ void cleanup_pipe(){

View file

@ -3,11 +3,12 @@
#include "sharedstate.h" #include "sharedstate.h"
#include "debugwriter.h" #include "debugwriter.h"
#include "eventthread.h" #include "eventthread.h"
#include "define.h"
#if defined _WIN32 #if defined _WIN32
#define OS_W32 #define OS_W32
#include <shlwapi.h> #include <shlwapi.h>
#elif defined __APPLE__ || __linux__ #elif unix_like
#define LINUX #define LINUX
#ifdef __APPLE__ #ifdef __APPLE__
#define OS_OSX #define OS_OSX
@ -42,7 +43,7 @@ static volatile char message_buffer[BUFFER_SIZE];
static volatile bool active = false; static volatile bool active = false;
static volatile int message_len = 0; static volatile int message_len = 0;
#ifdef LINUX #ifdef unix_like
static std::string NIKO_PIPE_PATH = std::string(getpwuid(getuid())->pw_dir) + "/.oneshot-niko-pipe"; static std::string NIKO_PIPE_PATH = std::string(getpwuid(getuid())->pw_dir) + "/.oneshot-niko-pipe";
static volatile int out_pipe = -1; static volatile int out_pipe = -1;
void niko_cleanup_pipe(){ void niko_cleanup_pipe(){
@ -97,7 +98,7 @@ RB_METHOD(nikoPrepare){
//SDL_VERSION(&syswindow.version); //SDL_VERSION(&syswindow.version);
//SDL_GetWindowWMInfo(shState->rtData().window, &syswindow); //SDL_GetWindowWMInfo(shState->rtData().window, &syswindow);
#ifdef LINUX #ifdef unix_like
char path[PATH_MAX]; char path[PATH_MAX];
std::string journal; std::string journal;
@ -196,7 +197,7 @@ RB_METHOD(nikoStart){
void nikoBindingInit(){ void nikoBindingInit(){
mutex = SDL_CreateMutex(); mutex = SDL_CreateMutex();
#if defined __linux #if unix_like
mkfifo(NIKO_PIPE_PATH.c_str(), 0666); mkfifo(NIKO_PIPE_PATH.c_str(), 0666);
atexit(niko_cleanup_pipe); atexit(niko_cleanup_pipe);
#endif #endif

View file

@ -98,7 +98,7 @@ void oneshotBindingInit(){
// Constants // Constants
rb_const_set(module, rb_intern("OS"), rb_str_new2(shState->oneshot().os().c_str())); rb_const_set(module, rb_intern("OS"), rb_str_new2(shState->oneshot().os().c_str()));
#ifdef __linux__ #ifdef unix_like
rb_const_set(module, rb_intern("DE"), rb_str_new2(shState->oneshot().desktopEnv.c_str())); rb_const_set(module, rb_intern("DE"), rb_str_new2(shState->oneshot().desktopEnv.c_str()));
#endif #endif
rb_const_set(module, rb_intern("USER_NAME"), rb_str_new2(shState->oneshot().userName().c_str())); rb_const_set(module, rb_intern("USER_NAME"), rb_str_new2(shState->oneshot().userName().c_str()));

View file

@ -27,7 +27,7 @@ static void start(){
CreateProcessW(path, args, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); CreateProcessW(path, args, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
delete [] args; delete [] args;
#else #else
#if defined __linux #if defined unix_like
char path[PATH_MAX]; char path[PATH_MAX];
ssize_t len = readlink("/proc/self/exe", path, PATH_MAX); ssize_t len = readlink("/proc/self/exe", path, PATH_MAX);
if (len == -1) if (len == -1)

View file

@ -3,10 +3,8 @@
#include <fstream> #include <fstream>
#include <vector> #include <vector>
#include <map> #include <map>
#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/replace.hpp>
#include "sunshine.h"
#include "etc.h" #include "etc.h"
#include "sharedstate.h" #include "sharedstate.h"
#include "binding-util.h" #include "binding-util.h"
@ -14,6 +12,7 @@
#include "config.h" #include "config.h"
#include "oneshot.h" #include "oneshot.h"
#include "debugwriter.h" #include "debugwriter.h"
#include "define.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
@ -38,6 +37,7 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <cstdlib>
static std::string desktop = "uninitialized"; static std::string desktop = "uninitialized";
// GNOME settings // GNOME settings
static GSettings *bgsetting; static GSettings *bgsetting;
@ -52,21 +52,66 @@
// KDE settings // KDE settings
static std::map<std::string, std::string> defPlugins, defPictures, defColors, defModes; static std::map<std::string, std::string> defPlugins, defPictures, defColors, defModes;
static std::map<std::string, bool> defBlurs; static std::map<std::string, bool> defBlurs;
// LXDE settings
static std::string originalBgPath = "";
static std::string originalBgMode = "";
// Fallback settings // Fallback settings
static std::string fallbackPath; static std::string fallbackPath;
#endif #endif
#endif #endif
#ifdef __linux__ #ifdef unix_like
void desktopEnvironmentInit(){ void desktopEnvironmentInit(){
printf("[desktopEnvironmentInit] desktopEnvironmentInit()\n"); printf("[desktopEnvironmentInit] desktopEnvironmentInit()\n");
if (desktop != "uninitialized") if (desktop != "uninitialized")
return; return;
desktop = shState->oneshot().desktopEnv; desktop = shState->oneshot().desktopEnv;
if (desktop != "nope") { if (desktop == "nope") {
return; return;
} }
if (desktop == "lxde"){
const char* homeC = std::getenv("HOME");
if (!homeC) return;
std::string home(homeC);
std::string path = home + "/.config/pcmanfm/LXDE/desktop-items-0.conf";
std::ifstream infile(path);
if (!infile) {
Debug() << "Can't open LXDE settings";
return;
}
//https://ru.stackoverflow.com/questions/888292/%D0%A0%D0%B0%D0%B7%D0%B4%D0%B5%D0%BB%D0%B8%D1%82%D1%8C-%D0%BE%D0%B4%D0%BD%D1%83-%D1%81%D1%82%D1%80%D0%BE%D0%BA%D1%83-%D0%BD%D0%B0-%D0%B4%D0%B2%D0%B5
std::string line;
unsigned int lineNumber = 0;
static bool first_found = false;
static bool second_found = false;
while (getline(infile, line)) {
lineNumber++;
if (line.find("wallpaper=") != std::string::npos) {
Debug() << "[LXDEPrepare] " << line;
auto pos = line.find("=");
if (pos != std::string::npos){
originalBgPath = line.substr(pos+1);
first_found = true;
}
}
if (line.find("wallpaper_mode=") != std::string::npos) {
Debug() << "[LXDEPrepare] " << line;
auto pos = line.find("=");
if (pos != std::string::npos){
originalBgMode = line.substr(pos+1);
second_found = true;
}
}
if(first_found && second_found){
Debug() << originalBgPath;
Debug() << originalBgMode;
break;
}
}
infile.close();
}
if (desktop == "cinnamon" || desktop == "gnome" || desktop == "mate" || desktop == "deepin") { if (desktop == "cinnamon" || desktop == "gnome" || desktop == "mate" || desktop == "deepin") {
if (desktop == "cinnamon" || desktop == "gnome" || desktop == "deepin") { if (desktop == "cinnamon" || desktop == "gnome" || desktop == "deepin") {
if (desktop == "cinnamon") bgsetting = g_settings_new("org.cinnamon.desktop.background"); if (desktop == "cinnamon") bgsetting = g_settings_new("org.cinnamon.desktop.background");
@ -356,8 +401,15 @@ end:
int result = system(command.str().c_str()); int result = system(command.str().c_str());
#ifdef DEBUG #ifdef DEBUG
Debug() << "[wallpaperSet] Wallpaper command:" << command.str(); Debug() << "[wallpaperSet] Wallpaper command:" << command.str();
Debug() << "[wallpaperSet ] Result:" << result; Debug() << "[wallpaperSet] Result:" << result;
#endif #endif
} else if (desktop == "lxde") {
std::string concatPath = gameDirStr + path;
std::string cmd = "pcmanfm -w \"" + concatPath + "\"" + " --wallpaper-mode=center";
int status = std::system(cmd.c_str());
if (status != 0) {
std::printf("bliat ono slomalos\n");
}
} else { } else {
std::ifstream srcHint(gameDirStr + path); std::ifstream srcHint(gameDirStr + path);
std::ofstream dstHint(fallbackPath); std::ofstream dstHint(fallbackPath);
@ -484,6 +536,17 @@ RB_METHOD(wallpaperReset){
Debug() << "[wallpaperReset] Reset wallpaper command:" << command.str(); Debug() << "[wallpaperReset] Reset wallpaper command:" << command.str();
Debug() << "[wallpaperReset] Reset result:" << result; Debug() << "[wallpaperReset] Reset result:" << result;
#endif #endif
} else if(desktop == "lxde"){
if (originalBgPath != "" && originalBgMode != ""){
std::string cmd = "pcmanfm -w \"" + originalBgPath + "\"" + " --wallpaper-mode=" + originalBgMode;
Debug() << cmd;
int status = std::system(cmd.c_str());
if (status != 0) {
std::printf("bliat ono slomalos\n");
}
}else{
Debug() << "BRUH";
}
} else { } else {
if (remove(fallbackPath.c_str()) != 0) { if (remove(fallbackPath.c_str()) != 0) {
#ifdef DEBUG #ifdef DEBUG
@ -505,7 +568,7 @@ void wallpaperBindingInit(){
_rb_define_module_function(module, "reset", wallpaperReset); _rb_define_module_function(module, "reset", wallpaperReset);
} }
#ifdef __linux__ #ifdef unix_like
void wallpaperBindingTerminate(){ void wallpaperBindingTerminate(){
// Clean up. // Clean up.
if (desktop == "xfce") { if (desktop == "xfce") {

View file

@ -50,3 +50,5 @@ Mirrors!
Nice eror formating in Events script command Nice eror formating in Events script command
Optimizations for steamshim Optimizations for steamshim
crash() function update crash() function update
*NIX support patches
Start house reworked

View file

@ -4,11 +4,10 @@
# After defining each class, actual processing begins here. # After defining each class, actual processing begins here.
#============================================================================== #==============================================================================
at_exit do #at_exit do
RPG::Mod.exec_hooks("hooks/Main/at_exit", binding) # Wallpaper.reset
Wallpaper.reset # save unless $game_switches[99] || ($game_system.map_interpreter.running? || !$scene.is_a?(Scene_Map))
save unless $game_switches[99] || ($game_system.map_interpreter.running? || !$scene.is_a?(Scene_Map)) #end
end
begin begin
RPG::Mod.exec_hooks("hooks/Main/start", binding) RPG::Mod.exec_hooks("hooks/Main/start", binding)
@ -41,10 +40,9 @@ begin
end end
Oneshot.allow_exit true Oneshot.allow_exit true
Wallpaper.reset
save unless $game_switches[99] || ($game_system.map_interpreter.running? || !$scene.is_a?(Scene_Map))
rescue Errno::ENOENT rescue Errno::ENOENT
if $debug
tp.disable
end
# Supplement Errno::ENOENT exception # Supplement Errno::ENOENT exception
# If unable to open file, display message and end # If unable to open file, display message and end
filename = $!.message.sub("No such file or directory - ", "") filename = $!.message.sub("No such file or directory - ", "")

5
src/define.h Normal file
View file

@ -0,0 +1,5 @@
#if defined(__linux__) || defined(__sun) || defined(__APPLE__) || \
defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
defined(__GNU__) || defined(__hurd__) || defined(__DragonFly__)
#define unix_like 1
#endif

View file

@ -38,7 +38,7 @@
#include "binding.h" #include "binding.h"
#include "debugwriter.h" #include "debugwriter.h"
#include "oneshot.h" #include "oneshot.h"
#include "define.h"
#include <SDL3/SDL_video.h> #include <SDL3/SDL_video.h>
#include <SDL3/SDL_timer.h> #include <SDL3/SDL_timer.h>
#include <SDL3_image/SDL_image.h> #include <SDL3_image/SDL_image.h>
@ -730,7 +730,7 @@ void Graphics::transition(unsigned int duration, const char *filename, int vague
simpleShader.setProg(prog); simpleShader.setProg(prog);
} }
#if !defined(__linux__) && !defined(BSD) && !defined(__unix__) #if !unix_like
if (p->threadData->exiting) SDL_SetWindowOpacity(p->threadData->window, 1.0f - prog); if (p->threadData->exiting) SDL_SetWindowOpacity(p->threadData->window, 1.0f - prog);
#endif #endif

View file

@ -53,6 +53,7 @@
#include "modloader.h" #include "modloader.h"
#include "sunshine.h" #include "sunshine.h"
#include "define.h"
#include "meow.h" #include "meow.h"
#include "binding.h" #include "binding.h"
@ -224,7 +225,7 @@ int main(int argc, char *argv[]){
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME, "Oneshot: sunshine"); SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME, "Oneshot: sunshine");
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_ROLE, "Game"); SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_ROLE, "Game");
//X11 work on *BSD,Solaris too! //X11 work on *BSD,Solaris too!
#if defined(__linux__) || defined(BSD) || defined(__sun) #if unix_like
SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0"); SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0");
#if SDL_VERSION_ATLEAST(3, 4, 10) #if SDL_VERSION_ATLEAST(3, 4, 10)
SDL_SetHint(SDL_HINT_VIDEO_X11_ENABLE_XSYNC_EXT, "1"); SDL_SetHint(SDL_HINT_VIDEO_X11_ENABLE_XSYNC_EXT, "1");
@ -333,7 +334,7 @@ int main(int argc, char *argv[]){
/* OSX and Windows have their own native ways of /* OSX and Windows have their own native ways of
* dealing with icons; don't interfere with them */ * dealing with icons; don't interfere with them */
#ifdef defined(__linux__) || defined(BSD) #ifdef unix_like
setupWindowIcon(conf, win); setupWindowIcon(conf, win);
#elif __EMSCRIPTEN__ #elif __EMSCRIPTEN__
Debug() << "meow"; Debug() << "meow";

View file

@ -9,6 +9,7 @@
#include "bitmap.h" #include "bitmap.h"
#include "font.h" #include "font.h"
#include "config.h" #include "config.h"
#include "define.h"
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3_image/SDL_image.h> #include <SDL3_image/SDL_image.h>
@ -29,7 +30,7 @@
#include <pwd.h> #include <pwd.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <dispatch/dispatch.h> #include <dispatch/dispatch.h>
#elif defined(__linux__) || defined(__unix__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #elif unix_like
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <pwd.h> #include <pwd.h>
@ -86,7 +87,7 @@ struct OneshotPrivate{
}; };
//OS-SPECIFIC FUNCTIONS //OS-SPECIFIC FUNCTIONS
#if defined(__linux__) || defined(__unix__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #if unix_like
struct linux_DialogData{ struct linux_DialogData{
// Input // Input
int type; int type;
@ -182,9 +183,7 @@ Oneshot::Oneshot(RGSSThreadData &threadData) :
p->os = "windows"; p->os = "windows";
#elif __APPLE__ #elif __APPLE__
p->os = "macos"; p->os = "macos";
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(BSD) #elif unix_like
p->os = "BSD";
#elif __LINUX__
p->os = "linux"; p->os = "linux";
#endif #endif
@ -242,7 +241,7 @@ Oneshot::Oneshot(RGSSThreadData &threadData) :
// Get user's name // Get user's name
#ifdef OS_OSX #ifdef OS_OSX
struct passwd *pwd = getpwuid(geteuid()); struct passwd *pwd = getpwuid(geteuid());
#elif defined(__linux__) || defined(__unix__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #elif unix_like
struct passwd *pwd = getpwuid(getuid()); struct passwd *pwd = getpwuid(getuid());
#endif #endif
if (pwd){ if (pwd){
@ -261,7 +260,7 @@ Oneshot::Oneshot(RGSSThreadData &threadData) :
p->docsPath = path.c_str(); p->docsPath = path.c_str();
p->gamePath = path.c_str(); p->gamePath = path.c_str();
p->journal = "_______.app"; p->journal = "_______.app";
#elif defined(__linux__) || defined(__unix__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #elif unix_like
char * path = xdg_user_dir_lookup("DOCUMENTS"); char * path = xdg_user_dir_lookup("DOCUMENTS");
p->docsPath = path; p->docsPath = path;
p->gamePath = path; p->gamePath = path;
@ -272,7 +271,7 @@ Oneshot::Oneshot(RGSSThreadData &threadData) :
Debug() << "[oneshot] Game path :" << p->gamePath; Debug() << "[oneshot] Game path :" << p->gamePath;
Debug() << "[oneshot] Docs path :" << p->docsPath; Debug() << "[oneshot] Docs path :" << p->docsPath;
#ifdef defined(__linux__) || defined(__unix__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #ifdef unix_like
char const* xdg_current_desktop = getenv("XDG_CURRENT_DESKTOP"); char const* xdg_current_desktop = getenv("XDG_CURRENT_DESKTOP");
gtk_init(0, 0); gtk_init(0, 0);
@ -464,7 +463,7 @@ void Oneshot::setAllowExit(bool allowExit){
bool Oneshot::msgbox(int type, const char *body, const char *title){ bool Oneshot::msgbox(int type, const char *body, const char *title){
if (!title) if (!title)
title = ""; title = "";
#ifdef defined(__linux__) || defined(__unix__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #ifdef unix_like
linux_DialogData data = {type, body, title, 0}; linux_DialogData data = {type, body, title, 0};
gdk_threads_add_idle(linux_dialog, &data); gdk_threads_add_idle(linux_dialog, &data);
gtk_main(); gtk_main();

View file

@ -7,7 +7,7 @@
#include "etc-internal.h" #include "etc-internal.h"
#include <string> #include <string>
#include "define.h"
struct OneshotPrivate; struct OneshotPrivate;
struct RGSSThreadData; struct RGSSThreadData;
@ -71,7 +71,7 @@ public:
//Dirty flag for obscured texture //Dirty flag for obscured texture
bool obscuredDirty; bool obscuredDirty;
#ifdef __linux__ #ifdef unix_like
std::string desktopEnv; std::string desktopEnv;
#endif #endif

View file

@ -27,7 +27,6 @@
#include "input.h" #include "input.h"
#include "audio.h" #include "audio.h"
#include "oneshot.h" #include "oneshot.h"
#include "sunshine.h"
#ifdef STEAM #ifdef STEAM
#include "steam.h" #include "steam.h"
#endif #endif
@ -41,6 +40,7 @@
#include "quad.h" #include "quad.h"
#include "binding.h" #include "binding.h"
#include "exception.h" #include "exception.h"
#include "sunshine.h"
#ifndef _MSC_VER #ifndef _MSC_VER
#include <unistd.h> #include <unistd.h>

View file

@ -4,13 +4,6 @@
//помойка ебаная //помойка ебаная
inline boost::chrono::high_resolution_clock::time_point startTime; inline boost::chrono::high_resolution_clock::time_point startTime;
#if defined(__linux__) || defined(BSD) || defined(__sun) || defined(__APPLE__) || \
defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
defined(__GNU__) || defined(__hurd__) || defined(__DragonFly__)
#define unix_like 1
#endif
class Sunshine{ class Sunshine{
public: public:
Sunshine(); Sunshine();