mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Replacing standart C library methods with SDL methods
This commit is contained in:
parent
319e17d711
commit
e14614a7a9
124 changed files with 230 additions and 231 deletions
|
|
@ -81,7 +81,7 @@ set(MAIN_HEADERS
|
||||||
src/define.h
|
src/define.h
|
||||||
src/signals/signal.h
|
src/signals/signal.h
|
||||||
src/signals/signalconnection.h
|
src/signals/signalconnection.h
|
||||||
src/signals/rubyDispatcher.h
|
src/signals/rubydispatcher.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(MAIN_SOURCE
|
set(MAIN_SOURCE
|
||||||
|
|
@ -128,7 +128,7 @@ set(MAIN_SOURCE
|
||||||
src/modloader.cpp
|
src/modloader.cpp
|
||||||
src/sunshine.cpp
|
src/sunshine.cpp
|
||||||
src/lightmap.cpp
|
src/lightmap.cpp
|
||||||
src/signals/rubyDispatcher.cpp
|
src/signals/rubydispatcher.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -248,7 +248,7 @@ RB_METHOD(mkxpRawKeyStates){
|
||||||
RB_UNUSED_PARAM;
|
RB_UNUSED_PARAM;
|
||||||
|
|
||||||
VALUE str = rb_str_new(0, sizeof(EventThread::keyStates));
|
VALUE str = rb_str_new(0, sizeof(EventThread::keyStates));
|
||||||
memcpy(RSTRING_PTR(str), EventThread::keyStates, sizeof(EventThread::keyStates));
|
SDL_memcpy(RSTRING_PTR(str), EventThread::keyStates, sizeof(EventThread::keyStates));
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
@ -468,7 +468,7 @@ static void runRMXPScripts(BacktraceData &btData){
|
||||||
char buf[512];
|
char buf[512];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = snprintf(buf, sizeof(buf), "%03ld:%s", i, scriptName);
|
len = SDL_snprintf(buf, sizeof(buf), "%03ld:%s", i, scriptName);
|
||||||
|
|
||||||
fname = newStringUTF8(buf, len);
|
fname = newStringUTF8(buf, len);
|
||||||
btData.scriptNames.insert(buf, scriptName);
|
btData.scriptNames.insert(buf, scriptName);
|
||||||
|
|
@ -505,7 +505,7 @@ static void showExc(VALUE exc, const BacktraceData &btData){
|
||||||
char line[16];
|
char line[16];
|
||||||
std::string file(512, '\0');
|
std::string file(512, '\0');
|
||||||
|
|
||||||
char *p = s + strlen(s);
|
char *p = s + SDL_strlen(s);
|
||||||
char *e;
|
char *e;
|
||||||
|
|
||||||
while (p != s)
|
while (p != s)
|
||||||
|
|
@ -535,7 +535,7 @@ static void showExc(VALUE exc, const BacktraceData &btData){
|
||||||
*e = ':';
|
*e = ':';
|
||||||
|
|
||||||
/* Shrink to fit */
|
/* Shrink to fit */
|
||||||
file.resize(strlen(file.c_str()));
|
file.resize(SDL_strlen(file.c_str()));
|
||||||
file = btData.scriptNames.value(file, file);
|
file = btData.scriptNames.value(file, file);
|
||||||
|
|
||||||
crash(Exception::MEOW, "Script '%s' line %s: %s occured.\n\n%s", file.c_str(), line, RSTRING_PTR(name), RSTRING_PTR(msg));
|
crash(Exception::MEOW, "Script '%s' line %s: %s occured.\n\n%s", file.c_str(), line, RSTRING_PTR(name), RSTRING_PTR(msg));
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -85,7 +85,7 @@ void raiseDisposedAccess(VALUE self){
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
strncpy(buf, klassName, sizeof(buf));
|
strncpy(buf, klassName, sizeof(buf));
|
||||||
buf[0] = tolower(buf[0]);
|
buf[0] = SDL_tolower(buf[0]);
|
||||||
|
|
||||||
rb_raise(getRbData()->exc[RGSS], "disposed %s", buf);
|
rb_raise(getRbData()->exc[RGSS], "disposed %s", buf);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include <ruby.h>
|
#include <ruby.h>
|
||||||
//костыль ебаный сука
|
//костыль ебаный сука
|
||||||
#undef snprintf
|
#undef SDL_snprintf
|
||||||
#undef inline
|
#undef inline
|
||||||
|
|
||||||
#include "exception.h"
|
#include "exception.h"
|
||||||
|
|
@ -167,14 +167,14 @@ static inline void _rb_define_module_function(VALUE module, const char *name, Ru
|
||||||
rb_define_module_function(module, name, RUBY_METHOD_FUNC(func), -1);
|
rb_define_module_function(module, name, RUBY_METHOD_FUNC(func), -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GUARD_EXC(exp) \
|
#define GUARD_EXC(SDL_exp) \
|
||||||
{ try { exp } catch (const Exception &exc) { raiseRbExc(exc); } }
|
{ try { SDL_exp } catch (const Exception &exc) { raiseRbExc(exc); } }
|
||||||
|
|
||||||
#define GFX_GUARD_EXC(exp) \
|
#define GFX_GUARD_EXC(SDL_exp) \
|
||||||
{\
|
{\
|
||||||
GFX_LOCK; \
|
GFX_LOCK; \
|
||||||
try {\
|
try {\
|
||||||
exp \
|
SDL_exp \
|
||||||
} catch (const Exception &exc) {\
|
} catch (const Exception &exc) {\
|
||||||
GFX_UNLOCK; \
|
GFX_UNLOCK; \
|
||||||
raiseRbExc(exc); \
|
raiseRbExc(exc); \
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -94,14 +94,14 @@ RB_METHOD(journalSet){
|
||||||
rb_get_args(argc, argv, "z", &name RB_ARG_END);
|
rb_get_args(argc, argv, "z", &name RB_ARG_END);
|
||||||
// Record message
|
// Record message
|
||||||
SDL_LockMutex(mutex);
|
SDL_LockMutex(mutex);
|
||||||
message_len = strlen(name);
|
message_len = SDL_strlen(name);
|
||||||
strcpy((char*)message_buffer, name);
|
strcpy((char*)message_buffer, name);
|
||||||
if (message_len > 0) {
|
if (message_len > 0) {
|
||||||
// in the case where journal is being sent empty string
|
// in the case where journal is being sent empty string
|
||||||
// do not append the language suffix, because empty string
|
// do not append the language suffix, because empty string
|
||||||
// is the signifier to terminate the journal
|
// is the signifier to terminate the journal
|
||||||
strcpy((char*)message_buffer + message_len, (char*)lang_buffer);
|
strcpy((char*)message_buffer + message_len, (char*)lang_buffer);
|
||||||
message_len += strlen((char*)lang_buffer);
|
message_len += SDL_strlen((char*)lang_buffer);
|
||||||
}
|
}
|
||||||
SDL_UnlockMutex(mutex);
|
SDL_UnlockMutex(mutex);
|
||||||
|
|
||||||
|
|
@ -162,7 +162,7 @@ RB_METHOD(journalActive){
|
||||||
|
|
||||||
void journalBindingInit(){
|
void journalBindingInit(){
|
||||||
mutex = SDL_CreateMutex();
|
mutex = SDL_CreateMutex();
|
||||||
memset((char*)lang_buffer, 0, BUFFER_SIZE);
|
SDL_memset((char*)lang_buffer, 0, BUFFER_SIZE);
|
||||||
lang_buffer[0] = '_';
|
lang_buffer[0] = '_';
|
||||||
#if defined __linux
|
#if defined __linux
|
||||||
mkfifo(PIPE_PATH.c_str(), 0666);
|
mkfifo(PIPE_PATH.c_str(), 0666);
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ RB_METHOD(nikoStart){
|
||||||
wcscat(path, L"\\_______.exe");
|
wcscat(path, L"\\_______.exe");
|
||||||
wsprintfW(args, L"_______.exe %d %d", pos.x, pos.y);
|
wsprintfW(args, L"_______.exe %d %d", pos.x, pos.y);
|
||||||
STARTUPINFOW si;
|
STARTUPINFOW si;
|
||||||
memset(&si, 0, sizeof(si));
|
SDL_memset(&si, 0, sizeof(si));
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
CreateProcessW(path, args, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
|
CreateProcessW(path, args, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
|
||||||
|
|
@ -169,7 +169,7 @@ RB_METHOD(nikoStart){
|
||||||
sprintf(message, "%d,%d\n", x, y);
|
sprintf(message, "%d,%d\n", x, y);
|
||||||
|
|
||||||
SDL_LockMutex(mutex);
|
SDL_LockMutex(mutex);
|
||||||
message_len = strlen(message);
|
message_len = SDL_strlen(message);
|
||||||
strcpy((char*)message_buffer, message);
|
strcpy((char*)message_buffer, message);
|
||||||
SDL_UnlockMutex(mutex);
|
SDL_UnlockMutex(mutex);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@
|
||||||
#include "eventthread.h"
|
#include "eventthread.h"
|
||||||
|
|
||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
#include <boost/crc.hpp>
|
#include <boost/crc.hpp>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
RB_METHOD(oneshotSetYesNo){
|
RB_METHOD(oneshotSetYesNo){
|
||||||
RB_UNUSED_PARAM;
|
RB_UNUSED_PARAM;
|
||||||
|
|
@ -71,11 +73,11 @@ RB_METHOD(oneshotShake){
|
||||||
int absx, absy;
|
int absx, absy;
|
||||||
SDL_GetWindowPosition(shState->rtData().window, &absx, &absy);
|
SDL_GetWindowPosition(shState->rtData().window, &absx, &absy);
|
||||||
int state;
|
int state;
|
||||||
srand(time(NULL));
|
SDL_srand(time(NULL));
|
||||||
for (int i = 0; i < 60; ++i) {
|
for (int i = 0; i < 60; ++i) {
|
||||||
int max = 60 - i;
|
int max = 60 - i;
|
||||||
int x = rand() % (max * 2) - max;
|
int x = SDL_rand(RAND_MAX) % (max * 2) - max;
|
||||||
int y = rand() % (max * 2) - max;
|
int y = SDL_rand(RAND_MAX) % (max * 2) - max;
|
||||||
SDL_SetWindowPosition(shState->rtData().window, absx + x, absy + y);
|
SDL_SetWindowPosition(shState->rtData().window, absx + x, absy + y);
|
||||||
rb_eval_string_protect("sleep 0.02", &state);
|
rb_eval_string_protect("sleep 0.02", &state);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,12 @@ static void start(){
|
||||||
MultiByteToWideChar(CP_UTF8, 0, shState->config().gameFolder.c_str(), -1, gameFolder, MAX_PATH);
|
MultiByteToWideChar(CP_UTF8, 0, shState->config().gameFolder.c_str(), -1, gameFolder, MAX_PATH);
|
||||||
GetModuleFileNameW(NULL, path, MAX_PATH);
|
GetModuleFileNameW(NULL, path, MAX_PATH);
|
||||||
STARTUPINFOW si;
|
STARTUPINFOW si;
|
||||||
memset(&si, 0, sizeof(si));
|
SDL_memset(&si, 0, sizeof(si));
|
||||||
si.cb = sizeof(si);
|
si.cb = sizeof(si);
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
std::wstring argString = std::wstring(L"oneshot.exe \"--gameFolder=") + gameFolder + L"\" --screenMode=true";
|
std::wstring argString = std::wstring(L"oneshot.exe \"--gameFolder=") + gameFolder + L"\" --screenMode=true";
|
||||||
WCHAR *args = new WCHAR[argString.size() + 1];
|
WCHAR *args = new WCHAR[argString.size() + 1];
|
||||||
memcpy(args, argString.c_str(), (argString.size() + 1) * sizeof(WCHAR));
|
SDL_memcpy(args, argString.c_str(), (argString.size() + 1) * sizeof(WCHAR));
|
||||||
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
|
||||||
|
|
@ -66,7 +66,7 @@ RB_METHOD(screenSet){
|
||||||
rb_get_args(argc, argv, "z", &imageName RB_ARG_END);
|
rb_get_args(argc, argv, "z", &imageName RB_ARG_END);
|
||||||
if (!ipc.isOpen())
|
if (!ipc.isOpen())
|
||||||
start();
|
start();
|
||||||
ipc.write(imageName, strlen(imageName) + 1);
|
ipc.write(imageName, SDL_strlen(imageName) + 1);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <ruby.h>
|
#include <ruby.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <math.h>
|
#include <SDL3/SDL_stdinc.h>
|
||||||
|
|
||||||
static VALUE get_month(VALUE self) {
|
static VALUE get_month(VALUE self) {
|
||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
|
|
@ -24,7 +24,7 @@ static VALUE ctime_at(int argc, VALUE *argv, VALUE self){
|
||||||
|
|
||||||
if (TYPE(v_sec) == T_FLOAT || rb_obj_is_kind_of(v_sec, rb_cFloat)) {
|
if (TYPE(v_sec) == T_FLOAT || rb_obj_is_kind_of(v_sec, rb_cFloat)) {
|
||||||
dsec = NUM2DBL(v_sec);
|
dsec = NUM2DBL(v_sec);
|
||||||
sec = (long long) floor(dsec);
|
sec = (long long) SDL_floor(dsec);
|
||||||
double frac = dsec - (double)sec;
|
double frac = dsec - (double)sec;
|
||||||
nsec = (long) llround(frac * 1e9);
|
nsec = (long) llround(frac * 1e9);
|
||||||
if (nsec >= 1000000000L) { sec += 1; nsec -= 1000000000L; }
|
if (nsec >= 1000000000L) { sec += 1; nsec -= 1000000000L; }
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <boost/algorithm/string/replace.hpp>
|
#include <boost/algorithm/string/replace.hpp>
|
||||||
|
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
#include "etc.h"
|
#include "etc.h"
|
||||||
#include "sharedstate.h"
|
#include "sharedstate.h"
|
||||||
#include "binding-util.h"
|
#include "binding-util.h"
|
||||||
|
|
@ -71,7 +72,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (desktop == "lxde"){
|
if (desktop == "lxde"){
|
||||||
const char* homeC = std::getenv("HOME");
|
const char* homeC = SDL_getenv("HOME");
|
||||||
if (!homeC) return;
|
if (!homeC) return;
|
||||||
std::string home(homeC);
|
std::string home(homeC);
|
||||||
std::string path = home + "/.config/pcmanfm/LXDE/desktop-items-0.conf";
|
std::string path = home + "/.config/pcmanfm/LXDE/desktop-items-0.conf";
|
||||||
|
|
@ -146,7 +147,7 @@
|
||||||
}
|
}
|
||||||
} else if (desktop == "kde") {
|
} else if (desktop == "kde") {
|
||||||
std::ifstream configFile;
|
std::ifstream configFile;
|
||||||
configFile.open(std::string(getenv("HOME")) + "/.config/plasma-org.kde.plasma.desktop-appletsrc", std::ios::in);
|
configFile.open(std::string(SDL_getenv("HOME")) + "/.config/plasma-org.kde.plasma.desktop-appletsrc", std::ios::in);
|
||||||
if (configFile.is_open()) {
|
if (configFile.is_open()) {
|
||||||
std::string line;
|
std::string line;
|
||||||
std::vector<std::string> sections;
|
std::vector<std::string> sections;
|
||||||
|
|
@ -211,7 +212,7 @@
|
||||||
desktop = "kde_error";
|
desktop = "kde_error";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fallbackPath = std::string(getenv("HOME")) + "/Desktop/ONESHOT_hint.png";
|
fallbackPath = std::string(SDL_getenv("HOME")) + "/Desktop/ONESHOT_hint.png";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ static void loadImage(const char *name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle default as a special case, since we'll keep that image internally
|
// handle default as a special case, since we'll keep that image internally
|
||||||
if (strcmp(name, "default") == 0) {
|
if (SDL_strcmp(name, "default") == 0) {
|
||||||
image_handle = LoadBitmapA(GetModuleHandleW(NULL), "default");
|
image_handle = LoadBitmapA(GetModuleHandleW(NULL), "default");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -46,7 +46,7 @@ static void loadImage(const char *name) {
|
||||||
char* langCode = 0;
|
char* langCode = 0;
|
||||||
char* emptyString = "\0";
|
char* emptyString = "\0";
|
||||||
strcpy(imageName, name);
|
strcpy(imageName, name);
|
||||||
langCode = strchr(imageName, '_');
|
langCode = SDL_strchr(imageName, '_');
|
||||||
if (langCode > 0) {
|
if (langCode > 0) {
|
||||||
// replace the code with 0 to null terminate the image name where this is
|
// replace the code with 0 to null terminate the image name where this is
|
||||||
// then use the rest of the string as the language code
|
// then use the rest of the string as the language code
|
||||||
|
|
@ -169,8 +169,8 @@ void init_check_save(WCHAR* save_path) {
|
||||||
fread(langbuf, 1, 16, savefile);
|
fread(langbuf, 1, 16, savefile);
|
||||||
fclose(savefile);
|
fclose(savefile);
|
||||||
|
|
||||||
openbrace = strchr(langbuf, '[');
|
openbrace = SDL_strchr(langbuf, '[');
|
||||||
closebrace = strchr(langbuf, ']');
|
closebrace = SDL_strchr(langbuf, ']');
|
||||||
if (openbrace && closebrace && openbrace < closebrace) {
|
if (openbrace && closebrace && openbrace < closebrace) {
|
||||||
//we very probably have a language code here.
|
//we very probably have a language code here.
|
||||||
//so, lets do some hacky string manipulation to
|
//so, lets do some hacky string manipulation to
|
||||||
|
|
@ -189,7 +189,7 @@ void init_check_save(WCHAR* save_path) {
|
||||||
// so we need a gamepath, which should be saved in the registry
|
// so we need a gamepath, which should be saved in the registry
|
||||||
boolean readGamePath() {
|
boolean readGamePath() {
|
||||||
// clear data path
|
// clear data path
|
||||||
memset(&DataPath[0], 0, sizeof(DataPath));
|
SDL_memset(&DataPath[0], 0, sizeof(DataPath));
|
||||||
DWORD dataPathSize = sizeof(DataPath);
|
DWORD dataPathSize = sizeof(DataPath);
|
||||||
|
|
||||||
HKEY key;
|
HKEY key;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -200,7 +200,7 @@ struct ALStreamOpenHandler : FileSystem::OpenHandler{
|
||||||
SDL_SeekIO(srcOps, 0, SDL_IO_SEEK_SET);
|
SDL_SeekIO(srcOps, 0, SDL_IO_SEEK_SET);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
if (!strcmp(sig, "OggS")){
|
if (!SDL_strcmp(sig, "OggS")){
|
||||||
source = createVorbisSource(*srcOps, looped);
|
source = createVorbisSource(*srcOps, looped);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -960,9 +960,9 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align){
|
||||||
SDL_Surface *txtSurf;
|
SDL_Surface *txtSurf;
|
||||||
|
|
||||||
if (shState->rtData().config.solidFonts)
|
if (shState->rtData().config.solidFonts)
|
||||||
txtSurf = TTF_RenderText_Solid(font, str, strlen(str), c);
|
txtSurf = TTF_RenderText_Solid(font, str, SDL_strlen(str), c);
|
||||||
else
|
else
|
||||||
txtSurf = TTF_RenderText_Blended(font, str, strlen(str), c);
|
txtSurf = TTF_RenderText_Blended(font, str, SDL_strlen(str), c);
|
||||||
|
|
||||||
p->ensureFormat(txtSurf, SDL_PIXELFORMAT_ABGR8888);
|
p->ensureFormat(txtSurf, SDL_PIXELFORMAT_ABGR8888);
|
||||||
|
|
||||||
|
|
@ -980,9 +980,9 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align){
|
||||||
/* set the next font render to render the outline */
|
/* set the next font render to render the outline */
|
||||||
TTF_SetFontOutline(font, OUTLINE_SIZE);
|
TTF_SetFontOutline(font, OUTLINE_SIZE);
|
||||||
if (shState->rtData().config.solidFonts)
|
if (shState->rtData().config.solidFonts)
|
||||||
outline = TTF_RenderText_Solid(font, str, strlen(str), co);
|
outline = TTF_RenderText_Solid(font, str, SDL_strlen(str), co);
|
||||||
else
|
else
|
||||||
outline = TTF_RenderText_Blended(font, str, strlen(str), co);
|
outline = TTF_RenderText_Blended(font, str, SDL_strlen(str), co);
|
||||||
|
|
||||||
p->ensureFormat(outline, SDL_PIXELFORMAT_ABGR8888);
|
p->ensureFormat(outline, SDL_PIXELFORMAT_ABGR8888);
|
||||||
SDL_Rect outRect = {OUTLINE_SIZE, OUTLINE_SIZE, txtSurf->w, txtSurf->h};
|
SDL_Rect outRect = {OUTLINE_SIZE, OUTLINE_SIZE, txtSurf->w, txtSurf->h};
|
||||||
|
|
@ -1182,7 +1182,7 @@ IntRect Bitmap::textSize(const char *str){
|
||||||
str = fixed.c_str();
|
str = fixed.c_str();
|
||||||
|
|
||||||
// i don't know if its right migration, i didn't find any other way
|
// i don't know if its right migration, i didn't find any other way
|
||||||
TTF_Text* text = TTF_CreateText(NULL, font, str, strlen(str));
|
TTF_Text* text = TTF_CreateText(NULL, font, str, SDL_strlen(str));
|
||||||
int w, h;
|
int w, h;
|
||||||
TTF_GetTextSize(text, &w, &h);
|
TTF_GetTextSize(text, &w, &h);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -97,7 +97,7 @@ void Config::read(int argc, char *argv[]){
|
||||||
PO_DESC(pancakes, bool, false)
|
PO_DESC(pancakes, bool, false)
|
||||||
|
|
||||||
// Not gonna take your shit boost
|
// Not gonna take your shit boost
|
||||||
#define GUARD_ALL( exp ) try { exp } catch(...) {}
|
#define GUARD_ALL( SDL_exp ) try { SDL_exp } catch(...) {}
|
||||||
|
|
||||||
editor.debug = false;
|
editor.debug = false;
|
||||||
editor.battleTest = false;
|
editor.battleTest = false;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
#include <android/log.h>
|
#include <android/SDL_log.h>
|
||||||
#elif __EMSCRIPTEN__
|
#elif __EMSCRIPTEN__
|
||||||
#include <emscripten/console.h>
|
#include <emscripten/console.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -61,7 +61,7 @@ struct ALCFunctions{
|
||||||
} static alc;
|
} static alc;
|
||||||
|
|
||||||
static void initALCFunctions(ALCdevice *alcDev){
|
static void initALCFunctions(ALCdevice *alcDev){
|
||||||
if (!strstr(alcGetString(alcDev, ALC_EXTENSIONS), "ALC_SOFT_pause_device"))
|
if (!SDL_strstr(alcGetString(alcDev, ALC_EXTENSIONS), "ALC_SOFT_pause_device"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Debug() << "ALC_SOFT_pause_device present";
|
Debug() << "ALC_SOFT_pause_device present";
|
||||||
|
|
@ -605,7 +605,7 @@ void EventThread::showMessageBox(const char *body, int flags){
|
||||||
|
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
event.user.code = flags;
|
event.user.code = flags;
|
||||||
event.user.data1 = strdup(body);
|
event.user.data1 = SDL_strdup(body);
|
||||||
event.type = usrIdStart + REQUEST_MESSAGEBOX;
|
event.type = usrIdStart + REQUEST_MESSAGEBOX;
|
||||||
SDL_PushEvent(&event);
|
SDL_PushEvent(&event);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -22,9 +22,8 @@
|
||||||
#ifndef EXCEPTION_H
|
#ifndef EXCEPTION_H
|
||||||
#define EXCEPTION_H
|
#define EXCEPTION_H
|
||||||
|
|
||||||
|
#include <SDL3/SDL_stdinc.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
struct Exception{
|
struct Exception{
|
||||||
enum Type{
|
enum Type{
|
||||||
|
|
@ -51,14 +50,12 @@ struct Exception{
|
||||||
Type type;
|
Type type;
|
||||||
std::string msg;
|
std::string msg;
|
||||||
|
|
||||||
Exception(Type type, const char *format, ...)
|
Exception(Type type, const char *format, ...) : type(type){
|
||||||
: type(type)
|
|
||||||
{
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
|
|
||||||
msg.resize(512);
|
msg.resize(512);
|
||||||
vsnprintf(&msg[0], msg.size(), format, ap);
|
SDL_vsnprintf(&msg[0], msg.size(), format, ap);
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -255,7 +255,7 @@ static void initReadOps(PHYSFS_File *handle, SDL_IOStream* &ops){
|
||||||
|
|
||||||
static void strTolower(std::string &str){
|
static void strTolower(std::string &str){
|
||||||
for (size_t i = 0; i < str.size(); ++i)
|
for (size_t i = 0; i < str.size(); ++i)
|
||||||
str[i] = tolower(str[i]);
|
str[i] = SDL_tolower(str[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// const Uint32 SDL_RWOPS_PHYSFS = SDL_RWOPS_UNKNOWN+10;
|
// const Uint32 SDL_RWOPS_PHYSFS = SDL_RWOPS_UNKNOWN+10;
|
||||||
|
|
@ -416,7 +416,7 @@ static PHYSFS_EnumerateCallbackResult fontSetEnumCB (void *data, const char *dir
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < sizeof(lowExt)-1 && ext[i]; ++i)
|
for (i = 0; i < sizeof(lowExt)-1 && ext[i]; ++i)
|
||||||
lowExt[i] = tolower(ext[i]);
|
lowExt[i] = SDL_tolower(ext[i]);
|
||||||
lowExt[i] = '\0';
|
lowExt[i] = '\0';
|
||||||
|
|
||||||
if (SDL_strcmp(lowExt, "ttf") && SDL_strcmp(lowExt, "otf") && SDL_strcmp(lowExt, "ttc"))
|
if (SDL_strcmp(lowExt, "ttf") && SDL_strcmp(lowExt, "otf") && SDL_strcmp(lowExt, "ttc"))
|
||||||
|
|
@ -536,7 +536,7 @@ void FileSystem::openRead(OpenHandler &handler, const char *filename){
|
||||||
|
|
||||||
if (p->havePathCache)
|
if (p->havePathCache)
|
||||||
for (size_t i = 0; i < len; ++i)
|
for (size_t i = 0; i < len; ++i)
|
||||||
buffer[i] = tolower(buffer[i]);
|
buffer[i] = SDL_tolower(buffer[i]);
|
||||||
|
|
||||||
/* Find the deliminator separating directory and file name */
|
/* Find the deliminator separating directory and file name */
|
||||||
for (delim = buffer + len; delim > buffer; --delim)
|
for (delim = buffer + len; delim > buffer; --delim)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -80,7 +80,7 @@ void initGLFunctions(){
|
||||||
|
|
||||||
bool gles = false;
|
bool gles = false;
|
||||||
|
|
||||||
if (!strncmp(ver, glesPrefix, glesPrefixN)){
|
if (!SDL_strncmp(ver, glesPrefix, glesPrefixN)){
|
||||||
gles = true;
|
gles = true;
|
||||||
gl.glsles = true;
|
gl.glsles = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ void loadLanguageMetadata() {
|
||||||
// char line[256];
|
// char line[256];
|
||||||
char line[1024];
|
char line[1024];
|
||||||
|
|
||||||
languageMetadata = (LanguageFontAndSize**) calloc(MAX_LANGUAGES, sizeof(LanguageFontAndSize*));
|
languageMetadata = (LanguageFontAndSize**) SDL_calloc(MAX_LANGUAGES, sizeof(LanguageFontAndSize*));
|
||||||
FILE* fontsFile = fopen("Languages/internal/language_fonts.ini", "r");
|
FILE* fontsFile = fopen("Languages/internal/language_fonts.ini", "r");
|
||||||
if (fontsFile) {
|
if (fontsFile) {
|
||||||
|
|
||||||
|
|
@ -125,12 +125,12 @@ void loadLanguageMetadata() {
|
||||||
char* indexOfFontSize = indexOfEquals + 1;
|
char* indexOfFontSize = indexOfEquals + 1;
|
||||||
|
|
||||||
// remove new line from end of font size
|
// remove new line from end of font size
|
||||||
char* indexOfNewLine = strchr(indexOfFontSize, '\n');
|
char* indexOfNewLine = SDL_strchr(indexOfFontSize, '\n');
|
||||||
if (indexOfNewLine) {
|
if (indexOfNewLine) {
|
||||||
indexOfNewLine[0] = 0;
|
indexOfNewLine[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int fontSize = atoi(indexOfFontSize);
|
int fontSize = SDL_atoi(indexOfFontSize);
|
||||||
|
|
||||||
for (int i = 0; i < MAX_LANGUAGES; i++) {
|
for (int i = 0; i < MAX_LANGUAGES; i++) {
|
||||||
// search for corresponding langCode in metadata array to populate font size in the appropriate metadata
|
// search for corresponding langCode in metadata array to populate font size in the appropriate metadata
|
||||||
|
|
@ -201,7 +201,7 @@ void loadLocale(const char* locale) {
|
||||||
|
|
||||||
int lineLen = SDL_strlen(lineWithoutMsgid);
|
int lineLen = SDL_strlen(lineWithoutMsgid);
|
||||||
|
|
||||||
strdict[nStr] = (char*)malloc(lineLen + 1);
|
strdict[nStr] = (char*)SDL_malloc(lineLen + 1);
|
||||||
SDL_strlcpy(strdict[nStr], lineWithoutMsgid, sizeof(lineWithoutMsgid));
|
SDL_strlcpy(strdict[nStr], lineWithoutMsgid, sizeof(lineWithoutMsgid));
|
||||||
|
|
||||||
nStr++;
|
nStr++;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -204,7 +204,7 @@ static void setGamePathInRegistry() {
|
||||||
WarnMsg("Unable to open registry.");
|
WarnMsg("Unable to open registry.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DWORD dataSize = (strlen(dataDir) + 1) * sizeof(char);
|
DWORD dataSize = (SDL_strlen(dataDir) + 1) * sizeof(char);
|
||||||
if (RegSetValueEx(key, TEXT("GameDirectory"), 0, REG_SZ, (LPBYTE)dataDir, dataSize) != ERROR_SUCCESS){
|
if (RegSetValueEx(key, TEXT("GameDirectory"), 0, REG_SZ, (LPBYTE)dataDir, dataSize) != ERROR_SUCCESS){
|
||||||
WarnMsg("Unable to set GameDirectory registry value");
|
WarnMsg("Unable to set GameDirectory registry value");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ void crash(Exception::Type t, const char *fmt, ...){
|
||||||
char *buf = (char*)SDL_malloc((size_t)len + 1);
|
char *buf = (char*)SDL_malloc((size_t)len + 1);
|
||||||
SDL_vsnprintf(buf, (size_t)len + 1, fmt, args);
|
SDL_vsnprintf(buf, (size_t)len + 1, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
SDL_snprintf(msg, sizeof msg, "Error occured! Error message: %s\n\n Want to create a crash log? You can share the crash log with the developers and help resolve the issue.", buf);
|
SDL_snprintf(msg, sizeof msg, "Error occured! Error message: %s\n\n Want to create a crash SDL_log? You can share the crash SDL_log with the developers and help resolve the issue.", buf);
|
||||||
SDL_MessageBoxData messageboxdata = {
|
SDL_MessageBoxData messageboxdata = {
|
||||||
.flags = SDL_MESSAGEBOX_ERROR,
|
.flags = SDL_MESSAGEBOX_ERROR,
|
||||||
.window = NULL,
|
.window = NULL,
|
||||||
|
|
@ -111,8 +111,8 @@ void crash(Exception::Type t, const char *fmt, ...){
|
||||||
}catch(const std::exception& e){
|
}catch(const std::exception& e){
|
||||||
o << "Detected OS: " << e.what() << std::endl;
|
o << "Detected OS: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
if(!getenv("XDG_CURRENT_DESKTOP") == NULL){
|
if(!SDL_getenv("XDG_CURRENT_DESKTOP") == NULL){
|
||||||
o << "Desktop enviroment(XDG_CURRENT_DESKTOP): " << getenv("XDG_CURRENT_DESKTOP") << std::endl;
|
o << "Desktop enviroment(XDG_CURRENT_DESKTOP): " << SDL_getenv("XDG_CURRENT_DESKTOP") << std::endl;
|
||||||
}
|
}
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
o << "Android API version: " << android_get_device_api_level() << std::endl;
|
o << "Android API version: " << android_get_device_api_level() << std::endl;
|
||||||
|
|
@ -130,7 +130,7 @@ void crash(Exception::Type t, const char *fmt, ...){
|
||||||
o << "Emscripten start address of the stack: " << emscripten_stack_get_base() << std::endl;
|
o << "Emscripten start address of the stack: " << emscripten_stack_get_base() << std::endl;
|
||||||
o << "Emscripten end address of the stack: " << emscripten_stack_get_end() << std::endl;
|
o << "Emscripten end address of the stack: " << emscripten_stack_get_end() << std::endl;
|
||||||
o << "Emscripten current stack pointer: " << emscripten_stack_get_current() << std::endl;
|
o << "Emscripten current stack pointer: " << emscripten_stack_get_current() << std::endl;
|
||||||
o << "Emscripten number of free bytes left on stack: " << emscripten_stack_get_free() << std::endl;
|
o << "Emscripten number of SDL_free bytes left on stack: " << emscripten_stack_get_free() << std::endl;
|
||||||
#elif __PSP__
|
#elif __PSP__
|
||||||
o << "PSPdev MIPS Stack Trace: " << int pspDebugGetStackTrace() << std::endl;
|
o << "PSPdev MIPS Stack Trace: " << int pspDebugGetStackTrace() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ std::string sha256_file(const std::string &fn) {
|
||||||
out.reserve(SHA256_DIGEST_LENGTH * 2);
|
out.reserve(SHA256_DIGEST_LENGTH * 2);
|
||||||
char hex[3] = {0};
|
char hex[3] = {0};
|
||||||
for (int i = 0; i < SHA256_DIGEST_LENGTH; ++i) {
|
for (int i = 0; i < SHA256_DIGEST_LENGTH; ++i) {
|
||||||
snprintf(hex, sizeof hex, "%02x", hash[i]);
|
SDL_snprintf(hex, sizeof hex, "%02x", hash[i]);
|
||||||
out += hex;
|
out += hex;
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
|
|
|
||||||
|
|
@ -239,8 +239,8 @@ Oneshot::Oneshot(RGSSThreadData &threadData) : threadData(threadData)
|
||||||
p->journal = "_______.exe";
|
p->journal = "_______.exe";
|
||||||
#else
|
#else
|
||||||
// Get language code
|
// Get language code
|
||||||
const char *lc_all = getenv("LC_ALL");
|
const char *lc_all = SDL_getenv("LC_ALL");
|
||||||
const char *lang = getenv("LANG");
|
const char *lang = SDL_getenv("LANG");
|
||||||
const char *code = (lc_all ? lc_all : lang);
|
const char *code = (lc_all ? lc_all : lang);
|
||||||
if (code)
|
if (code)
|
||||||
{
|
{
|
||||||
|
|
@ -277,7 +277,7 @@ Oneshot::Oneshot(RGSSThreadData &threadData) : threadData(threadData)
|
||||||
|
|
||||||
// Get documents path
|
// Get documents path
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
std::string path = std::string(getenv("HOME")) + "/Documents";
|
std::string path = std::string(SDL_getenv("HOME")) + "/Documents";
|
||||||
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";
|
||||||
|
|
@ -293,7 +293,7 @@ Oneshot::Oneshot(RGSSThreadData &threadData) : threadData(threadData)
|
||||||
Debug() << "[oneshot] Docs path :" << p->docsPath;
|
Debug() << "[oneshot] Docs path :" << p->docsPath;
|
||||||
|
|
||||||
#ifdef unix_like
|
#ifdef unix_like
|
||||||
char const *xdg_current_desktop = getenv("XDG_CURRENT_DESKTOP");
|
char const *xdg_current_desktop = SDL_getenv("XDG_CURRENT_DESKTOP");
|
||||||
gtk_init(0, 0);
|
gtk_init(0, 0);
|
||||||
|
|
||||||
if (xdg_current_desktop == NULL)
|
if (xdg_current_desktop == NULL)
|
||||||
|
|
@ -303,7 +303,7 @@ Oneshot::Oneshot(RGSSThreadData &threadData) : threadData(threadData)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string desktop(xdg_current_desktop);
|
std::string desktop(xdg_current_desktop);
|
||||||
std::transform(desktop.begin(), desktop.end(), desktop.begin(), ::tolower);
|
std::transform(desktop.begin(), desktop.end(), desktop.begin(), ::SDL_tolower);
|
||||||
if (desktop.find("cinnamon") != std::string::npos)
|
if (desktop.find("cinnamon") != std::string::npos)
|
||||||
{
|
{
|
||||||
desktopEnv = "cinnamon";
|
desktopEnv = "cinnamon";
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ public:
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
OVERLAPPED overlapped;
|
OVERLAPPED overlapped;
|
||||||
memset(&overlapped, 0, sizeof(overlapped));
|
SDL_memset(&overlapped, 0, sizeof(overlapped));
|
||||||
if (!ReadFile(handle, buf, 1, NULL, &overlapped)){
|
if (!ReadFile(handle, buf, 1, NULL, &overlapped)){
|
||||||
if (GetLastError() == ERROR_IO_PENDING)
|
if (GetLastError() == ERROR_IO_PENDING)
|
||||||
CancelIo(handle);
|
CancelIo(handle);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
#include "signals/signal.h"
|
#include "signals/signal.h"
|
||||||
|
|
||||||
static float fwrap(float value, float range){
|
static float fwrap(float value, float range){
|
||||||
float res = fmod(value, range);
|
float res = SDL_fmod(value, range);
|
||||||
return res < 0 ? res + range : res;
|
return res < 0 ? res + range : res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,8 +133,8 @@ struct PlanePrivate{
|
||||||
int vph = sceneGeo.rect.h;
|
int vph = sceneGeo.rect.h;
|
||||||
|
|
||||||
/* Amount the scaled bitmap is tiled (repeated) */
|
/* Amount the scaled bitmap is tiled (repeated) */
|
||||||
size_t tilesX = ceil((vpw - sw + wox) / sw) + 1;
|
size_t tilesX = SDL_ceil((vpw - sw + wox) / sw) + 1;
|
||||||
size_t tilesY = ceil((vph - sh + woy) / sh) + 1;
|
size_t tilesY = SDL_ceil((vph - sh + woy) / sh) + 1;
|
||||||
|
|
||||||
FloatRect tex = srcRect->toFloatRect();
|
FloatRect tex = srcRect->toFloatRect();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -22,8 +22,7 @@
|
||||||
#include "rgssad.h"
|
#include "rgssad.h"
|
||||||
#include "boost-hash.h"
|
#include "boost-hash.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <SDL3/SDL_stdinc.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
struct RGSS_entryData{
|
struct RGSS_entryData{
|
||||||
int64_t offset;
|
int64_t offset;
|
||||||
|
|
@ -143,7 +142,7 @@ static PHYSFS_sint64 RGSS_ioRead(PHYSFS_Io *self, void *buffer, PHYSFS_uint64 le
|
||||||
|
|
||||||
/* Shift them back to normal */
|
/* Shift them back to normal */
|
||||||
dword >>= 8 * (offs % 4);
|
dword >>= 8 * (offs % 4);
|
||||||
memcpy(bBufferP, &dword, preAlign);
|
SDL_memcpy(bBufferP, &dword, preAlign);
|
||||||
|
|
||||||
bBufferP += preAlign;
|
bBufferP += preAlign;
|
||||||
|
|
||||||
|
|
@ -173,7 +172,7 @@ static PHYSFS_sint64 RGSS_ioRead(PHYSFS_Io *self, void *buffer, PHYSFS_uint64 le
|
||||||
|
|
||||||
/* Bytes are already aligned with magic */
|
/* Bytes are already aligned with magic */
|
||||||
dword ^= entry->currentMagic;
|
dword ^= entry->currentMagic;
|
||||||
memcpy(bBufferP, &dword, postAlign);
|
SDL_memcpy(bBufferP, &dword, postAlign);
|
||||||
}
|
}
|
||||||
|
|
||||||
entry->currentOffset += toRead;
|
entry->currentOffset += toRead;
|
||||||
|
|
@ -291,7 +290,7 @@ static bool verifyHeader(PHYSFS_Io *io, char version){
|
||||||
if (!IO_READ(io, header, sizeof(header)))
|
if (!IO_READ(io, header, sizeof(header)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (strcmp(header, RGSS_HEADER))
|
if (SDL_strcmp(header, RGSS_HEADER))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (header[7] != version)
|
if (header[7] != version)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -93,7 +93,7 @@ protected:
|
||||||
/* A bit about OpenGL state:
|
/* A bit about OpenGL state:
|
||||||
*
|
*
|
||||||
* If we're not inside the draw cycle (ie. the 'draw()'
|
* If we're not inside the draw cycle (ie. the 'draw()'
|
||||||
* handle), you're free to change any GL state through
|
* handle), you're SDL_free to change any GL state through
|
||||||
* gl-util, except for those in GLState which you should
|
* gl-util, except for those in GLState which you should
|
||||||
* push/pop as needed.
|
* push/pop as needed.
|
||||||
*
|
*
|
||||||
|
|
@ -101,7 +101,7 @@ protected:
|
||||||
* things in GLState. For scissored rendering, use push with
|
* things in GLState. For scissored rendering, use push with
|
||||||
* setIntersect(), and then pop afterwards.
|
* setIntersect(), and then pop afterwards.
|
||||||
* Blendmode you can push/pop as you like. Do NOT touch viewport.
|
* Blendmode you can push/pop as you like. Do NOT touch viewport.
|
||||||
* Texture/Shader bindings you're free to modify without
|
* Texture/Shader bindings you're SDL_free to modify without
|
||||||
* cleanup (and therefore you should expect dirty state).
|
* cleanup (and therefore you should expect dirty state).
|
||||||
* Do NOT touch the FBO::Draw binding. If you have to do work
|
* Do NOT touch the FBO::Draw binding. If you have to do work
|
||||||
* immediately before drawing that touches this (such as flushing
|
* immediately before drawing that touches this (such as flushing
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ int screenMain(Config &conf){
|
||||||
|
|
||||||
// Change shape
|
// Change shape
|
||||||
if (readMessage(ipc, messageBuf, sizeof(messageBuf))) {
|
if (readMessage(ipc, messageBuf, sizeof(messageBuf))) {
|
||||||
if (strcmp(messageBuf, "END") == 0)
|
if (SDL_strcmp(messageBuf, "END") == 0)
|
||||||
break;
|
break;
|
||||||
std::string imgname = conf.gameFolder + "/Journal/" + messageBuf + ".png";
|
std::string imgname = conf.gameFolder + "/Journal/" + messageBuf + ".png";
|
||||||
SDL_DestroySurface(shape);
|
SDL_DestroySurface(shape);
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ private:
|
||||||
char *start = base;
|
char *start = base;
|
||||||
|
|
||||||
if (eback() == base){
|
if (eback() == base){
|
||||||
memmove(base, egptr() - pbSize, pbSize);
|
SDL_memmove(base, egptr() - pbSize, pbSize);
|
||||||
start += pbSize;
|
start += pbSize;
|
||||||
}
|
}
|
||||||
//size_t SDL_ReadIO(SDL_IOStream *context, void *ptr, size_t size);
|
//size_t SDL_ReadIO(SDL_IOStream *context, void *ptr, size_t size);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
static inline int32_t readInt32(const char **dataP){
|
static inline int32_t readInt32(const char **dataP){
|
||||||
int32_t result;
|
int32_t result;
|
||||||
|
|
||||||
memcpy(&result, *dataP, 4);
|
SDL_memcpy(&result, *dataP, 4);
|
||||||
*dataP += 4;
|
*dataP += 4;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -43,19 +43,19 @@ static inline int32_t readInt32(const char **dataP){
|
||||||
static inline double readDouble(const char **dataP){
|
static inline double readDouble(const char **dataP){
|
||||||
double result;
|
double result;
|
||||||
|
|
||||||
memcpy(&result, *dataP, 8);
|
SDL_memcpy(&result, *dataP, 8);
|
||||||
*dataP += 8;
|
*dataP += 8;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void writeInt32(char **dataP, int32_t value){
|
static inline void writeInt32(char **dataP, int32_t value){
|
||||||
memcpy(*dataP, &value, 4);
|
SDL_memcpy(*dataP, &value, 4);
|
||||||
*dataP += 4;
|
*dataP += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void writeDouble(char **dataP, double value){
|
static inline void writeDouble(char **dataP, double value){
|
||||||
memcpy(*dataP, &value, 8);
|
SDL_memcpy(*dataP, &value, 8);
|
||||||
*dataP += 8;
|
*dataP += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -72,20 +72,20 @@ static void printShaderLog(GLuint shader){
|
||||||
GLint logLength;
|
GLint logLength;
|
||||||
gl.GetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength);
|
gl.GetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength);
|
||||||
|
|
||||||
std::string log(logLength, '\0');
|
std::string SDL_log(logLength, '\0');
|
||||||
gl.GetShaderInfoLog(shader, log.size(), 0, &log[0]);
|
gl.GetShaderInfoLog(shader, SDL_log.size(), 0, &SDL_log[0]);
|
||||||
|
|
||||||
Debug() << "Shader log:\n" << log;
|
Debug() << "Shader SDL_log:\n" << SDL_log;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printProgramLog(GLuint program){
|
static void printProgramLog(GLuint program){
|
||||||
GLint logLength;
|
GLint logLength;
|
||||||
gl.GetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength);
|
gl.GetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength);
|
||||||
|
|
||||||
std::string log(logLength, '\0');
|
std::string SDL_log(logLength, '\0');
|
||||||
gl.GetProgramInfoLog(program, log.size(), 0, &log[0]);
|
gl.GetProgramInfoLog(program, SDL_log.size(), 0, &SDL_log[0]);
|
||||||
|
|
||||||
Debug() << "Program log:\n" << log;
|
Debug() << "Program SDL_log:\n" << SDL_log;
|
||||||
}
|
}
|
||||||
|
|
||||||
Shader::Shader(){
|
Shader::Shader(){
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
@ -119,7 +119,7 @@ void SoundEmitter::play(const std::string &filename, int volume, int pitch) {
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Try to find first free source */
|
/* Try to find first SDL_free source */
|
||||||
size_t i;
|
size_t i;
|
||||||
for (i = 0; i < srcCount; ++i)
|
for (i = 0; i < srcCount; ++i)
|
||||||
if (AL::Source::getState(alSrcs[srcPrio[i]]) != AL_PLAYING)
|
if (AL::Source::getState(alSrcs[srcPrio[i]]) != AL_PLAYING)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2014 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
**
|
**
|
||||||
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
** Copyright (C) 2013 Jonas Kulla <Nyocurio@gmail.com>
|
||||||
**
|
**
|
||||||
** mkxp is free software: you can redistribute it and/or modify
|
** mkxp is SDL_free software: you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
** the Free Software Foundation, either version 2 of the License, or
|
** the Free Software Foundation, either version 2 of the License, or
|
||||||
** (at your option) any later version.
|
** (at your option) any later version.
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue