[Gtkradiant] GtkRadiant and x86_64 linux
Michael
leahcim at ntlworld.com
Fri Jul 29 12:53:36 CDT 2005
Patrik Jakobsson wrote:
> Hi, I don't know if this has been discussed before but since the
> mailing list archives are gone...
> Im trying to compile GtkRadiant (SVN Checkout Mon Jul 25 20:14:33) for
> x86_64 linux (slamd64).
> I ran into some trouble:
>
> scons: Building targets ...
> g++ -Wl,-fini,fini_stub -L. -static-libgcc -ldl -shared -o
> build/release/archivepak.so build/release/plugins/archivepak/plugin.os
> build/relea
> se/plugins/archivepak/archive.os
> build/release/plugins/archivepak/pak.os -Lbuild/release/libs -Llibs
> -lcmdlib
> /usr/lib/gcc/x86_64-slackware-linux/3.4.3/../../../../x86_64-slackware-linux/bin/ld:
> ./libstdc++.a(tree.o): relocation R_X86_64_PC32 against
> `std::_Rb_tree_increment(std::_Rb_tree_node_base*)' can not be used
> when making a shared object; recompile with -fPIC
> /usr/lib/gcc/x86_64-slackware-linux/3.4.3/../../../../x86_64-slackware-linux/bin/ld:
> final link failed: Bad value
> collect2: ld returned 1 exit status
>
> I also get a couple of these:
>
> scons: warning: Two different environments were specified for target
> tools/quake3/common/imagelib.o,
> but they appear to have the same action: gcc -W -Wall
> -Wcast-align -Wcast-qual -Wno-unused-parameter -O2 `xml2-config
> --cflags` `pkg-
> config glib-2.0 --cflags` `libpng-config --cflags` -c -o
> tools/quake3/common/imagelib.o
> /usr/local/src/GtkRadiant/tools/quake3/common/imageli
> b.c
> File "SConscript", line 194, in ?
>
> Has anyone gotten this to work?
Yeah, but only for Doom 3 and you'll probably need to be a coder to use it.
I don't have much time right now, but I'll send this to get you started
[I haven't updated from svn for a while, so this might not apply cleanly]
[If I get time later I'll clean it up if you get problems - let me know]
It's a messy patch [because once you start trying 64-bit from latest svn
you'll hit every 32-bit bug as well, so there
might be some rubbish left over from fixing those only to notice them
them get fixed by spog soon after.
There are a few mass changes of int to unsigned and the like I did to
try and remove warnings that aren't really necessary for 64 bit.
The biggest problems, once you fixed scons to build with -fPIC, are
std::size_t used in places where 32 bit is required or assumed [md5
model loading had that, but
I think it was fixed when sscanf was replaced. I think there's at least
one GL_UNSIGNED_INT RenderIndex IIRC, that was std::size_t too]
Running a release version might still hit the g++ bug if you load some
maps - Caused by sse instructions like sqrt hanging if nans are used
[afaict the default behaviour
should be to ignore floating point errors unless you set the flags with
fesetenv, so it appears to be a compiler bug] - but the bottom line is,
it's better to use debug version.
HTH.
--
Michael.
-------------- next part --------------
Index: tools/quake2/qdata_heretic2/images.c
===================================================================
--- tools/quake2/qdata_heretic2/images.c (revision 5224)
+++ tools/quake2/qdata_heretic2/images.c (working copy)
@@ -257,8 +257,8 @@
miptex_t *CreateMip(byte *data, unsigned width, unsigned height, byte *palette, int *FinalSize, qboolean mip)
{
- int scaled_width, scaled_height;
- int i,j,r,g,b;
+ unsigned int scaled_width, scaled_height;
+ int i,j,r,g,b;
byte intensitytable[256];
byte scaled[256*256];
byte out[256*256];
@@ -414,7 +414,7 @@
miptex32_t *CreateMip32(unsigned *data, unsigned width, unsigned height, int *FinalSize, qboolean mip)
{
- int scaled_width, scaled_height;
+ unsigned int scaled_width, scaled_height;
unsigned scaled[MAX_IMAGE_SIZE*MAX_IMAGE_SIZE];
unsigned out[MAX_IMAGE_SIZE*MAX_IMAGE_SIZE];
int miplevel;
Index: tools/quake2/qdata_heretic2/common/bspfile.c
===================================================================
--- tools/quake2/qdata_heretic2/common/bspfile.c (revision 5224)
+++ tools/quake2/qdata_heretic2/common/bspfile.c (working copy)
@@ -381,7 +381,7 @@
*/
void LoadBSPFile (char *filename)
{
- int i;
+ unsigned int i;
//
// load the file header
@@ -437,7 +437,7 @@
*/
void LoadBSPFileTexinfo (char *filename)
{
- int i;
+ unsigned int i;
FILE *f;
int length, ofs;
Index: SConstruct
===================================================================
--- SConstruct (revision 5224)
+++ SConstruct (working copy)
@@ -68,6 +68,8 @@
exp = re.compile('.*i?86.*')
if (g_cpu == 'Power Macintosh' or g_cpu == 'ppc'):
g_cpu = 'ppc'
+elif (g_cpu == 'x86_64'):
+ g_cpu = 'x86_64'
elif exp.match(g_cpu):
g_cpu = 'x86'
else:
@@ -192,26 +194,11 @@
LINKFLAGS = ''
if ( OS == 'Linux' ):
-
- # static
- # 2112833 /opt/gtkradiant/radiant.x86
- # 35282 /opt/gtkradiant/modules/archivezip.so
- # 600099 /opt/gtkradiant/modules/entity.so
-
- # dynamic
- # 2237060 /opt/gtkradiant/radiant.x86
- # 110605 /opt/gtkradiant/modules/archivezip.so
- # 730222 /opt/gtkradiant/modules/entity.so
-
- # EVIL HACK - force static-linking for libstdc++ - create a symbolic link to the static libstdc++ in the root
- os.system("ln -s `g++ -print-file-name=libstdc++.a`")
-
- #if not os.path.exists("./install"):
- # os.mkdir("./install")
- #os.system("cp `g++ -print-file-name=libstdc++.so` ./install")
-
+ if (g_cpu == 'x86_64'):
+ CCFLAGS += '-march=k8 -fPIC '
+ CXXFLAGS += '-march=k8 -fPIC '
+ LINKFLAGS += '-Wl,-fini,fini_stub '
CXXFLAGS += '-fno-exceptions -fno-rtti '
- LINKFLAGS += '-Wl,-fini,fini_stub -L. -static-libgcc '
if ( OS == 'Darwin' ):
CCFLAGS += '-force_cpusubtype_ALL -fPIC '
CXXFLAGS += '-force_cpusubtype_ALL -fPIC -fno-exceptions -fno-rtti'
Index: plugins/model/model.cpp
===================================================================
--- plugins/model/model.cpp (revision 5224)
+++ plugins/model/model.cpp (working copy)
@@ -107,7 +107,7 @@
}
glVertexPointer(3, GL_FLOAT, sizeof(ArbitraryMeshVertex), &m_vertices.data()->vertex);
glDrawElements(GL_TRIANGLES, GLsizei(m_indices.size()), RenderIndexTypeID, m_indices.data());
-#if defined(_DEBUG)
+#if defined(_DEBUGAA)
glBegin(GL_LINES);
for(Array<ArbitraryMeshVertex>::const_iterator i = m_vertices.begin(); i != m_vertices.end(); ++i)
Index: plugins/md3model/md5.cpp
===================================================================
--- plugins/md3model/md5.cpp (revision 5224)
+++ plugins/md3model/md5.cpp (working copy)
@@ -40,11 +40,11 @@
return string_parse_int(token, i);
}
-bool MD5_parseSize(Tokeniser& tokeniser, std::size_t& i)
+bool MD5_parseSize(Tokeniser& tokeniser, int& i)
{
const char* token = tokeniser.getToken();
MD5_RETURN_FALSE_IF_FAIL(token != 0);
- return string_parse_size(token, i);
+ return string_parse_int(token, i);
}
bool MD5_parseVector3(Tokeniser& tokeniser, Vector3& v)
@@ -76,11 +76,11 @@
class MD5Vert
{
public:
- std::size_t index;
+ int index;
float u;
float v;
- std::size_t weight_index;
- std::size_t weight_count;
+ int weight_index;
+ int weight_count;
};
typedef Array<MD5Vert> MD5Verts;
@@ -88,10 +88,10 @@
class MD5Tri
{
public:
- std::size_t index;
- std::size_t a;
- std::size_t b;
- std::size_t c;
+ int index;
+ int a;
+ int b;
+ int c;
};
typedef Array<MD5Tri> MD5Tris;
@@ -99,8 +99,8 @@
class MD5Weight
{
public:
- std::size_t index;
- std::size_t joint;
+ int index;
+ int joint;
float t;
Vector3 v;
};
@@ -151,22 +151,22 @@
tokeniser.nextLine();
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numFrames"));
- std::size_t numFrames;
+ int numFrames;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numFrames));
tokeniser.nextLine();
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numJoints"));
- std::size_t numJoints;
+ int numJoints;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numJoints));
tokeniser.nextLine();
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "frameRate"));
- std::size_t frameRate;
+ int frameRate;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, frameRate));
tokeniser.nextLine();
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numAnimatedComponents"));
- std::size_t numAnimatedComponents;
+ int numAnimatedComponents;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numAnimatedComponents));
tokeniser.nextLine();
@@ -175,15 +175,15 @@
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "{"));
tokeniser.nextLine();
- for(std::size_t i = 0; i < numJoints; ++i)
+ for(int i = 0; i < numJoints; ++i)
{
const char* name;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseString(tokeniser, name));
int parent;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseInteger(tokeniser, parent));
- std::size_t flags;
+ int flags;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, flags));
- std::size_t index;
+ int index;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, index));
tokeniser.nextLine();
}
@@ -196,7 +196,7 @@
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "{"));
tokeniser.nextLine();
- for(std::size_t i = 0; i < numFrames; ++i)
+ for(int i = 0; i < numFrames; ++i)
{
Vector3 mins;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseVector3(tokeniser, mins));
@@ -213,7 +213,7 @@
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "{"));
tokeniser.nextLine();
- for(std::size_t i = 0; i < numJoints; ++i)
+ for(int i = 0; i < numJoints; ++i)
{
Vector3 position;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseVector3(tokeniser, position));
@@ -226,13 +226,13 @@
tokeniser.nextLine();
// parse frames
- for(std::size_t i = 0; i < numFrames; ++i)
+ for(int i = 0; i < numFrames; ++i)
{
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "frame"));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "{"));
tokeniser.nextLine();
- for(std::size_t i = 0; i < numAnimatedComponents; ++i)
+ for(int i = 0; i < numAnimatedComponents; ++i)
{
float component;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, component));
@@ -257,12 +257,12 @@
tokeniser.nextLine();
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numJoints"));
- std::size_t numJoints;
+ int numJoints = 0;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numJoints));
tokeniser.nextLine();
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numMeshes"));
- std::size_t numMeshes;
+ int numMeshes = 0;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numMeshes));
tokeniser.nextLine();
@@ -286,7 +286,7 @@
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "}"));
tokeniser.nextLine();
- for(std::size_t i = 0; i < numMeshes; ++i)
+ for(int i = 0; i < numMeshes; ++i)
{
Surface& surface = model.newSurface();
@@ -301,7 +301,7 @@
tokeniser.nextLine();
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numverts"));
- std::size_t numVerts;
+ int numVerts = 0;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numVerts));
tokeniser.nextLine();
@@ -311,7 +311,7 @@
{
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "vert"));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).index));
- MD5_RETURN_FALSE_IF_FAIL((*j).index == std::size_t(j - verts.begin()));
+ MD5_RETURN_FALSE_IF_FAIL((*j).index == (j - verts.begin()));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "("));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, (*j).u));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, (*j).v));
@@ -322,7 +322,7 @@
}
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numtris"));
- std::size_t numTris;
+ int numTris = 0;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numTris));
tokeniser.nextLine();
@@ -332,7 +332,7 @@
{
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "tri"));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).index));
- MD5_RETURN_FALSE_IF_FAIL((*j).index == std::size_t(j - tris.begin()));
+ MD5_RETURN_FALSE_IF_FAIL((*j).index == (j - tris.begin()));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).a));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).b));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).c));
@@ -340,7 +340,7 @@
}
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "numweights"));
- std::size_t numWeights;
+ int numWeights = 0;
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, numWeights));
tokeniser.nextLine();
@@ -350,7 +350,7 @@
{
MD5_RETURN_FALSE_IF_FAIL(MD5_parseToken(tokeniser, "weight"));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).index));
- MD5_RETURN_FALSE_IF_FAIL((*j).index == std::size_t(j - weights.begin()));
+ MD5_RETURN_FALSE_IF_FAIL((*j).index == (j - weights.begin()));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseSize(tokeniser, (*j).joint));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseFloat(tokeniser, (*j).t));
MD5_RETURN_FALSE_IF_FAIL(MD5_parseVector3(tokeniser, (*j).v));
@@ -365,7 +365,7 @@
MD5Vert& vert = (*j);
Vector3 skinned(0, 0, 0);
- for(std::size_t k = 0; k != vert.weight_count; ++k)
+ for(int k = 0; k != vert.weight_count; ++k)
{
MD5Weight& weight = weights[vert.weight_index + k];
MD5Joint& joint = joints[weight.joint];
Index: plugins/entity/eclassmodel.cpp
===================================================================
--- plugins/entity/eclassmodel.cpp (revision 5224)
+++ plugins/entity/eclassmodel.cpp (working copy)
@@ -43,8 +43,8 @@
NamedEntity m_named;
NameKeys m_nameKeys;
RenderablePivot m_renderOrigin;
+ ModelSkinKey m_skin;
RenderableNamedEntity m_renderName;
- ModelSkinKey m_skin;
Callback m_transformChanged;
@@ -90,8 +90,8 @@
m_filter(m_entity, node),
m_named(m_entity),
m_nameKeys(m_entity),
+ m_skin(SkinChangedCaller(*this)),
m_renderName(m_named, g_vector3_identity),
- m_skin(SkinChangedCaller(*this)),
m_transformChanged(transformChanged)
{
construct();
@@ -104,8 +104,8 @@
m_filter(m_entity, node),
m_named(m_entity),
m_nameKeys(m_entity),
+ m_skin(SkinChangedCaller(*this)),
m_renderName(m_named, g_vector3_identity),
- m_skin(SkinChangedCaller(*this)),
m_transformChanged(transformChanged)
{
construct();
Index: radiant/undo.cpp
===================================================================
--- radiant/undo.cpp (revision 5224)
+++ radiant/undo.cpp (working copy)
@@ -418,6 +418,12 @@
+template<typename Caller>
+void thunk(void* environment, const StringImportCallback& importer)
+{
+ Caller::thunk(environment, importer);
+}
+
void UndoLevels_importString(RadiantUndoSystem& undo, const char* value)
{
int levels;
Index: radiant/filters.cpp
===================================================================
--- radiant/filters.cpp (revision 5224)
+++ radiant/filters.cpp (working copy)
@@ -19,7 +19,7 @@
struct filters_globals_t
{
- std::size_t exclude;
+ unsigned int exclude;
filters_globals_t() :
exclude(0)
Index: radiant/map.cpp
===================================================================
--- radiant/map.cpp (revision 5224)
+++ radiant/map.cpp (working copy)
@@ -857,7 +857,7 @@
}
-typedef std::map<CopiedString, std::size_t> EntityBreakdown;
+typedef std::map<CopiedString, unsigned int> EntityBreakdown;
class EntityBreakdownWalker : public scene::Graph::Walker
{
Index: radiant/patch.h
===================================================================
--- radiant/patch.h (revision 5224)
+++ radiant/patch.h (working copy)
@@ -85,7 +85,7 @@
Vector3 right;
};
-const std::size_t BEZIERCURVETREE_MAX_INDEX = 1 << ((sizeof(std::size_t) * 8) - 1);
+const std::size_t BEZIERCURVETREE_MAX_INDEX = (std::size_t)1 << ((sizeof(std::size_t) * 8) - 1);
struct BezierCurveTree
{
@@ -814,7 +814,7 @@
}
{
- char width[16], height[16];
+ char width[16], height[16]; //MF
sprintf(width, "%u", Unsigned(m_width));
sprintf(height, "%u", Unsigned(m_height));
StaticElement element("matrix");
Index: radiant/texwindow.cpp
===================================================================
--- radiant/texwindow.cpp (revision 5224)
+++ radiant/texwindow.cpp (working copy)
@@ -443,8 +443,8 @@
Vector3 color_textureback;
// the increment step we use against the wheel mouse
- std::size_t m_mouseWheelScrollIncrement;
- std::size_t m_textureScale;
+ int m_mouseWheelScrollIncrement;
+ unsigned int m_textureScale;
bool m_showTextureFilter;
// make the texture increments match the grid changes
bool m_showShaders;
@@ -1328,7 +1328,7 @@
}
-void TextureBrowser_setScale(TextureBrowser& textureBrowser, std::size_t scale)
+void TextureBrowser_setScale(TextureBrowser& textureBrowser, unsigned int scale)
{
textureBrowser.m_textureScale = scale;
@@ -1688,7 +1688,7 @@
#include "preferencesystem.h"
#include "stringio.h"
-typedef ReferenceCaller1<TextureBrowser, std::size_t, TextureBrowser_setScale> TextureBrowserSetScaleCaller;
+typedef ReferenceCaller1<TextureBrowser, unsigned int, TextureBrowser_setScale> TextureBrowserSetScaleCaller;
@@ -1717,7 +1717,7 @@
GlobalPreferenceSystem().registerPreference("ShowShaders", BoolImportStringCaller(GlobalTextureBrowser().m_showShaders), BoolExportStringCaller(GlobalTextureBrowser().m_showShaders));
GlobalPreferenceSystem().registerPreference("ShowShaderlistOnly", BoolImportStringCaller(g_TexturesMenu_shaderlistOnly), BoolExportStringCaller(g_TexturesMenu_shaderlistOnly));
GlobalPreferenceSystem().registerPreference("LoadShaders", IntImportStringCaller(reinterpret_cast<int&>(GlobalTextureBrowser().m_startupShaders)), IntExportStringCaller(reinterpret_cast<int&>(GlobalTextureBrowser().m_startupShaders)));
- GlobalPreferenceSystem().registerPreference("WheelMouseInc", SizeImportStringCaller(GlobalTextureBrowser().m_mouseWheelScrollIncrement), SizeExportStringCaller(GlobalTextureBrowser().m_mouseWheelScrollIncrement));
+ GlobalPreferenceSystem().registerPreference("WheelMouseInc", IntImportStringCaller(GlobalTextureBrowser().m_mouseWheelScrollIncrement), IntExportStringCaller(GlobalTextureBrowser().m_mouseWheelScrollIncrement));
GlobalPreferenceSystem().registerPreference("SI_Colors0", Vector3ImportStringCaller(GlobalTextureBrowser().color_textureback), Vector3ExportStringCaller(GlobalTextureBrowser().color_textureback));
g_TextureBrowser.shader = texdef_name_default();
Index: radiant/patch.cpp
===================================================================
--- radiant/patch.cpp (revision 5224)
+++ radiant/patch.cpp (working copy)
@@ -1,6 +1,5 @@
#include "patch.h"
-
#include <glib/gslist.h>
#include "preferences.h"
#include "brush_primit.h"
@@ -2731,6 +2730,7 @@
}
offStartY = offEndY;
}
+
}
}
Index: radiant/mru.cpp
===================================================================
--- radiant/mru.cpp (revision 5224)
+++ radiant/mru.cpp (working copy)
@@ -16,7 +16,7 @@
#define MRU_MAX 4
static GtkMenuItem *MRU_items[MRU_MAX];
-static std::size_t MRU_used;
+static unsigned int MRU_used;
typedef CopiedString MRU_filename_t;
MRU_filename_t MRU_filenames[MRU_MAX];
Index: radiant/environment.cpp
===================================================================
--- radiant/environment.cpp (revision 5224)
+++ radiant/environment.cpp (working copy)
@@ -59,6 +59,7 @@
#include <unistd.h>
#include <glib/gutils.h>
+#include <iostream>
const char* LINK_NAME =
#if defined (__linux__)
@@ -97,6 +98,7 @@
{
strcat(buf, "/");
}
+ std::cout << buf << std::endl;
return buf;
}
Index: radiant/camwindow.cpp
===================================================================
--- radiant/camwindow.cpp (revision 5224)
+++ radiant/camwindow.cpp (working copy)
@@ -1479,6 +1479,7 @@
void CamWnd::Cam_Draw()
{
glViewport(0, 0, m_Camera.width, m_Camera.height);
+
#if 0
GLint viewprt[4];
glGetIntegerv (GL_VIEWPORT, viewprt);
@@ -1670,7 +1671,7 @@
Camera_setAngles(*this, angles);
}
double dEnd = Sys_DoubleTime();
- globalOutputStream() << FloatFormat(dEnd - dStart, 5, 2), " seconds\n";
+ globalOutputStream() << FloatFormat(dEnd - dStart, 5, 2) << " seconds\n";
}
Index: radiant/preferences.cpp
===================================================================
--- radiant/preferences.cpp (revision 5224)
+++ radiant/preferences.cpp (working copy)
@@ -296,7 +296,7 @@
// use value to set m_sGameFile
std::list<CGameDescription *>::iterator iGame = mGames.begin();
int i;
- for(i=0; i<value; i++)
+ for(i=0; i < value; i++)
{
++iGame;
}
Index: SConscript
===================================================================
--- SConscript (revision 5224)
+++ SConscript (working copy)
@@ -587,6 +587,7 @@
radiant_env.Depends(radiant_prog, l_net_lib)
radiant_env.Depends(radiant_prog, profile_lib)
radiant_env.Depends(radiant_prog, gtkutil_lib)
+radiant_env.Depends(radiant_prog, picomodel_lib)
radiant_env.Install(INSTALL, radiant_prog)
# setup -------------------------------------------------------------------------------------------
Index: libs/stringio.h
===================================================================
--- libs/stringio.h (revision 5224)
+++ libs/stringio.h (working copy)
@@ -294,7 +294,7 @@
}
typedef ConstReferenceCaller1<int, const StringImportCallback&, Int_exportString> IntExportStringCaller;
-inline void Size_importString(std::size_t& self, const char* string)
+inline void Size_importString(unsigned int& self, const char* string)
{
int i;
if(string_parse_int(string, i) && i >= 0)
@@ -306,14 +306,14 @@
self = 0;
}
}
-typedef ReferenceCaller1<std::size_t, const char*, Size_importString> SizeImportStringCaller;
-inline void Size_exportString(const std::size_t& self, const StringImportCallback& importer)
+typedef ReferenceCaller1<unsigned int, const char*, Size_importString> SizeImportStringCaller;
+inline void Size_exportString(const unsigned int& self, const StringImportCallback& importer)
{
char buffer[16];
sprintf(buffer, "%u", Unsigned(self));
importer(buffer);
}
-typedef ConstReferenceCaller1<std::size_t, const StringImportCallback&, Size_exportString> SizeExportStringCaller;
+typedef ConstReferenceCaller1<unsigned int, const StringImportCallback&, Size_exportString> SizeExportStringCaller;
inline void Float_importString(float& self, const char* string)
{
@@ -431,13 +431,13 @@
class SizeFromString
{
- std::size_t m_value;
+ unsigned int m_value;
public:
SizeFromString(const char* string)
{
Size_importString(m_value, string);
}
- operator std::size_t() const
+ operator unsigned int () const
{
return m_value;
}
Index: libs/ddslib/ddslib.c
===================================================================
--- libs/ddslib/ddslib.c (revision 5224)
+++ libs/ddslib/ddslib.c (working copy)
@@ -523,7 +523,7 @@
for( y = 0; y < yBlocks; y++ )
{
/* 8 bytes per block */
- block = (ddsColorBlock_t*) ((unsigned int) dds->data + y * xBlocks * 8);
+ block = (ddsColorBlock_t*) (dds->data + y * xBlocks * 8);
/* walk x */
for( x = 0; x < xBlocks; x++, block++ )
@@ -569,7 +569,7 @@
for( y = 0; y < yBlocks; y++ )
{
/* 8 bytes per block, 1 block for alpha, 1 block for color */
- block = (ddsColorBlock_t*) ((unsigned int) dds->data + y * xBlocks * 16);
+ block = (ddsColorBlock_t*) ( dds->data + y * xBlocks * 16);
/* walk x */
for( x = 0; x < xBlocks; x++, block++ )
@@ -625,7 +625,7 @@
for( y = 0; y < yBlocks; y++ )
{
/* 8 bytes per block, 1 block for alpha, 1 block for color */
- block = (ddsColorBlock_t*) ((unsigned int) dds->data + y * xBlocks * 16);
+ block = (ddsColorBlock_t*) ( dds->data + y * xBlocks * 16);
/* walk x */
for( x = 0; x < xBlocks; x++, block++ )
Index: libs/math/vector.h
===================================================================
--- libs/math/vector.h (revision 5224)
+++ libs/math/vector.h (working copy)
@@ -41,6 +41,7 @@
#include <cstddef>
#include <float.h>
#include <algorithm>
+#include <iostream>
//#include "debugging/debugging.h"
@@ -643,6 +644,8 @@
inline Element float_divided(Element f, Element other)
{
//ASSERT_MESSAGE(other != 0, "float_divided: invalid divisor");
+ if (fabs(other) < 0.000001)
+ return 1.0;
return f / other;
}
Index: libs/picomodel.h
===================================================================
--- libs/picomodel.h (revision 5224)
+++ libs/picomodel.h (working copy)
@@ -175,7 +175,7 @@
/* convenience (makes it easy to add new params to the callbacks) */
#define PM_PARAMS_CANLOAD \
- char *fileName, const void *buffer, int bufSize
+ char *fileName, const void *buffer, unsigned int bufSize
#define PM_PARAMS_LOAD \
char *fileName, int frameNum, const void *buffer, int bufSize
Index: libs/scenelib.h
===================================================================
--- libs/scenelib.h (revision 5224)
+++ libs/scenelib.h (working copy)
@@ -879,7 +879,7 @@
class SimpleCounter : public Counter
{
Callback m_countChanged;
- std::size_t m_count;
+ int m_count;
public:
void setCountChangedCallback(const Callback& countChanged)
{
Index: libs/container/hashtable.h
===================================================================
--- libs/container/hashtable.h (revision 5224)
+++ libs/container/hashtable.h (working copy)
@@ -89,13 +89,13 @@
: m_hash(hash), m_value(key, value)
{
}
- BucketNode* getNext()
+ BucketNode* BucketNode::getNext()
{
- return static_cast<BucketNode*>(next);
+ return static_cast<BucketNode*>(BucketNodeBase::next);
}
- BucketNode* getPrev()
+ BucketNode* BucketNode::getPrev()
{
- return static_cast<BucketNode*>(prev);
+ return static_cast<BucketNode*>(BucketNodeBase::prev);
}
};
Index: libs/render.h
===================================================================
--- libs/render.h (revision 5224)
+++ libs/render.h (working copy)
@@ -15,6 +15,7 @@
#include <vector>
typedef unsigned int RenderIndex;
+//typedef std::size_t RenderIndex;
const GLenum RenderIndexTypeID = GL_UNSIGNED_INT;
/// \brief A resizable buffer of indices.
Index: libs/picomodel/lwo/lwio.c
===================================================================
--- libs/picomodel/lwo/lwio.c (revision 5224)
+++ libs/picomodel/lwo/lwio.c (working copy)
@@ -54,9 +54,9 @@
void revbytes( void *bp, int elsize, int elcount )
{
- register unsigned char *p, *q;
+ unsigned char *p, *q;
- p = ( unsigned char * ) bp;
+ p = bp;
if ( elsize == 2 ) {
q = p + 1;
Index: libs/picomodel/picointernal.h
===================================================================
--- libs/picomodel/picointernal.h (revision 5224)
+++ libs/picomodel/picointernal.h (working copy)
@@ -79,7 +79,7 @@
typedef struct picoParser_s
{
char *buffer;
- int bufSize;
+ unsigned int bufSize;
char *token;
int tokenSize;
int tokenMax;
@@ -92,7 +92,7 @@
typedef struct picoMemStream_s
{
picoByte_t *buffer;
- int bufSize;
+ unsigned int bufSize;
picoByte_t *curPos;
int flag;
}
More information about the Gtkradiant
mailing list