non-composited mode
[drnoksnes] / platform / hgw.cpp
index 022b857..33f382e 100644 (file)
@@ -23,20 +23,20 @@ void HgwInit()
 {
        // hildon-games-wrapper sets this env variable for itself.
        char* service = getenv("HGW_EXEC_SERVICE");
-       
+
        if (!service) {
                // Not launched from hildon-games-wrapper
                hgwLaunched = false;
                return;
        }
-       
+
        hgw = hgw_context_init();
-       
+
        if (!hgw) {
                fprintf(stderr, "Error opening hgw context\n");
                hgwLaunched = false;
        }
-       
+
        hgwLaunched = true;
        printf("Loading in HGW mode\n");
 }
@@ -54,15 +54,17 @@ void HgwDeinit()
 void HgwConfig()
 {
        if (!hgwLaunched) return;
-       
+
        Config.fullscreen = true;
-       
+
        char romFile[PATH_MAX + 1];
-       if (hgw_conf_request_string(hgw, kGConfRomFile, romFile) == HGW_ERR_NONE) {
+       if (hgw_conf_request_string(hgw, kGConfRomFile, romFile) == HGW_ERR_NONE
+               && strlen(romFile) > 0) {
                S9xSetRomFile(romFile);
        } else {
-               hgw_context_destroy(hgw, HGW_BYE_INACTIVE);
-               DIE("No Rom in Gconf!");
+               printf("Exiting gracefully because there's no ROM in Gconf\n");
+               HgwDeinit();
+               exit(0);
        }
 
        char sound = FALSE;
@@ -87,7 +89,7 @@ void HgwConfig()
 
 #if CONF_XSP
        char xsp = TRUE;
-       if (hgw_conf_request_bool(hgw, kGConfXSP, xsp) == HGW_ERR_NONE) {
+       if (hgw_conf_request_bool(hgw, kGConfXSP, &xsp) == HGW_ERR_NONE) {
                if (!xsp) {
                        free(Config.scaler);
                        Config.scaler = strdup("2x");