aboutsummaryrefslogtreecommitdiffstats
path: root/android/qemulator.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-01-19 22:18:02 +0100
committerDavid 'Digit' Turner <digit@android.com>2011-01-19 22:28:52 +0100
commit3bbc919b70c78e0be6387d06faa90743deedb4dc (patch)
tree9381676c67914b253f4e3ebfe67bdd361394358f /android/qemulator.c
parent3336176fc898915b7b5544f3a7c60ec2794507c3 (diff)
downloadexternal_qemu-3bbc919b70c78e0be6387d06faa90743deedb4dc.zip
external_qemu-3bbc919b70c78e0be6387d06faa90743deedb4dc.tar.gz
external_qemu-3bbc919b70c78e0be6387d06faa90743deedb4dc.tar.bz2
Compute default memory size from screen size.
This change is used when using a magic skin (e.g. -skin 800x600) or when using the full Android build system, in order to determine a good default for the RAM size. Change-Id: I900e28146592cdd3f0df9b3f1828b119309eea85
Diffstat (limited to 'android/qemulator.c')
-rw-r--r--android/qemulator.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/android/qemulator.c b/android/qemulator.c
index 3f427b8..35e7cc8 100644
--- a/android/qemulator.c
+++ b/android/qemulator.c
@@ -188,6 +188,22 @@ qemulator_done(QEmulator* emulator)
}
}
+void
+qemulator_get_screen_size( QEmulator* emulator,
+ int *width,
+ int *height )
+{
+ AConfig* root = emulator->aconfig;
+ AConfig* disp;
+
+ *width = *height = 0;
+ if (root == NULL || (disp = aconfig_find(root, "display")) == NULL)
+ return;
+
+ *width = aconfig_int(disp, "width", 0);
+ *height = aconfig_int(disp, "height", 0);
+}
+
SkinLayout*
qemulator_get_layout(QEmulator* emulator)
{