X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=cl_gecko.c;h=e66482d68730e060e31d3ca90098c4f062ca1c0f;hb=3d33cdedf26c48222748feebed9dff29b687dcb0;hp=b4f6542a53b3071cfaaa178c520edd3c330d5ff3;hpb=d39861bfe72a5a9ec8cfbcc83457db58a74b75d9;p=xonotic%2Fdarkplaces.git diff --git a/cl_gecko.c b/cl_gecko.c index b4f6542a..e66482d6 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) @@ -435,7 +435,7 @@ static void cl_gecko_updatecallback( rtexture_t *texture, void* callbackData ) { 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 ); } } @@ -443,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 | TEXF_ALLOWUPDATES, 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 ); } @@ -525,14 +525,14 @@ static OSGK_ScriptResult dpGlobal_query (void* objTag, void* methTag, saveProg = prog; PRVM_SetProg(instance->ownerProg); - if (prog->funcoffsets.Gecko_Query) + if (PRVM_clientfunction(Gecko_Query)) { OSGK_String* paramStr, *resultStr; if (!osgk_variant_get_string (strVal, ¶mStr)) return srFailed; PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString (instance->name); PRVM_G_INT(OFS_PARM1) = PRVM_SetTempString (osgk_string_get (paramStr)); - PRVM_ExecuteProgram(prog->funcoffsets.Gecko_Query,"Gecko_Query() required"); + PRVM_ExecuteProgram(PRVM_clientfunction(Gecko_Query),"Gecko_Query() required"); resultStr = osgk_string_create (PRVM_G_STRING (OFS_RETURN)); *returnVal = osgk_variant_create_string (cl_geckoembedding, resultStr); osgk_release (resultStr); @@ -869,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 ) {