Purge on warnings under Linux.
This commit is contained in:
@@ -137,7 +137,15 @@ SOURCE=..\..\..\src\Demos\hangglide\Hat.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\src\Demos\hangglide\terrain_data.h
|
SOURCE=..\..\..\src\Demos\hangglide\terrain_coords.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\src\Demos\hangglide\terrain_normals.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\src\Demos\hangglide\terrain_texcoords.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Resource Files"
|
# Begin Group "Resource Files"
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ CXXFILES =\
|
|||||||
HEADERFILES = \
|
HEADERFILES = \
|
||||||
GliderManipulator.h\
|
GliderManipulator.h\
|
||||||
hat.h\
|
hat.h\
|
||||||
terrain_data.h\
|
terrain_coords.h\
|
||||||
|
terrain_normals.h\
|
||||||
|
terrain_texcoords.h\
|
||||||
|
|
||||||
LIBS += $(OSG_LIBS) $(GLUT_LIB) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
|
LIBS += $(OSG_LIBS) $(GLUT_LIB) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include <osg/Math>
|
#include <osg/Math>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "terrain_data.h"
|
#include "terrain_coords.h"
|
||||||
#include "hat.h"
|
#include "hat.h"
|
||||||
|
|
||||||
static int inited = 0;
|
static int inited = 0;
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
|
|
||||||
#include <osgDB/ReadFile>
|
#include <osgDB/ReadFile>
|
||||||
|
|
||||||
#include "terrain_data.h"
|
#include "terrain_coords.h"
|
||||||
|
#include "terrain_texcoords.h"
|
||||||
|
|
||||||
using namespace osg;
|
using namespace osg;
|
||||||
|
|
||||||
|
|||||||
1523
src/Demos/hangglide/terrain_coords.h
Normal file
1523
src/Demos/hangglide/terrain_coords.h
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2931
src/Demos/hangglide/terrain_texcoords.h
Normal file
2931
src/Demos/hangglide/terrain_texcoords.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
#include <osg/Version>
|
#include <osg/Version>
|
||||||
|
|
||||||
|
|
||||||
int main( int argc, char **argv )
|
int main( int, char **)
|
||||||
{
|
{
|
||||||
printf( "%s\n", osgGetVersion() );
|
printf( "%s\n", osgGetVersion() );
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -40,14 +40,9 @@ Image::Image(const Image& image,const CopyOp& copyop):
|
|||||||
{
|
{
|
||||||
if (image._data)
|
if (image._data)
|
||||||
{
|
{
|
||||||
int num_components =
|
unsigned int size = computeRowWidthInBytes(_s,_pixelFormat,_dataType,_packing)*_t*_r;
|
||||||
_pixelFormat == GL_LUMINANCE ? 1 :
|
|
||||||
_pixelFormat == GL_LUMINANCE_ALPHA ? 2 :
|
|
||||||
_pixelFormat == GL_RGB ? 3 :
|
|
||||||
_pixelFormat == GL_RGBA ? 4 : 4;
|
|
||||||
|
|
||||||
int size = _s*_t*_r*num_components;
|
_data = (unsigned char*) osgMalloc(size);
|
||||||
_data = (unsigned char*) malloc(size);
|
|
||||||
memcpy(_data,image._data,size);
|
memcpy(_data,image._data,size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,7 +112,7 @@ const unsigned int Image::computeNumComponents(GLenum type)
|
|||||||
case(GL_RGBA): return 4;
|
case(GL_RGBA): return 4;
|
||||||
case(GL_BGRA): return 4;
|
case(GL_BGRA): return 4;
|
||||||
case(GL_LUMINANCE): return 1;
|
case(GL_LUMINANCE): return 1;
|
||||||
case(GL_LUMINANCE_ALPHA): return 1;
|
case(GL_LUMINANCE_ALPHA): return 2;
|
||||||
default: return 0;
|
default: return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -181,7 +176,7 @@ void Image::createImage(int s,int t,int r,
|
|||||||
if (_data) ::free(_data);
|
if (_data) ::free(_data);
|
||||||
|
|
||||||
if (newTotalSize)
|
if (newTotalSize)
|
||||||
_data = (unsigned char *)malloc (newTotalSize);
|
_data = (unsigned char *)osgMalloc (newTotalSize);
|
||||||
else
|
else
|
||||||
_data = 0L;
|
_data = 0L;
|
||||||
}
|
}
|
||||||
@@ -265,7 +260,7 @@ void Image::scaleImage(const int s,const int t,const int r)
|
|||||||
unsigned int newTotalSize = computeRowWidthInBytes(s,_pixelFormat,_dataType,_packing)*t;
|
unsigned int newTotalSize = computeRowWidthInBytes(s,_pixelFormat,_dataType,_packing)*t;
|
||||||
|
|
||||||
// need to sort out what size to really use...
|
// need to sort out what size to really use...
|
||||||
unsigned char* newData = (unsigned char *)malloc(newTotalSize);
|
unsigned char* newData = (unsigned char *)osgMalloc(newTotalSize);
|
||||||
if (!newData)
|
if (!newData)
|
||||||
{
|
{
|
||||||
// should we throw an exception??? Just return for time being.
|
// should we throw an exception??? Just return for time being.
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ public:
|
|||||||
if(ic>=nv) {
|
if(ic>=nv) {
|
||||||
printf("Invalid vertices %d of %d. I1-3 %d %d %d.\n", ic, nv, i1, i2, i3);
|
printf("Invalid vertices %d of %d. I1-3 %d %d %d.\n", ic, nv, i1, i2, i3);
|
||||||
}
|
}
|
||||||
if(i1>=verts.size() || i2>=verts.size() || i3>=verts.size()) {
|
if(i1>=static_cast<int>(verts.size()) || i2>=static_cast<int>(verts.size()) || i3>=static_cast<int>(verts.size())) {
|
||||||
printf("Invalid indices %d, %d, %d max allowed %d.\n", i1,i2,i3,verts.size());//, errm
|
printf("Invalid indices %d, %d, %d max allowed %d.\n", i1,i2,i3,verts.size());//, errm
|
||||||
}
|
}
|
||||||
s1=(verts[i2]-verts[i1]); // side 1 of face
|
s1=(verts[i2]-verts[i1]); // side 1 of face
|
||||||
@@ -769,7 +769,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void _face::tesselate(const std::vector<Vec3> verts, const dwmaterial *themat,
|
void _face::tesselate(const std::vector<Vec3> verts, const dwmaterial *themat,
|
||||||
GLUtesselator *ts, _dwobj *dwob, const Matrix *tmat) const {
|
GLUtesselator *ts, _dwobj *dwob, const Matrix * /*tmat*/) const {
|
||||||
int nvall=getallverts();
|
int nvall=getallverts();
|
||||||
int nused=0;
|
int nused=0;
|
||||||
avertex *poses=new avertex[2*nvall]; // passed to tesselator to redraw
|
avertex *poses=new avertex[2*nvall]; // passed to tesselator to redraw
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ osgDB::ReaderWriter::WriteResult ReaderWriterDX::writeObject(
|
|||||||
osgDB::ReaderWriter::WriteResult ReaderWriterDX::writeNode(
|
osgDB::ReaderWriter::WriteResult ReaderWriterDX::writeNode(
|
||||||
const osg::Node &node,
|
const osg::Node &node,
|
||||||
const std::string &filename,
|
const std::string &filename,
|
||||||
const Options *options )
|
const Options *)
|
||||||
{
|
{
|
||||||
dx::WriterParms parms;
|
dx::WriterParms parms;
|
||||||
std::string messages;
|
std::string messages;
|
||||||
|
|||||||
@@ -44,14 +44,14 @@ static char lib3ds_chunk_level[128]="";
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lib3ds_chunk_debug_enter(Lib3dsChunk *c)
|
lib3ds_chunk_debug_enter(Lib3dsChunk *)
|
||||||
{
|
{
|
||||||
strcat(lib3ds_chunk_level, " ");
|
strcat(lib3ds_chunk_level, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lib3ds_chunk_debug_leave(Lib3dsChunk *c)
|
lib3ds_chunk_debug_leave(Lib3dsChunk *)
|
||||||
{
|
{
|
||||||
lib3ds_chunk_level[strlen(lib3ds_chunk_level)-2]=0;
|
lib3ds_chunk_level[strlen(lib3ds_chunk_level)-2]=0;
|
||||||
}
|
}
|
||||||
@@ -162,7 +162,7 @@ lib3ds_chunk_read_next(Lib3dsChunk *c, FILE *f)
|
|||||||
* \ingroup chunk
|
* \ingroup chunk
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
lib3ds_chunk_read_reset(Lib3dsChunk *c, FILE *f)
|
lib3ds_chunk_read_reset(Lib3dsChunk *, FILE *f)
|
||||||
{
|
{
|
||||||
fseek(f, -6, SEEK_CUR);
|
fseek(f, -6, SEEK_CUR);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ lib3ds_light_dump(Lib3dsLight *light)
|
|||||||
printf(" spot_aspect: %f\n", light->spot_aspect);
|
printf(" spot_aspect: %f\n", light->spot_aspect);
|
||||||
printf(" use_projector: %s\n", light->use_projector ? "yes" : "no");
|
printf(" use_projector: %s\n", light->use_projector ? "yes" : "no");
|
||||||
printf(" projector: %s\n", light->projector);
|
printf(" projector: %s\n", light->projector);
|
||||||
printf(" spot_overshoot: %d\n", light->spot_overshoot);
|
printf(" spot_overshoot: %i\n", static_cast<int>(light->spot_overshoot));
|
||||||
printf(" ray_shadows: %s\n", light->ray_shadows ? "yes" : "no");
|
printf(" ray_shadows: %s\n", light->ray_shadows ? "yes" : "no");
|
||||||
printf(" ray_bias: %f\n", light->ray_bias);
|
printf(" ray_bias: %f\n", light->ray_bias);
|
||||||
printf(" hot_spot: %f\n", light->hot_spot);
|
printf(" hot_spot: %f\n", light->hot_spot);
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ texture_dump(const char *maptype, Lib3dsTextureMap *texture)
|
|||||||
}
|
}
|
||||||
printf(" %s:\n", maptype);
|
printf(" %s:\n", maptype);
|
||||||
printf(" name: %s\n", texture->name);
|
printf(" name: %s\n", texture->name);
|
||||||
printf(" flags: %X\n", texture->flags);
|
printf(" flags: %ii\n", static_cast<unsigned int>(texture->flags));
|
||||||
printf(" percent: %f\n", texture->percent);
|
printf(" percent: %f\n", texture->percent);
|
||||||
printf(" blur: %f\n", texture->blur);
|
printf(" blur: %f\n", texture->blur);
|
||||||
printf(" scale: (%f, %f)\n", texture->scale[0], texture->scale[1]);
|
printf(" scale: (%f, %f)\n", texture->scale[0], texture->scale[1]);
|
||||||
@@ -321,10 +321,10 @@ lib3ds_material_dump(Lib3dsMaterial *material)
|
|||||||
texture_dump("reflection_map", &material->reflection_map);
|
texture_dump("reflection_map", &material->reflection_map);
|
||||||
texture_dump("reflection_mask", &material->reflection_mask);
|
texture_dump("reflection_mask", &material->reflection_mask);
|
||||||
printf(" autorefl_map:\n");
|
printf(" autorefl_map:\n");
|
||||||
printf(" flags %X\n", material->autorefl_map.flags);
|
printf(" flags %X\n", static_cast<int>(material->autorefl_map.flags));
|
||||||
printf(" level %d\n", material->autorefl_map.level);
|
printf(" level %X\n", static_cast<int>(material->autorefl_map.level));
|
||||||
printf(" size %d\n", material->autorefl_map.size);
|
printf(" size %X\n", static_cast<int>(material->autorefl_map.size));
|
||||||
printf(" frame_step %d\n", material->autorefl_map.frame_step);
|
printf(" frame_step %d\n", static_cast<int>(material->autorefl_map.frame_step));
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ lib3ds_mesh_dump(Lib3dsMesh *mesh)
|
|||||||
mesh->faceL[i].points[0],
|
mesh->faceL[i].points[0],
|
||||||
mesh->faceL[i].points[1],
|
mesh->faceL[i].points[1],
|
||||||
mesh->faceL[i].points[2],
|
mesh->faceL[i].points[2],
|
||||||
mesh->faceL[i].smoothing
|
static_cast<int>(mesh->faceL[i].smoothing)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ lib3ds_node_dump(Lib3dsNode *node, Lib3dsIntd level)
|
|||||||
* \ingroup node
|
* \ingroup node
|
||||||
*/
|
*/
|
||||||
Lib3dsBool
|
Lib3dsBool
|
||||||
lib3ds_node_read(Lib3dsNode *node, Lib3dsFile *file, FILE *f)
|
lib3ds_node_read(Lib3dsNode *node, Lib3dsFile *, FILE *f)
|
||||||
{
|
{
|
||||||
Lib3dsChunk c;
|
Lib3dsChunk c;
|
||||||
Lib3dsWord chunk;
|
Lib3dsWord chunk;
|
||||||
|
|||||||
@@ -1364,7 +1364,7 @@ lib3ds_morph_track_eval(Lib3dsMorphTrack *track, char *p, Lib3dsFloat t)
|
|||||||
* \ingroup tracks
|
* \ingroup tracks
|
||||||
*/
|
*/
|
||||||
Lib3dsBool
|
Lib3dsBool
|
||||||
lib3ds_morph_track_read(Lib3dsMorphTrack *track, FILE *f)
|
lib3ds_morph_track_read(Lib3dsMorphTrack *, FILE *)
|
||||||
{
|
{
|
||||||
/* FIXME: */
|
/* FIXME: */
|
||||||
return(LIB3DS_TRUE);
|
return(LIB3DS_TRUE);
|
||||||
@@ -1375,7 +1375,7 @@ lib3ds_morph_track_read(Lib3dsMorphTrack *track, FILE *f)
|
|||||||
* \ingroup tracks
|
* \ingroup tracks
|
||||||
*/
|
*/
|
||||||
Lib3dsBool
|
Lib3dsBool
|
||||||
lib3ds_morph_track_write(Lib3dsMorphTrack *track, FILE *f)
|
lib3ds_morph_track_write(Lib3dsMorphTrack *, FILE *)
|
||||||
{
|
{
|
||||||
/* FIXME: */
|
/* FIXME: */
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
|
|||||||
png_read_image(png, row_p);
|
png_read_image(png, row_p);
|
||||||
free(row_p);
|
free(row_p);
|
||||||
|
|
||||||
int iBitCount;
|
int iBitCount=0;
|
||||||
|
|
||||||
if (trans == PNG_SOLID || trans == PNG_ALPHA || color == PNG_COLOR_TYPE_RGB_ALPHA || color == PNG_COLOR_TYPE_GRAY_ALPHA)
|
if (trans == PNG_SOLID || trans == PNG_ALPHA || color == PNG_COLOR_TYPE_RGB_ALPHA || color == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||||
{
|
{
|
||||||
@@ -134,7 +134,9 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return ReadResult::FILE_NOT_HANDLED;
|
// error, will force return of ReadResult::FILE_NOT_HANDLED
|
||||||
|
// see below.
|
||||||
|
iBitCount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,6 +148,9 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
|
|||||||
if (fp)
|
if (fp)
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
|
if (iBitCount==0)
|
||||||
|
return ReadResult::FILE_NOT_HANDLED;
|
||||||
|
|
||||||
osg::Image* pOsgImage = new osg::Image();
|
osg::Image* pOsgImage = new osg::Image();
|
||||||
|
|
||||||
pOsgImage->setFileName(fileName.c_str());
|
pOsgImage->setFileName(fileName.c_str());
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ FT_Vector& FTGlyphContainer::render( unsigned int index, unsigned int next, FT_V
|
|||||||
if (left<glyphs.size()) advance = glyphs[left]->Render( pen);
|
if (left<glyphs.size()) advance = glyphs[left]->Render( pen);
|
||||||
}
|
}
|
||||||
|
|
||||||
kernAdvance.x = advance + kernAdvance.x;
|
kernAdvance.x = static_cast<FT_Pos>(advance) + kernAdvance.x;
|
||||||
// kernAdvance.y = advance.y + kernAdvance.y;
|
// kernAdvance.y = advance.y + kernAdvance.y;
|
||||||
return kernAdvance;
|
return kernAdvance;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ void CALLBACK ftglEnd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CALLBACK ftglCombine( GLdouble coords[3], void* vertex_data[4], GLfloat weight[4], void** outData)
|
void CALLBACK ftglCombine( GLdouble coords[3], void* /*vertex_data*/[4], GLfloat /*weight*/[4], void** outData)
|
||||||
{
|
{
|
||||||
double* vertex = osgNew double[3]; // FIXME MEM LEAK
|
double* vertex = osgNew double[3]; // FIXME MEM LEAK
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user