mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-21 03:41:51 +02:00
Update to v098r10 release.
byuu says: Changelog: - synchronized tomoko, loki, icarus with extensive changes to nall (118KiB diff)
This commit is contained in:
@@ -82,14 +82,14 @@ struct VideoGLX : Video, OpenGL {
|
||||
|
||||
if(name == Video::Filter && value.is<unsigned>()) {
|
||||
settings.filter = value.get<unsigned>();
|
||||
if(settings.shader.empty()) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST;
|
||||
if(!settings.shader) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(name == Video::Shader && value.is<string>()) {
|
||||
settings.shader = value.get<string>();
|
||||
OpenGL::shader(settings.shader);
|
||||
if(settings.shader.empty()) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST;
|
||||
if(!settings.shader) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -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.rtrim("%", 1L)) / 100.0;
|
||||
if(text.endsWith("%")) relativeWidth = real(text.trimRight("%", 1L)) / 100.0;
|
||||
else absoluteWidth = text.natural();
|
||||
}
|
||||
if(node.name() == "height") {
|
||||
if(text.endsWith("%")) relativeHeight = real(text.rtrim("%", 1L)) / 100.0;
|
||||
if(text.endsWith("%")) relativeHeight = real(text.trimRight("%", 1L)) / 100.0;
|
||||
else absoluteHeight = text.natural();
|
||||
}
|
||||
}
|
||||
|
@@ -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.rtrim("%", 1L)) / 100.0;
|
||||
if(w.endsWith("%")) relativeWidth = real(w.trimRight("%", 1L)) / 100.0;
|
||||
else absoluteWidth = w.natural();
|
||||
if(h.endsWith("%")) relativeHeight = real(h.rtrim("%", 1L)) / 100.0;
|
||||
if(h.endsWith("%")) relativeHeight = real(h.trimRight("%", 1L)) / 100.0;
|
||||
else absoluteHeight = h.natural();
|
||||
|
||||
format = glrFormat(node["format"].text());
|
||||
@@ -41,8 +41,8 @@ auto OpenGLProgram::bind(OpenGL* instance, const Markup::Node& node, const strin
|
||||
|
||||
for(auto& leaf : node.find("pixmap")) {
|
||||
nall::image image({pathname, leaf.text()});
|
||||
if(!image) continue;
|
||||
image.transform();
|
||||
if(image.empty()) continue;
|
||||
|
||||
GLuint texture;
|
||||
glGenTextures(1, &texture);
|
||||
@@ -78,7 +78,7 @@ auto OpenGLProgram::parse(OpenGL* instance, string& source) -> void {
|
||||
if(auto position = s.find("//")) s.resize(position()); //strip comments
|
||||
s.strip(); //remove extraneous whitespace
|
||||
if(s.match("#in ?*")) {
|
||||
s.ltrim("#in ", 1L).strip();
|
||||
s.trimLeft("#in ", 1L).strip();
|
||||
if(auto setting = instance->settings.find({s})) {
|
||||
line = {"#define ", setting().name, " ", setting().value};
|
||||
} else {
|
||||
|
@@ -48,7 +48,7 @@ struct VideoWGL : Video, OpenGL {
|
||||
if(wglcontext) {
|
||||
init();
|
||||
OpenGL::shader(settings.shader);
|
||||
if(settings.shader.empty()) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST;
|
||||
if(!settings.shader) OpenGL::filter = settings.filter ? GL_LINEAR : GL_NEAREST;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user