X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=cl_gecko.c;h=d92ed0a4fed6de3f221d5f20a7983d2ab2e40629;hb=1fa82ae49ae155e5258c0675fb619922281d6439;hp=ede73ad858ef6ce0a8d74ef90a86de778e744919;hpb=57c1440ade69ebe8e69c5efdccef084b9d6a507c;p=xonotic%2Fdarkplaces.git diff --git a/cl_gecko.c b/cl_gecko.c index ede73ad8..d92ed0a4 100644 --- a/cl_gecko.c +++ b/cl_gecko.c @@ -37,10 +37,10 @@ typedef struct OSGK_BaseObject_s OSGK_BaseObject; static int (*osgk_addref) (OSGK_BaseObject* obj); static int (*osgk_release) (OSGK_BaseObject* obj); -static OSGK_INLINE int osgk_addref_real (OSGK_BaseObject* obj) +/*static OSGK_INLINE int osgk_addref_real (OSGK_BaseObject* obj) { return osgk_addref (obj); -} +}*/ static OSGK_INLINE int osgk_release_real (OSGK_BaseObject* obj) { @@ -71,11 +71,11 @@ static OSGK_Embedding* (*osgk_embedding_create2) ( unsigned int apiVer, OSGK_EmbeddingOptions* options, OSGK_GeckoResult* geckoResult); -static OSGK_INLINE OSGK_Embedding* osgk_embedding_create ( +/*static OSGK_INLINE OSGK_Embedding* osgk_embedding_create ( OSGK_GeckoResult* geckoResult) { return osgk_embedding_create2 (OSGK_API_VERSION, 0, geckoResult); -} +}*/ static OSGK_INLINE OSGK_Embedding* osgk_embedding_create_with_options ( OSGK_EmbeddingOptions* options, OSGK_GeckoResult* geckoResult) @@ -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 @@ -405,9 +405,7 @@ static clgecko_t * cl_gecko_findunusedinstance( void ) { return instance; } } - if( developer.integer > 0 ) { - Con_Printf( "cl_gecko_findunusedinstance: out of geckos\n" ); - } + Con_DPrintf( "cl_gecko_findunusedinstance: out of geckos\n" ); return NULL; } @@ -415,9 +413,7 @@ clgecko_t * CL_Gecko_FindBrowser( const char *name ) { int i; if( !name || !*name || strncmp( name, CLGECKOPREFIX, sizeof( CLGECKOPREFIX ) - 1 ) != 0 ) { - if( developer.integer > 0 ) { - Con_Printf( "CL_Gecko_FindBrowser: Bad gecko texture name '%s'!\n", name ); - } + Con_DPrintf( "CL_Gecko_FindBrowser: Bad gecko texture name '%s'!\n", name ); return NULL; } @@ -428,20 +424,18 @@ clgecko_t * CL_Gecko_FindBrowser( const char *name ) { } } - if( developer.integer > 0 ) { - Con_Printf( "CL_Gecko_FindBrowser: No browser named '%s'!\n", name ); - } + Con_DPrintf( "CL_Gecko_FindBrowser: No browser named '%s'!\n", name ); return NULL; } 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 TIMING_TIMESTATEMENT(data = osgk_browser_lock_data( instance->browser, NULL )); - R_UpdateTexture( texture, data, 0, 0, instance->width, instance->height ); + R_UpdateTexture( texture, data, 0, 0, 0, instance->width, instance->height, 1 ); osgk_browser_unlock_data( instance->browser, data ); } } @@ -449,7 +443,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, -1, NULL ); R_MakeTextureDynamic( instance->texture, cl_gecko_updatecallback, instance ); CL_LinkDynTexture( instance->name, instance->texture ); } @@ -514,7 +508,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 +545,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" @@ -570,9 +564,7 @@ static qboolean CL_Gecko_Embedding_Init (void) if( cl_geckoembedding != NULL ) return true; - if( developer.integer > 0 ) { - Con_Printf( "CL_Gecko_Embedding_Init: setting up gecko embedding\n" ); - } + Con_DPrintf( "CL_Gecko_Embedding_Init: setting up gecko embedding\n" ); options = osgk_embedding_options_create(); #ifdef XULRUNNER_DIR_SUFFIX @@ -589,9 +581,7 @@ static qboolean CL_Gecko_Embedding_Init (void) return false; } - if( developer.integer > 0 ) { - Con_Printf( "CL_Gecko_Embedding_Init: Embedding set up correctly\n" ); - } + Con_DPrintf( "CL_Gecko_Embedding_Init: Embedding set up correctly\n" ); dpGlobalTemplate = osgk_sot_create( cl_geckoembedding, dpGlobal_create, NULL, NULL ); @@ -789,7 +779,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 +838,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", @@ -881,7 +869,7 @@ void CL_Gecko_Init( void ) Cmd_AddCommand( "gecko_injecttext", cl_gecko_injecttext_f, "Injects text into a browser" ); Cmd_AddCommand( "gecko_movecursor", gl_gecko_movecursor_f, "Move the cursor to a certain position" ); - R_RegisterModule( "CL_Gecko", cl_gecko_start, cl_gecko_shutdown, cl_gecko_newmap ); + R_RegisterModule( "CL_Gecko", cl_gecko_start, cl_gecko_shutdown, cl_gecko_newmap, NULL, NULL ); } void CL_Gecko_NavigateToURI( clgecko_t *instance, const char *URI ) { @@ -902,8 +890,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 ); }