X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=cl_gecko.c;h=90d25a04b241a997f496166cae0d2e40bf4c52c6;hb=9ceac1fc17ed0b0e15906b11e1c6819c2264419b;hp=653ee2e2b5f040b943c65d899c4735e161ef5e19;hpb=8d376b57de94bafd3bae224088b469649c853028;p=xonotic%2Fdarkplaces.git diff --git a/cl_gecko.c b/cl_gecko.c index 653ee2e2..90d25a04 100644 --- a/cl_gecko.c +++ b/cl_gecko.c @@ -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 @@ -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; @@ -716,8 +716,7 @@ static void cl_gecko_create_f( void ) { return; } - // TODO: use snprintf instead - sprintf(name, CLGECKOPREFIX "%s", Cmd_Argv(1)); + dpsnprintf(name, sizeof(name), CLGECKOPREFIX "%s", Cmd_Argv(1)); CL_Gecko_CreateBrowser( name, -1 ); } @@ -730,8 +729,7 @@ static void cl_gecko_destroy_f( void ) { return; } - // TODO: use snprintf instead - sprintf(name, CLGECKOPREFIX "%s", Cmd_Argv(1)); + dpsnprintf(name, sizeof(name), CLGECKOPREFIX "%s", Cmd_Argv(1)); CL_Gecko_DestroyBrowser( CL_Gecko_FindBrowser( name ) ); } @@ -745,8 +743,7 @@ static void cl_gecko_navigate_f( void ) { return; } - // TODO: use snprintf instead - sprintf(name, CLGECKOPREFIX "%s", Cmd_Argv(1)); + dpsnprintf(name, sizeof(name), CLGECKOPREFIX "%s", Cmd_Argv(1)); URI = Cmd_Argv( 2 ); CL_Gecko_NavigateToURI( CL_Gecko_FindBrowser( name ), URI ); } @@ -763,8 +760,7 @@ static void cl_gecko_injecttext_f( void ) { return; } - // TODO: use snprintf instead - sprintf(name, CLGECKOPREFIX "%s", Cmd_Argv(1)); + dpsnprintf(name, sizeof(name), CLGECKOPREFIX "%s", Cmd_Argv(1)); instance = CL_Gecko_FindBrowser( name ); if( !instance ) { Con_Printf( "cl_gecko_injecttext_f: gecko instance '%s' couldn't be found!\n", name ); @@ -793,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 ); } } @@ -807,8 +803,7 @@ static void gl_gecko_movecursor_f( void ) { return; } - // TODO: use snprintf instead - sprintf(name, CLGECKOPREFIX "%s", Cmd_Argv(1)); + dpsnprintf(name, sizeof(name), CLGECKOPREFIX "%s", Cmd_Argv(1)); x = atof( Cmd_Argv( 2 ) ); y = atof( Cmd_Argv( 3 ) ); @@ -907,8 +902,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 ); }