X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=tools%2Fquake2%2Fcommon%2Finout.c;h=b6d272ffdf694588b7c572b0f425cae2d5e87890;hb=1f172c2a58c26ef8b26a1c2628fe306d9ba891b1;hp=30ae39df7ee9026ae3cae5d94afff7083691c9de;hpb=3c73487420fde8d4a3b5360d8b99e48132517900;p=xonotic%2Fnetradiant.git diff --git a/tools/quake2/common/inout.c b/tools/quake2/common/inout.c index 30ae39df..b6d272ff 100644 --- a/tools/quake2/common/inout.c +++ b/tools/quake2/common/inout.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1999-2006 Id Software, Inc. and contributors. + Copyright (C) 1999-2007 id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. @@ -26,6 +26,7 @@ // deal with in/out tasks, for either stdin/stdout or network/XML stream // +#include "globaldefs.h" #include "cmdlib.h" #include "mathlib.h" #include "polylib.h" @@ -33,7 +34,7 @@ #include #include -#ifdef WIN32 +#if GDEF_OS_WINDOWS #include #include #endif @@ -42,7 +43,7 @@ #include "l_net/l_net.h" #include "libxml/tree.h" -#ifdef WIN32 +#if GDEF_OS_WINDOWS HWND hwndOut = NULL; qboolean lookedForServer = false; UINT wm_BroadcastCommand = -1; @@ -67,7 +68,7 @@ xmlNodePtr xml_NodeForVec( vec3_t v ){ sprintf( buf, "%f %f %f", v[0], v[1], v[2] ); ret = xmlNewNode( NULL, "point" ); - xmlNodeSetContent( ret, buf ); + xmlNodeAddContent( ret, buf ); return ret; } @@ -145,14 +146,14 @@ void xml_Select( char *msg, int entitynum, int brushnum, qboolean bError ){ // now build a proper "select" XML node sprintf( buf, "Entity %i, Brush %i: %s", entitynum, brushnum, msg ); node = xmlNewNode( NULL, "select" ); - xmlNodeSetContent( node, buf ); + xmlNodeAddContent( node, buf ); level[0] = (int)'0' + ( bError ? SYS_ERR : SYS_WRN ) ; level[1] = 0; xmlSetProp( node, "level", (char *)&level ); // a 'select' information sprintf( buf, "%i %i", entitynum, brushnum ); select = xmlNewNode( NULL, "brush" ); - xmlNodeSetContent( select, buf ); + xmlNodeAddContent( select, buf ); xmlAddChild( node, select ); xml_SendNode( node ); @@ -172,14 +173,14 @@ void xml_Point( char *msg, vec3_t pt ){ char level[2]; node = xmlNewNode( NULL, "pointmsg" ); - xmlNodeSetContent( node, msg ); + xmlNodeAddContent( node, msg ); level[0] = (int)'0' + SYS_ERR; level[1] = 0; xmlSetProp( node, "level", (char *)&level ); // a 'point' node sprintf( buf, "%g %g %g", pt[0], pt[1], pt[2] ); point = xmlNewNode( NULL, "point" ); - xmlNodeSetContent( point, buf ); + xmlNodeAddContent( point, buf ); xmlAddChild( node, point ); xml_SendNode( node ); @@ -196,7 +197,7 @@ void xml_Winding( char *msg, vec3_t p[], int numpoints, qboolean die ){ int i; node = xmlNewNode( NULL, "windingmsg" ); - xmlNodeSetContent( node, msg ); + xmlNodeAddContent( node, msg ); level[0] = (int)'0' + SYS_ERR; level[1] = 0; xmlSetProp( node, "level", (char *)&level ); @@ -213,7 +214,7 @@ void xml_Winding( char *msg, vec3_t p[], int numpoints, qboolean die ){ } winding = xmlNewNode( NULL, "winding" ); - xmlNodeSetContent( winding, buf ); + xmlNodeAddContent( winding, buf ); xmlAddChild( node, winding ); xml_SendNode( node ); @@ -260,7 +261,7 @@ void FPrintf( int flag, char *buf ){ static qboolean bGotXML = false; char level[2]; - printf( buf ); + printf( "%s", buf ); // the following part is XML stuff only.. but maybe we don't want that message to go down the XML pipe? if ( flag == SYS_NOXML ) { @@ -282,7 +283,7 @@ void FPrintf( int flag, char *buf ){ bGotXML = true; } node = xmlNewNode( NULL, "message" ); - xmlNodeSetContent( node, buf ); + xmlNodeAddContent( node, buf ); level[0] = (int)'0' + flag; level[1] = 0; xmlSetProp( node, "level", (char *)&level );