[gnome-games/wip/exalm/ds: 2/15] retro-runner: Stop using x-dpi and y-dpi
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/ds: 2/15] retro-runner: Stop using x-dpi and y-dpi
- Date: Wed, 14 Aug 2019 11:46:16 +0000 (UTC)
commit fdd0b65d3b0df401951ef7ad135a71e87c8dc591
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Wed Aug 14 13:01:33 2019 +0500
retro-runner: Stop using x-dpi and y-dpi
retro-gtk deprecated them, use Retro.pixbuf_get_aspect_ratio() instead.
src/retro/retro-runner.vala | 23 +----------------------
1 file changed, 1 insertion(+), 22 deletions(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 37a16ad4..a48b6220 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -471,7 +471,7 @@ public class Games.RetroRunner : Object, Runner {
// Populate the metadata file
var now_time = new DateTime.now ();
var platform_prefix = platform.get_uid_prefix ();
- var ratio = get_screenshot_aspect_ratio ();
+ var ratio = Retro.pixbuf_get_aspect_ratio (current_state_pixbuf);
if (is_automatic)
tmp_live_savestate.set_metadata_automatic (now_time, platform_prefix, get_core_id (),
ratio);
else {
@@ -549,27 +549,6 @@ public class Games.RetroRunner : Object, Runner {
core.set_memory (Retro.MemoryType.SAVE_RAM, bytes);
}
- private double get_screenshot_aspect_ratio () {
- var pixbuf = current_state_pixbuf;
- if (pixbuf == null)
- return 0;
-
- var x_dpi = pixbuf.get_option ("x-dpi");
- var y_dpi = pixbuf.get_option ("y-dpi");
-
- if (x_dpi == null || y_dpi == null)
- return 0;
-
- float x = 0, y = 0;
- x_dpi.scanf ("%g", out x);
- y_dpi.scanf ("%g", out y);
-
- if (y == 0)
- return 0;
-
- return (double) x / y;
- }
-
private void save_screenshot_in_tmp () throws Error {
var pixbuf = current_state_pixbuf;
if (pixbuf == null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]