From d07803347253c5df9fadf1e12aac19af84675180 Mon Sep 17 00:00:00 2001 From: Morten Delenk Date: Sat, 9 Jul 2016 09:51:11 +0200 Subject: [PATCH] Update to ruby v100r1 --- audio/openal.cpp | 4 ++-- input/joypad/udev.cpp | 2 +- input/xlib.cpp | 6 +++--- ruby.cpp | 6 +++--- ruby.hpp | 6 +++--- video/cgl.cpp | 8 ++++---- video/opengl/main.hpp | 4 ++-- video/opengl/program.hpp | 6 +++--- video/wgl.cpp | 6 +++--- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/audio/openal.cpp b/audio/openal.cpp index c5bde3b..1895fa9 100644 --- a/audio/openal.cpp +++ b/audio/openal.cpp @@ -172,8 +172,8 @@ struct AudioOpenAL : Audio { } private: - auto queryDevices() -> lstring { - lstring result; + auto queryDevices() -> string_vector { + string_vector result; const char* buffer = alcGetString(nullptr, ALC_DEVICE_SPECIFIER); if(!buffer) return result; diff --git a/input/joypad/udev.cpp b/input/joypad/udev.cpp index 941175c..6c02a7c 100644 --- a/input/joypad/udev.cpp +++ b/input/joypad/udev.cpp @@ -257,7 +257,7 @@ private: auto createJoypadHID(Joypad& jp) -> void { 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.hats.size(); n++) jp.hid->hats().append(n); diff --git a/input/xlib.cpp b/input/xlib.cpp index b84c24e..77919f6 100644 --- a/input/xlib.cpp +++ b/input/xlib.cpp @@ -14,7 +14,7 @@ struct InputXlib : Input { ~InputXlib() { term(); } struct Settings { - uintptr handle = 0; + uintptr_t handle = 0; } settings; auto cap(const string& name) -> bool { @@ -29,8 +29,8 @@ struct InputXlib : Input { } auto set(const string& name, const any& value) -> bool { - if(name == Input::Handle && value.is()) { - settings.handle = value.get(); + if(name == Input::Handle && value.is()) { + settings.handle = value.get(); return true; } diff --git a/ruby.cpp b/ruby.cpp index 6eeaf06..a54cd2f 100644 --- a/ruby.cpp +++ b/ruby.cpp @@ -179,7 +179,7 @@ auto Video::safestDriver() -> string { #endif } -auto Video::availableDrivers() -> lstring { +auto Video::availableDrivers() -> string_vector { return { #if defined(VIDEO_WGL) @@ -364,7 +364,7 @@ auto Audio::safestDriver() -> string { #endif } -auto Audio::availableDrivers() -> lstring { +auto Audio::availableDrivers() -> string_vector { return { #if defined(AUDIO_WASAPI) @@ -508,7 +508,7 @@ auto Input::safestDriver() -> string { #endif } -auto Input::availableDrivers() -> lstring { +auto Input::availableDrivers() -> string_vector { return { #if defined(INPUT_WINDOWS) diff --git a/ruby.hpp b/ruby.hpp index c933c05..5b2fffb 100644 --- a/ruby.hpp +++ b/ruby.hpp @@ -26,7 +26,7 @@ struct Video { static auto create(const nall::string& driver = "") -> Video*; static auto optimalDriver() -> nall::string; static auto safestDriver() -> nall::string; - static auto availableDrivers() -> nall::lstring; + static auto availableDrivers() -> nall::string_vector; virtual ~Video() = default; @@ -54,7 +54,7 @@ struct Audio { static auto create(const nall::string& driver = "") -> Audio*; static auto optimalDriver() -> nall::string; static auto safestDriver() -> nall::string; - static auto availableDrivers() -> nall::lstring; + static auto availableDrivers() -> nall::string_vector; virtual ~Audio() = default; @@ -79,7 +79,7 @@ struct Input { static auto create(const nall::string& driver = "") -> Input*; static auto optimalDriver() -> nall::string; static auto safestDriver() -> nall::string; - static auto availableDrivers() -> nall::lstring; + static auto availableDrivers() -> nall::string_vector; virtual ~Input() = default; diff --git a/video/cgl.cpp b/video/cgl.cpp index eed6cce..b51212a 100644 --- a/video/cgl.cpp +++ b/video/cgl.cpp @@ -32,15 +32,15 @@ struct VideoCGL : Video, OpenGL { } 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::Filter) return settings.filter; return {}; } auto set(const string& name, const any& value) -> bool { - if(name == Video::Handle && value.is()) { - settings.handle = (NSView*)value.get(); + if(name == Video::Handle && value.is()) { + settings.handle = (NSView*)value.get(); return true; } @@ -78,7 +78,7 @@ struct VideoCGL : Video, OpenGL { 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); return OpenGL::lock(data, pitch); } diff --git a/video/opengl/main.hpp b/video/opengl/main.hpp index e664fde..a5ac409 100644 --- a/video/opengl/main.hpp +++ b/video/opengl/main.hpp @@ -28,11 +28,11 @@ auto OpenGL::shader(const string& pathname) -> void { for(auto node : document["output"]) { string text = node.text(); 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(); } 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(); } } diff --git a/video/opengl/program.hpp b/video/opengl/program.hpp index 0c2fda6..04b727b 100644 --- a/video/opengl/program.hpp +++ b/video/opengl/program.hpp @@ -4,9 +4,9 @@ auto OpenGLProgram::bind(OpenGL* instance, const Markup::Node& node, const strin modulo = glrModulo(node["modulo"].integer()); 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(); - if(h.endsWith("%")) relativeHeight = real(h.trimRight("%", 1L)) / 100.0; + if(h.endsWith("%")) relativeHeight = toReal(h.trimRight("%", 1L)) / 100.0; else absoluteHeight = h.natural(); 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 auto OpenGLProgram::parse(OpenGL* instance, string& source) -> void { - lstring lines = source.split("\n"); + auto lines = source.split("\n"); for(auto& line : lines) { string s = line; if(auto position = s.find("//")) s.resize(position()); //strip comments diff --git a/video/wgl.cpp b/video/wgl.cpp index 82fcfb7..f556f58 100644 --- a/video/wgl.cpp +++ b/video/wgl.cpp @@ -30,15 +30,15 @@ struct VideoWGL : Video, OpenGL { } 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::Filter) return settings.filter; return {}; } auto set(const string& name, const any& value) -> bool { - if(name == Video::Handle && value.is()) { - settings.handle = (HWND)value.get(); + if(name == Video::Handle && value.is()) { + settings.handle = (HWND)value.get(); return true; }