From: Aleksandr Palamar Date: Thu, 24 Mar 2016 18:29:16 +0000 (+0200) Subject: threading: [partial] Working NetRadiant and q3map2 on MSYS2 (both x86, x86_64) X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f96810f28aa3f1048631ab59ef409a08f78e71ca;p=xonotic%2Fnetradiant.git threading: [partial] Working NetRadiant and q3map2 on MSYS2 (both x86, x86_64) this code is meant to fix q3map2 threading on MSYS2 partial commit from original by Aleksandr “void995” Palamar: - c1c3c66ec062438e1a99266751122557517d708d initially named: > Working NetRadiant and q3map2 on MSYS2 (both x86, x86_64), > fixed problems with out of bounds and got rid of unneeded > warning messages. Optimisations for MSYS2 were disabled as > they are causing crashes. Added specific MSYS2 shell scripts > for installing DLLs and GTK themes. see merge request !18 https://gitlab.com/xonotic/netradiant/merge_requests/18 --- diff --git a/tools/quake2/common/inout.c b/tools/quake2/common/inout.c index f81aff94..e0c14841 100644 --- a/tools/quake2/common/inout.c +++ b/tools/quake2/common/inout.c @@ -68,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; } @@ -146,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 ); @@ -173,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 ); @@ -197,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 ); @@ -214,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 ); @@ -283,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 ); diff --git a/tools/quake2/q2map/qbsp.c b/tools/quake2/q2map/qbsp.c index 0f4591b0..3b8995b2 100644 --- a/tools/quake2/q2map/qbsp.c +++ b/tools/quake2/q2map/qbsp.c @@ -242,7 +242,7 @@ void ProcessWorldModel( void ){ Sys_FPrintf( SYS_NOXML, "**********************\n" ); polyline = LeakFile( tree ); leaknode = xmlNewNode( NULL, "message" ); - xmlNodeSetContent( leaknode, "MAP LEAKED\n" ); + xmlNodeAddContent( leaknode, "MAP LEAKED\n" ); xmlAddChild( leaknode, polyline ); level[0] = (int) '0' + SYS_ERR; level[1] = 0; diff --git a/tools/quake2/qdata_heretic2/common/inout.c b/tools/quake2/qdata_heretic2/common/inout.c index f81aff94..e0c14841 100644 --- a/tools/quake2/qdata_heretic2/common/inout.c +++ b/tools/quake2/qdata_heretic2/common/inout.c @@ -68,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; } @@ -146,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 ); @@ -173,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 ); @@ -197,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 ); @@ -214,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 ); @@ -283,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 ); diff --git a/tools/quake3/q3map2/bsp.c b/tools/quake3/q3map2/bsp.c index bbab3f25..3ab6a2df 100644 --- a/tools/quake3/q3map2/bsp.c +++ b/tools/quake3/q3map2/bsp.c @@ -346,7 +346,7 @@ void ProcessWorldModel( const char *portalFilePath, const char *lineFilePath ){ Sys_FPrintf( SYS_NOXML, "**********************\n" ); polyline = LeakFile( tree, lineFilePath ); leaknode = xmlNewNode( NULL, (xmlChar*)"message" ); - xmlNodeSetContent( leaknode, (xmlChar*)"MAP LEAKED\n" ); + xmlNodeAddContent( leaknode, (xmlChar*)"MAP LEAKED\n" ); xmlAddChild( leaknode, polyline ); level[0] = (int) '0' + SYS_ERR; level[1] = 0;