* fix crash with nonpthreads xmllib + multithreading + output to system console
* number of code fixes
Radiant:
misc...
* fix: clone group ent / map import / saving map as : group ents name labels at 0,0,0;
* number of code fixes
# user customizable stuf
# you may override this in Makefile.conf or the environment
BUILD ?= debug
-# or: release, or: extradebug, or: profile, or: debug
+# or: release, or: debug, or: extradebug, or: profile, or: native
OS ?= $(shell uname)
# or: Linux, Win32, Darwin
LDFLAGS ?=
}
}
- delete repeatlist;
+ delete [] repeatlist;
return pointlist;
}
{
//GdkPixbuf* rgba = gdk_pixbuf_add_alpha( rgb, TRUE, 255, 0, 255 ); //pink to alpha
GdkPixbuf* rgba = gdk_pixbuf_add_alpha( rgb, FALSE, 255, 0, 255 ); //alpha
- gdk_pixbuf_unref( rgb );
+ g_object_unref( rgb );
return rgba;
}
}
else
{
GtkImage* image = GTK_IMAGE( gtk_image_new_from_pixbuf( rgba ) );
- gdk_pixbuf_unref( rgba );
+ g_object_unref( rgba );
return image;
}
}
#if defined( WIN32 )
#define S_ISDIR( mode ) ( mode & _S_IFDIR )
#include <io.h> // _access()
+
+#ifndef F_OK
#define F_OK 0x00
+#endif
+
+#ifndef W_OK
#define W_OK 0x02
+#endif
+
+#ifndef R_OK
#define R_OK 0x04
+#endif
+
#define access( path, mode ) _access( path, mode )
#else
#include <unistd.h> // access()
* string otherwise. given 'path' is not altered. -sea
*/
const char *_pico_nopath( const char *path ){
- const char *src;
- src = path + ( strlen( path ) - 1 );
-
if ( path == NULL ) {
return "";
}
+ const char *src;
+ src = path + ( strlen( path ) - 1 );
+
if ( !strchr( path,'/' ) && !strchr( path,'\\' ) ) {
return ( path );
}
m_data.push_back( index );
}
void swap( IndexBuffer& other ){
- std::swap( m_data, m_data );
+ std::swap( m_data, other.m_data );
}
};
TraversableObserverPairRelay m_traverseObservers;
Doom3GroupOrigin m_funcStaticOrigin;
RenderablePivot m_renderOrigin;
-RenderableNamedEntity m_renderName;
mutable Vector3 m_name_origin;
+RenderableNamedEntity m_renderName;
ModelSkinKey m_skin;
public:
m_named( m_entity ),
m_nameKeys( m_entity ),
m_funcStaticOrigin( m_traverse, m_origin ),
- m_renderName( m_named, m_name_origin ),
m_name_origin( g_vector3_identity ),
+ m_renderName( m_named, m_name_origin ),
m_skin( SkinChangedCaller( *this ) ),
m_curveNURBS( boundsChanged ),
m_curveCatmullRom( boundsChanged ),
m_named( m_entity ),
m_nameKeys( m_entity ),
m_funcStaticOrigin( m_traverse, m_origin ),
- m_renderName( m_named, g_vector3_identity ),
+ m_name_origin( g_vector3_identity ),
+ m_renderName( m_named, m_name_origin ),
m_skin( SkinChangedCaller( *this ) ),
m_curveNURBS( boundsChanged ),
m_curveCatmullRom( boundsChanged ),
OriginKey m_originKey;
Vector3 m_origin;
-RenderableNamedEntity m_renderName;
mutable Vector3 m_name_origin;
+RenderableNamedEntity m_renderName;
Callback m_transformChanged;
Callback m_evaluateTransform;
m_nameKeys( m_entity ),
m_originKey( OriginChangedCaller( *this ) ),
m_origin( ORIGINKEY_IDENTITY ),
- m_renderName( m_named, m_name_origin ),
m_name_origin( g_vector3_identity ),
+ m_renderName( m_named, m_name_origin ),
m_transformChanged( transformChanged ),
m_evaluateTransform( evaluateTransform ){
construct();
m_nameKeys( m_entity ),
m_originKey( OriginChangedCaller( *this ) ),
m_origin( ORIGINKEY_IDENTITY ),
- m_renderName( m_named, g_vector3_identity ),
+ m_name_origin( g_vector3_identity ),
+ m_renderName( m_named, m_name_origin ),
m_transformChanged( transformChanged ),
m_evaluateTransform( evaluateTransform ){
construct();
aabb_draw_wire( points );
}
};
-
+/*
inline void default_extents( Vector3& extents ){
extents = Vector3( 12, 12, 12 );
}
-
+*/
class ShaderRef
{
CopiedString m_name;
LightRadii m_radii;
Doom3LightRadius m_doom3Radius;
+AABB m_aabb_light;
+
RenderLightRadiiWire m_radii_wire;
RenderLightRadiiFill m_radii_fill;
RenderLightRadiiBox m_radii_box;
LightShader m_shader;
-AABB m_aabb_light;
-
Callback m_transformChanged;
Callback m_boundsChanged;
Callback m_evaluateTransform;
void construct(){
default_rotation( m_rotation );
- m_aabb_light.origin = Vector3( 0, 0, 0 );
- default_extents( m_aabb_light.extents );
+ //m_aabb_light.origin = Vector3( 0, 0, 0 );
+ //default_extents( m_aabb_light.extents );
m_keyObservers.insert( "classname", ClassnameFilter::ClassnameChangedCaller( m_filter ) );
m_keyObservers.insert( Static<KeyIsName>::instance().m_nameKey, NamedEntity::IdentifierChangedCaller( m_named ) );
m_nameKeys( m_entity ),
m_funcStaticOrigin( m_traverse, m_originKey.m_origin ),
m_doom3Radius( EntityClass_valueForKey( m_entity.getEntityClass(), "light_radius" ) ),
+ m_aabb_light( Vector3( 0, 0, 0 ), Vector3( 12, 12, 12 ) ),
m_radii_wire( m_radii, m_aabb_light.origin ),
m_radii_fill( m_radii, m_aabb_light.origin ),
m_radii_box( m_aabb_light.origin ),
m_nameKeys( m_entity ),
m_funcStaticOrigin( m_traverse, m_originKey.m_origin ),
m_doom3Radius( EntityClass_valueForKey( m_entity.getEntityClass(), "light_radius" ) ),
+ m_aabb_light( Vector3( 0, 0, 0 ), Vector3( 12, 12, 12 ) ),
m_radii_wire( m_radii, m_aabb_light.origin ),
m_radii_fill( m_radii, m_aabb_light.origin ),
m_radii_box( m_aabb_light.origin ),
return scr;
}
+//#pragma GCC push_options
+//#pragma GCC optimize ("O0")
+
class GtkTextBufferOutputStream : public TextOutputStream
{
GtkTextBuffer* textBuffer;
public:
GtkTextBufferOutputStream( GtkTextBuffer* textBuffer, GtkTextIter* iter, GtkTextTag* tag ) : textBuffer( textBuffer ), iter( iter ), tag( tag ){
}
-std::size_t write( const char* buffer, std::size_t length ){
+std::size_t __attribute__((optimize("O0"))) write( const char* buffer, std::size_t length ){
gtk_text_buffer_insert_with_tags( textBuffer, iter, buffer, gint( length ), tag, 0 );
return length;
}
};
+//#pragma GCC pop_options
+
std::size_t Sys_Print( int level, const char* buf, std::size_t length ){
bool contains_newline = std::find( buf, buf + length, '\n' ) != buf + length;
-/*
+/*
Copyright (C) 1999-2006 Id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
if ( shfolder ) {
FreeLibrary( shfolder );
}
- if ( SHGetFolderPath( NULL, CSIDL_PERSONAL, NULL, 0, mydocsdir ) ) {
+ if ( SUCCEEDED( SHGetFolderPath( NULL, CSIDL_PERSONAL, NULL, 0, mydocsdir ) ) ) {
path.clear();
path << DirectoryCleaned( mydocsdir ) << "My Games/" << ( prefix + 1 ) << "/";
// win32: only add it if it already exists
GdkPixbuf* pixbuf = pixbuf_new_from_file_with_mask( "bitmaps/icon.png" );
if ( pixbuf != 0 ) {
gtk_window_set_icon( window, pixbuf );
- gdk_pixbuf_unref( pixbuf );
+ g_object_unref( pixbuf );
}
}
#endif
-/*
+/*
Copyright (C) 1999-2006 Id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
// read the user-friendly game name
xmlNodePtr pNode = pDoc->children;
- while ( strcmp( (const char*)pNode->name, "game" ) && pNode != 0 )
+ while ( pNode != 0 && strcmp( (const char*)pNode->name, "game" ) )
{
pNode = pNode->next;
}
TextureGroups groups = TextureGroups_constructTreeView();
GtkTreeStore* store = gtk_tree_store_new( 1, G_TYPE_STRING );
TextureGroups_constructTreeModel( groups, store );
- std::set<CopiedString>::iterator iter;
+ //std::set<CopiedString>::iterator iter;
GtkTreeModel* model = GTK_TREE_MODEL( store );
}
void TextureBrowser_constructTreeStoreTags(){
- TextureGroups groups;
+ //TextureGroups groups;
GtkTreeStore* store = gtk_tree_store_new( 1, G_TYPE_STRING );
GtkTreeModel* model = GTK_TREE_MODEL( g_TextureBrowser.m_all_tags_list );
void BuildMonitor_Destroy(){
delete g_pWatchBSP;
+ g_pWatchBSP = NULL;
}
CWatchBSP *GetWatchBSP(){
sprintf( buf, "%f %f %f", v[0], v[1], v[2] );
ret = xmlNewNode( NULL, "point" );
- xmlNodeSetContent( ret, buf );
+ xmlNodeAddContent( ret, buf );
return ret;
}
// 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 );
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 );
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 );
}
winding = xmlNewNode( NULL, "winding" );
- xmlNodeSetContent( winding, buf );
+ xmlNodeAddContent( winding, buf );
xmlAddChild( node, winding );
xml_SendNode( node );
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 ) {
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 );
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;
-/*
+/*
Copyright (C) 1999-2006 Id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
GetToken( false );
strcpy( mip_prefix, token );
// create the directory if needed
- sprintf( filename, "%stextures", gamedir, mip_prefix );
+ sprintf( filename, "%stextures", gamedir );
Q_mkdir( filename );
sprintf( filename, "%stextures/%s", gamedir, mip_prefix );
Q_mkdir( filename );
// build the dictionary
for ( frame = startframe ; ; frame++ )
{
- printf( "counting ", frame );
+ printf( "counting %i", frame );
in = LoadFrame( base, frame, digits, &palette );
if ( !in.data ) {
break;
// compress it with the dictionary
for ( frame = startframe ; ; frame++ )
{
- printf( "packing ", frame );
+ printf( "packing %i", frame );
in = LoadFrame( base, frame, digits, &palette );
if ( !in.data ) {
break;
// all output ends up through here
void FPrintf (int flag, char *buf)
{
- printf(buf);
+ printf( "%s", buf );
}
sprintf( buf, "%f %f %f", v[0], v[1], v[2] );
ret = xmlNewNode( NULL, "point" );
- xmlNodeSetContent( ret, buf );
+ xmlNodeAddContent( ret, buf );
return ret;
}
// 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 );
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 );
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 );
}
winding = xmlNewNode( NULL, "winding" );
- xmlNodeSetContent( winding, buf );
+ xmlNodeAddContent( winding, buf );
xmlAddChild( node, winding );
xml_SendNode( node );
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 ) {
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 );
sprintf( buf, "%f %f %f", v[0], v[1], v[2] );
ret = xmlNewNode( NULL, (xmlChar*)"point" );
- xmlNodeSetContent( ret, (xmlChar*)buf );
+ xmlNodeAddContent( ret, (xmlChar*)buf );
return ret;
}
// now build a proper "select" XML node
sprintf( buf, "Entity %i, Brush %i: %s", entitynum, brushnum, msg );
node = xmlNewNode( NULL, (xmlChar*)"select" );
- xmlNodeSetContent( node, (xmlChar*)buf );
+ xmlNodeAddContent( node, (xmlChar*)buf );
level[0] = (int)'0' + ( bError ? SYS_ERR : SYS_WRN ) ;
level[1] = 0;
xmlSetProp( node, (xmlChar*)"level", (xmlChar *)&level );
// a 'select' information
sprintf( buf, "%i %i", entitynum, brushnum );
select = xmlNewNode( NULL, (xmlChar*)"brush" );
- xmlNodeSetContent( select, (xmlChar*)buf );
+ xmlNodeAddContent( select, (xmlChar*)buf );
xmlAddChild( node, select );
xml_SendNode( node );
char level[2];
node = xmlNewNode( NULL, (xmlChar*)"pointmsg" );
- xmlNodeSetContent( node, (xmlChar*)msg );
+ xmlNodeAddContent( node, (xmlChar*)msg );
level[0] = (int)'0' + SYS_ERR;
level[1] = 0;
xmlSetProp( node, (xmlChar*)"level", (xmlChar *)&level );
// a 'point' node
sprintf( buf, "%g %g %g", pt[0], pt[1], pt[2] );
point = xmlNewNode( NULL, (xmlChar*)"point" );
- xmlNodeSetContent( point, (xmlChar*)buf );
+ xmlNodeAddContent( point, (xmlChar*)buf );
xmlAddChild( node, point );
xml_SendNode( node );
int i;
node = xmlNewNode( NULL, (xmlChar*)"windingmsg" );
- xmlNodeSetContent( node, (xmlChar*)msg );
+ xmlNodeAddContent( node, (xmlChar*)msg );
level[0] = (int)'0' + SYS_ERR;
level[1] = 0;
xmlSetProp( node, (xmlChar*)"level", (xmlChar *)&level );
}
winding = xmlNewNode( NULL, (xmlChar*)"winding" );
- xmlNodeSetContent( winding, (xmlChar*)buf );
+ xmlNodeAddContent( winding, (xmlChar*)buf );
xmlAddChild( node, winding );
xml_SendNode( node );
node = xmlNewNode( NULL, (xmlChar*)"message" );
{
gchar* utf8 = g_locale_to_utf8( buf, -1, NULL, NULL, NULL );
- xmlNodeSetContent( node, (xmlChar*)utf8 );
+ xmlNodeAddContent( node, (xmlChar*)utf8 );
g_free( utf8 );
}
level[0] = (int)'0' + flag;
#else
#include <wtypes.h>
#include <io.h>
+
+#ifndef R_OK
#define R_OK 04
+#endif
+
#define S_ISDIR( mode ) ( mode & _S_IFDIR )
#define PATH_MAX 260
#endif
Sys_FPrintf( SYS_NOXML, "**********************\n" );
polyline = LeakFile( tree );
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;
*/
void CreateMapFogs( void ){
- int i;
+ int i, j;
entity_t *entity;
brush_t *brush;
fog_t *fog;
VectorScale( fog->si->fogDir, -1.0f, invFogDir );
/* find the brush side */
- for ( i = 0; i < brush->numsides; i++ )
+ for ( j = 0; j < brush->numsides; j++ )
{
- if ( VectorCompare( invFogDir, mapplanes[ brush->sides[ i ].planenum ].normal ) ) {
- fog->visibleSide = i;
+ if ( VectorCompare( invFogDir, mapplanes[ brush->sides[ j ].planenum ].normal ) ) {
+ fog->visibleSide = j;
//% Sys_Printf( "Brush num: %d Side num: %d\n", fog->brushNum, fog->visibleSide );
break;
}
VectorMA( light->origin, 1.0f, light->normal, light->origin );
light->dist = DotProduct( light->origin, normal );
- /* optionally create a point splashsplash light for first pass */
+ /* optionally create a point backsplash light for first pass */
if ( original && si->backsplashFraction > 0 ) {
/* allocate a new point light */
splash = safe_malloc( sizeof( *splash ) );
int b, samples, mapped, lighted;
int cluster[ 4 ];
vec4_t luxel[ 4 ];
- vec3_t deluxel[ 3 ];
+ vec3_t deluxel[ 4 ];
vec3_t origin[ 4 ], normal[ 4 ];
float biasDirs[ 4 ][ 2 ] = { { -1.0f, -1.0f }, { 1.0f, -1.0f }, { -1.0f, 1.0f }, { 1.0f, 1.0f } };
vec3_t color, direction = { 0, 0, 0 }, total;
void SetupBrushesFlags( int mask_any, int test_any, int mask_all, int test_all ){
int i, j, b;
unsigned int compileFlags, allCompileFlags;
- qboolean inside;
bspBrush_t *brush;
bspBrushSide_t *side;
bspShader_t *shader;
brush = &bspBrushes[ b ];
/* check all sides */
- inside = qtrue;
compileFlags = 0;
allCompileFlags = ~( 0u );
- for ( j = 0; j < brush->numSides && inside; j++ )
+ for ( j = 0; j < brush->numSides; j++ )
{
/* do bsp shader calculations */
side = &bspBrushSides[ brush->firstSide + j ];
/* dummy check */
- if ( ds->type <= SURFACE_BAD || ds->type >= NUM_SURFACE_TYPES || ds == NULL || ds->shaderInfo == NULL ) {
+ if ( ds == NULL || ds->shaderInfo == NULL || ds->type <= SURFACE_BAD || ds->type >= NUM_SURFACE_TYPES ) {
return;
}
alpha /= ds->numVerts;
centroid.color[ 0 ][ 0 ] = 0xFF;
centroid.color[ 0 ][ 1 ] = 0xFF;
- centroid.color[ 0 ][ 2 ] = 0xFF;
+ //centroid.color[ 0 ][ 2 ] = 0xFF;
centroid.color[ 0 ][ 2 ] = ( alpha > 255.0f ? 0xFF : alpha );
/* head vert is centroid */
ClearBounds( ds->mins, ds->maxs );
/* clear verts/indexes */
- memset( verts, 0, sizeof( verts ) );
- memset( indexes, 0, sizeof( indexes ) );
+// memset( verts, 0, sizeof( verts ) );
+// memset( indexes, 0, sizeof( indexes ) );
+ //is more correct, but upper works ok too
+ memset( verts, 0, sizeof( *verts ) * maxSurfaceVerts );
+ memset( indexes, 0, sizeof( *indexes ) * maxSurfaceIndexes );
+
/* add the first triangle */
if ( AddMetaTriangleToSurface( ds, seed, qfalse ) ) {
if ( d1 < d2 ) {
return -1;
}
- if ( d2 > d1 ) {
+ if ( d1 > d2 ) {
return 1;
}
return 0;