]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_gecko.c
added back the old method of comparing points to the parent planes,
[xonotic/darkplaces.git] / cl_gecko.c
index ede73ad858ef6ce0a8d74ef90a86de778e744919..2aade4b4b874a343ba96bccfed5f6a11a5aceb13 100644 (file)
@@ -325,7 +325,7 @@ OSGK_DERIVEDTYPE(OSGK_ScriptObjectTemplate);
 typedef enum OSGK_ScriptResult
 {
   srSuccess = 0,
-  srFailed = 0x80004005L /* actually NS_ERROR_FAILURE */
+  srFailed = (int)0x80004005L /* actually NS_ERROR_FAILURE */
 } OSGK_ScriptResult;
 
 typedef struct OSGK_ScriptObjectCreateParams_s
@@ -436,7 +436,7 @@ clgecko_t * CL_Gecko_FindBrowser( const char *name ) {
 }
 
 static void cl_gecko_updatecallback( rtexture_t *texture, void* callbackData ) {
-       clgecko_t *instance = callbackData;
+       clgecko_t *instance = (clgecko_t *) callbackData;
        const unsigned char *data;
        if( instance->browser ) {
                // TODO: OSGK only supports BGRA right now
@@ -449,7 +449,7 @@ static void cl_gecko_updatecallback( rtexture_t *texture, void* callbackData ) {
 static void cl_gecko_linktexture( clgecko_t *instance ) {
        // TODO: assert that instance->texture == NULL
        instance->texture = R_LoadTexture2D( cl_geckotexturepool, instance->name, 
-               instance->texWidth, instance->texHeight, NULL, TEXTYPE_BGRA, TEXF_ALPHA | TEXF_PERSISTENT, NULL );
+               instance->texWidth, instance->texHeight, NULL, TEXTYPE_BGRA, TEXF_ALPHA | TEXF_PERSISTENT | TEXF_ALLOWUPDATES, NULL );
        R_MakeTextureDynamic( instance->texture, cl_gecko_updatecallback, instance );
        CL_LinkDynTexture( instance->name, instance->texture );
 }
@@ -514,7 +514,7 @@ static OSGK_ScriptResult dpGlobal_query (void* objTag, void* methTag,
                                         OSGK_ScriptVariant** params,
                                         OSGK_ScriptVariant** returnVal)
 {
-  clgecko_t *instance = objTag;
+  clgecko_t *instance = (clgecko_t *) objTag;
   OSGK_ScriptVariant* strVal;
   OSGK_ScriptResult result = srFailed;
   prvm_prog_t * saveProg;
@@ -551,7 +551,7 @@ static OSGK_ScriptResult dpGlobal_query (void* objTag, void* methTag,
   return result;
 }
 
-#if defined(WIN64)
+#if defined(_WIN64)
 # define XULRUNNER_DIR_SUFFIX  "win64"
 #elif defined(WIN32)
 # define XULRUNNER_DIR_SUFFIX  "win32"
@@ -789,7 +789,7 @@ static void cl_gecko_injecttext_f( void ) {
                                break;
                }
 
-               CL_Gecko_Event_Key( instance, key, CLG_BET_PRESS );
+               CL_Gecko_Event_Key( instance, (keynum_t) key, CLG_BET_PRESS );
        }
 }
 
@@ -848,9 +848,7 @@ qboolean CL_Gecko_OpenLibrary (void)
 {
        const char* dllnames_gecko [] =
        {
-#if defined(WIN64)
-               "OffscreenGecko64.dll",
-#elif defined(WIN32)
+#if defined(WIN32)
                "OffscreenGecko.dll",
 #elif defined(MACOSX)
                "OffscreenGecko.dylib",
@@ -902,8 +900,8 @@ void CL_Gecko_Event_CursorMove( clgecko_t *instance, float x, float y ) {
                return;
        }
 
-       mappedx = x * instance->width;
-       mappedy = y * instance->height;
+       mappedx = (int) (x * instance->width);
+       mappedy = (int) (y * instance->height);
        osgk_browser_event_mouse_move( instance->browser, mappedx, mappedy );
 }