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:
auto queryDevices() -> lstring {
lstring result;
auto queryDevices() -> string_vector {
string_vector result;
const char* buffer = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
if(!buffer) return result;

View file

@ -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);

View file

@ -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<uintptr>()) {
settings.handle = value.get<uintptr>();
if(name == Input::Handle && value.is<uintptr_t>()) {
settings.handle = value.get<uintptr_t>();
return true;
}

View file

@ -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)

View file

@ -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;

View file

@ -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<uintptr>()) {
settings.handle = (NSView*)value.get<uintptr>();
if(name == Video::Handle && value.is<uintptr_t>()) {
settings.handle = (NSView*)value.get<uintptr_t>();
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);
}

View file

@ -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();
}
}

View file

@ -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

View file

@ -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<uintptr>()) {
settings.handle = (HWND)value.get<uintptr>();
if(name == Video::Handle && value.is<uintptr_t>()) {
settings.handle = (HWND)value.get<uintptr_t>();
return true;
}