Update to ruby v100r1

This commit is contained in:
Morten Delenk 2016-07-09 09:51:11 +02:00
parent 0dd66ec634
commit d078033472
9 changed files with 24 additions and 24 deletions

View file

@ -172,8 +172,8 @@ struct AudioOpenAL : Audio {
} }
private: private:
auto queryDevices() -> lstring { auto queryDevices() -> string_vector {
lstring result; string_vector result;
const char* buffer = alcGetString(nullptr, ALC_DEVICE_SPECIFIER); const char* buffer = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
if(!buffer) return result; if(!buffer) return result;

View file

@ -257,7 +257,7 @@ private:
auto createJoypadHID(Joypad& jp) -> void { auto createJoypadHID(Joypad& jp) -> void {
uint64_t pathID = Hash::CRC32(jp.deviceName.data(), jp.deviceName.size()).value(); uint64_t pathID = Hash::CRC32(jp.deviceName.data(), jp.deviceName.size()).value();
jp.hid->setID(pathID << 32 | hex(jp.vendorID) << 16 | hex(jp.productID) << 0); jp.hid->setID(pathID << 32 | jp.vendorID.hex() << 16 | jp.productID.hex() << 0);
for(unsigned n = 0; n < jp.axes.size(); n++) jp.hid->axes().append(n); for(unsigned n = 0; n < jp.axes.size(); n++) jp.hid->axes().append(n);
for(unsigned n = 0; n < jp.hats.size(); n++) jp.hid->hats().append(n); for(unsigned n = 0; n < jp.hats.size(); n++) jp.hid->hats().append(n);

View file

@ -14,7 +14,7 @@ struct InputXlib : Input {
~InputXlib() { term(); } ~InputXlib() { term(); }
struct Settings { struct Settings {
uintptr handle = 0; uintptr_t handle = 0;
} settings; } settings;
auto cap(const string& name) -> bool { auto cap(const string& name) -> bool {
@ -29,8 +29,8 @@ struct InputXlib : Input {
} }
auto set(const string& name, const any& value) -> bool { auto set(const string& name, const any& value) -> bool {
if(name == Input::Handle && value.is<uintptr>()) { if(name == Input::Handle && value.is<uintptr_t>()) {
settings.handle = value.get<uintptr>(); settings.handle = value.get<uintptr_t>();
return true; return true;
} }

View file

@ -179,7 +179,7 @@ auto Video::safestDriver() -> string {
#endif #endif
} }
auto Video::availableDrivers() -> lstring { auto Video::availableDrivers() -> string_vector {
return { return {
#if defined(VIDEO_WGL) #if defined(VIDEO_WGL)
@ -364,7 +364,7 @@ auto Audio::safestDriver() -> string {
#endif #endif
} }
auto Audio::availableDrivers() -> lstring { auto Audio::availableDrivers() -> string_vector {
return { return {
#if defined(AUDIO_WASAPI) #if defined(AUDIO_WASAPI)
@ -508,7 +508,7 @@ auto Input::safestDriver() -> string {
#endif #endif
} }
auto Input::availableDrivers() -> lstring { auto Input::availableDrivers() -> string_vector {
return { return {
#if defined(INPUT_WINDOWS) #if defined(INPUT_WINDOWS)

View file

@ -26,7 +26,7 @@ struct Video {
static auto create(const nall::string& driver = "") -> Video*; static auto create(const nall::string& driver = "") -> Video*;
static auto optimalDriver() -> nall::string; static auto optimalDriver() -> nall::string;
static auto safestDriver() -> nall::string; static auto safestDriver() -> nall::string;
static auto availableDrivers() -> nall::lstring; static auto availableDrivers() -> nall::string_vector;
virtual ~Video() = default; virtual ~Video() = default;
@ -54,7 +54,7 @@ struct Audio {
static auto create(const nall::string& driver = "") -> Audio*; static auto create(const nall::string& driver = "") -> Audio*;
static auto optimalDriver() -> nall::string; static auto optimalDriver() -> nall::string;
static auto safestDriver() -> nall::string; static auto safestDriver() -> nall::string;
static auto availableDrivers() -> nall::lstring; static auto availableDrivers() -> nall::string_vector;
virtual ~Audio() = default; virtual ~Audio() = default;
@ -79,7 +79,7 @@ struct Input {
static auto create(const nall::string& driver = "") -> Input*; static auto create(const nall::string& driver = "") -> Input*;
static auto optimalDriver() -> nall::string; static auto optimalDriver() -> nall::string;
static auto safestDriver() -> nall::string; static auto safestDriver() -> nall::string;
static auto availableDrivers() -> nall::lstring; static auto availableDrivers() -> nall::string_vector;
virtual ~Input() = default; virtual ~Input() = default;

View file

@ -32,15 +32,15 @@ struct VideoCGL : Video, OpenGL {
} }
auto get(const string& name) -> any { auto get(const string& name) -> any {
if(name == Video::Handle) return (uintptr)settings.handle; if(name == Video::Handle) return (uintptr_t)settings.handle;
if(name == Video::Synchronize) return settings.synchronize; if(name == Video::Synchronize) return settings.synchronize;
if(name == Video::Filter) return settings.filter; if(name == Video::Filter) return settings.filter;
return {}; return {};
} }
auto set(const string& name, const any& value) -> bool { auto set(const string& name, const any& value) -> bool {
if(name == Video::Handle && value.is<uintptr>()) { if(name == Video::Handle && value.is<uintptr_t>()) {
settings.handle = (NSView*)value.get<uintptr>(); settings.handle = (NSView*)value.get<uintptr_t>();
return true; return true;
} }
@ -78,7 +78,7 @@ struct VideoCGL : Video, OpenGL {
return false; return false;
} }
auto lock(uint32*& data, uint& pitch, uint width, uint height) -> bool { auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
OpenGL::size(width, height); OpenGL::size(width, height);
return OpenGL::lock(data, pitch); return OpenGL::lock(data, pitch);
} }

View file

@ -28,11 +28,11 @@ auto OpenGL::shader(const string& pathname) -> void {
for(auto node : document["output"]) { for(auto node : document["output"]) {
string text = node.text(); string text = node.text();
if(node.name() == "width") { if(node.name() == "width") {
if(text.endsWith("%")) relativeWidth = real(text.trimRight("%", 1L)) / 100.0; if(text.endsWith("%")) relativeWidth = toReal(text.trimRight("%", 1L)) / 100.0;
else absoluteWidth = text.natural(); else absoluteWidth = text.natural();
} }
if(node.name() == "height") { if(node.name() == "height") {
if(text.endsWith("%")) relativeHeight = real(text.trimRight("%", 1L)) / 100.0; if(text.endsWith("%")) relativeHeight = toReal(text.trimRight("%", 1L)) / 100.0;
else absoluteHeight = text.natural(); else absoluteHeight = text.natural();
} }
} }

View file

@ -4,9 +4,9 @@ auto OpenGLProgram::bind(OpenGL* instance, const Markup::Node& node, const strin
modulo = glrModulo(node["modulo"].integer()); modulo = glrModulo(node["modulo"].integer());
string w = node["width"].text(), h = node["height"].text(); string w = node["width"].text(), h = node["height"].text();
if(w.endsWith("%")) relativeWidth = real(w.trimRight("%", 1L)) / 100.0; if(w.endsWith("%")) relativeWidth = toReal(w.trimRight("%", 1L)) / 100.0;
else absoluteWidth = w.natural(); else absoluteWidth = w.natural();
if(h.endsWith("%")) relativeHeight = real(h.trimRight("%", 1L)) / 100.0; if(h.endsWith("%")) relativeHeight = toReal(h.trimRight("%", 1L)) / 100.0;
else absoluteHeight = h.natural(); else absoluteHeight = h.natural();
format = glrFormat(node["format"].text()); format = glrFormat(node["format"].text());
@ -72,7 +72,7 @@ auto OpenGLProgram::bind(OpenGL* instance, const Markup::Node& node, const strin
//apply manifest settings to shader source #in tags //apply manifest settings to shader source #in tags
auto OpenGLProgram::parse(OpenGL* instance, string& source) -> void { auto OpenGLProgram::parse(OpenGL* instance, string& source) -> void {
lstring lines = source.split("\n"); auto lines = source.split("\n");
for(auto& line : lines) { for(auto& line : lines) {
string s = line; string s = line;
if(auto position = s.find("//")) s.resize(position()); //strip comments if(auto position = s.find("//")) s.resize(position()); //strip comments

View file

@ -30,15 +30,15 @@ struct VideoWGL : Video, OpenGL {
} }
auto get(const string& name) -> any { auto get(const string& name) -> any {
if(name == Video::Handle) return (uintptr)settings.handle; if(name == Video::Handle) return (uintptr_t)settings.handle;
if(name == Video::Synchronize) return settings.synchronize; if(name == Video::Synchronize) return settings.synchronize;
if(name == Video::Filter) return settings.filter; if(name == Video::Filter) return settings.filter;
return {}; return {};
} }
auto set(const string& name, const any& value) -> bool { auto set(const string& name, const any& value) -> bool {
if(name == Video::Handle && value.is<uintptr>()) { if(name == Video::Handle && value.is<uintptr_t>()) {
settings.handle = (HWND)value.get<uintptr>(); settings.handle = (HWND)value.get<uintptr_t>();
return true; return true;
} }