mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 17:19:39 +00:00
increased warning level for gcc; fixed code to remove resulting warnings (except mangle)
This commit is contained in:
parent
518ddab30e
commit
261af208cd
12 changed files with 27 additions and 22 deletions
|
@ -103,6 +103,11 @@ if (APPLE)
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
|
# Compiler settings
|
||||||
|
if (CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
add_definitions (-Wall)
|
||||||
|
endif (CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
|
||||||
# Main executable
|
# Main executable
|
||||||
add_executable(openmw
|
add_executable(openmw
|
||||||
MACOSX_BUNDLE
|
MACOSX_BUNDLE
|
||||||
|
|
|
@ -129,7 +129,7 @@ void BSAFile::readHeader()
|
||||||
|
|
||||||
// Set up the the FileStruct table
|
// Set up the the FileStruct table
|
||||||
files.resize(filenum);
|
files.resize(filenum);
|
||||||
for(int i=0;i<filenum;i++)
|
for(size_t i=0;i<filenum;i++)
|
||||||
{
|
{
|
||||||
FileStruct &fs = files[i];
|
FileStruct &fs = files[i];
|
||||||
fs.fileSize = offsets[i*2];
|
fs.fileSize = offsets[i*2];
|
||||||
|
@ -156,7 +156,7 @@ int BSAFile::getIndex(const char *str)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int res = it->second;
|
int res = it->second;
|
||||||
assert(res >= 0 && res < files.size());
|
assert(res >= 0 && res < static_cast<int> (files.size()));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -394,7 +394,7 @@ public:
|
||||||
void getHExact(void*p, int size)
|
void getHExact(void*p, int size)
|
||||||
{
|
{
|
||||||
getSubHeader();
|
getSubHeader();
|
||||||
if(size != c.leftSub)
|
if(size !=static_cast<int> (c.leftSub))
|
||||||
fail("getHExact() size mismatch");
|
fail("getHExact() size mismatch");
|
||||||
getExact(p,size);
|
getExact(p,size);
|
||||||
}
|
}
|
||||||
|
@ -480,7 +480,7 @@ public:
|
||||||
void skipHSubSize(int size)
|
void skipHSubSize(int size)
|
||||||
{
|
{
|
||||||
skipHSub();
|
skipHSub();
|
||||||
if(c.leftSub != size)
|
if(static_cast<int> (c.leftSub) != size)
|
||||||
fail("skipHSubSize() mismatch");
|
fail("skipHSubSize() mismatch");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -508,7 +508,7 @@ public:
|
||||||
void getSubHeaderIs(int size)
|
void getSubHeaderIs(int size)
|
||||||
{
|
{
|
||||||
getSubHeader();
|
getSubHeader();
|
||||||
if(size != c.leftSub)
|
if(size != static_cast<int> (c.leftSub))
|
||||||
fail("getSubHeaderIs(): Sub header mismatch");
|
fail("getSubHeaderIs(): Sub header mismatch");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace MWRender
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PlayerPos(Ogre::Camera *cam) :
|
PlayerPos(Ogre::Camera *cam) :
|
||||||
camera(cam), x(0), y(0), z(0) {}
|
x(0), y(0), z(0), camera(cam) {}
|
||||||
|
|
||||||
// Set the player position. Uses Morrowind coordinates.
|
// Set the player position. Uses Morrowind coordinates.
|
||||||
void setPos(float _x, float _y, float _z)
|
void setPos(float _x, float _y, float _z)
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace Input
|
||||||
InputListener(Render::OgreRenderer &rend,
|
InputListener(Render::OgreRenderer &rend,
|
||||||
Input::OISManager &input,
|
Input::OISManager &input,
|
||||||
const Input::Dispatcher &_disp)
|
const Input::Dispatcher &_disp)
|
||||||
: doExit(false), disp(_disp)
|
: disp(_disp), doExit(false)
|
||||||
{
|
{
|
||||||
// Set up component pointers
|
// Set up component pointers
|
||||||
mWindow = rend.getWindow();
|
mWindow = rend.getWindow();
|
||||||
|
|
10
nif/data.hpp
10
nif/data.hpp
|
@ -198,7 +198,7 @@ struct NiPosData : Record
|
||||||
// translation in NiKeyframeData.
|
// translation in NiKeyframeData.
|
||||||
for(int i=0; i<count; i++)
|
for(int i=0; i<count; i++)
|
||||||
{
|
{
|
||||||
float time = nif->getFloat();
|
/*float time =*/ nif->getFloat();
|
||||||
nif->getVector(); // This isn't really shared between type 1
|
nif->getVector(); // This isn't really shared between type 1
|
||||||
// and type 2, most likely
|
// and type 2, most likely
|
||||||
if(type == 2)
|
if(type == 2)
|
||||||
|
@ -267,14 +267,14 @@ struct NiPixelData : Record
|
||||||
mips = nif->getInt();
|
mips = nif->getInt();
|
||||||
|
|
||||||
// Bytes per pixel, should be bpp * 8
|
// Bytes per pixel, should be bpp * 8
|
||||||
int bytes = nif->getInt();
|
/*int bytes =*/ nif->getInt();
|
||||||
|
|
||||||
for(int i=0; i<mips; i++)
|
for(int i=0; i<mips; i++)
|
||||||
{
|
{
|
||||||
// Image size and offset in the following data field
|
// Image size and offset in the following data field
|
||||||
int x = nif->getInt();
|
/*int x =*/ nif->getInt();
|
||||||
int y = nif->getInt();
|
/*int y =*/ nif->getInt();
|
||||||
int offset = nif->getInt();
|
/*int offset =*/ nif->getInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip the data
|
// Skip the data
|
||||||
|
|
|
@ -50,7 +50,7 @@ struct NiVertWeightsExtraData : Extra
|
||||||
|
|
||||||
// We should have s*4+2 == i, for some reason. Might simply be the
|
// We should have s*4+2 == i, for some reason. Might simply be the
|
||||||
// size of the rest of the record, unhelpful as that may be.
|
// size of the rest of the record, unhelpful as that may be.
|
||||||
int i = nif->getInt();
|
/*int i =*/ nif->getInt();
|
||||||
int s = nif->getShort(); // number of vertices
|
int s = nif->getShort(); // number of vertices
|
||||||
|
|
||||||
nif->getFloatLen(s); // vertex weights I guess
|
nif->getFloatLen(s); // vertex weights I guess
|
||||||
|
|
|
@ -178,7 +178,7 @@ void NIFFile::parse()
|
||||||
void NiSkinInstance::post(NIFFile *nif)
|
void NiSkinInstance::post(NIFFile *nif)
|
||||||
{
|
{
|
||||||
int bnum = bones.length();
|
int bnum = bones.length();
|
||||||
if(bnum != data->bones.size())
|
if(bnum != static_cast<int> (data->bones.size()))
|
||||||
nif->fail("Mismatch in NiSkinData bone count");
|
nif->fail("Mismatch in NiSkinData bone count");
|
||||||
|
|
||||||
root->makeRootBone(data->trafo);
|
root->makeRootBone(data->trafo);
|
||||||
|
|
|
@ -95,7 +95,7 @@ class NIFFile
|
||||||
|
|
||||||
~NIFFile()
|
~NIFFile()
|
||||||
{
|
{
|
||||||
for(int i=0; i<records.size(); i++)
|
for(std::size_t i=0; i<records.size(); i++)
|
||||||
{
|
{
|
||||||
delete records[i];
|
delete records[i];
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ class NIFFile
|
||||||
/// Get a given record
|
/// Get a given record
|
||||||
Record *getRecord(int index)
|
Record *getRecord(int index)
|
||||||
{
|
{
|
||||||
assert(index >= 0 && index < records.size());
|
assert(index >= 0 && index < static_cast<int> (records.size()));
|
||||||
Record *res = records[index];
|
Record *res = records[index];
|
||||||
assert(res != NULL);
|
assert(res != NULL);
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -122,9 +122,9 @@ struct NiTexturingProperty : Property
|
||||||
if(textures[5].inUse)
|
if(textures[5].inUse)
|
||||||
{
|
{
|
||||||
// Ignore these at the moment
|
// Ignore these at the moment
|
||||||
float lumaScale = nif->getFloat();
|
/*float lumaScale =*/ nif->getFloat();
|
||||||
float lumaOffset = nif->getFloat();
|
/*float lumaOffset =*/ nif->getFloat();
|
||||||
const Vector4 *lumaMatrix = nif->getVector4();
|
/*const Vector4 *lumaMatrix =*/ nif->getVector4();
|
||||||
}
|
}
|
||||||
textures[6].read(nif); // Decal
|
textures[6].read(nif); // Decal
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,13 +118,13 @@ class RecordListT
|
||||||
|
|
||||||
X& operator[](int index)
|
X& operator[](int index)
|
||||||
{
|
{
|
||||||
assert(index >= 0 && index < list.size());
|
assert(index >= 0 && index < static_cast<int> (list.size()));
|
||||||
return list[index].get();
|
return list[index].get();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool has(int index)
|
bool has(int index)
|
||||||
{
|
{
|
||||||
assert(index >= 0 && index < list.size());
|
assert(index >= 0 && index < static_cast<int> (list.size()));
|
||||||
return !list[index].empty();
|
return !list[index].empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ static void createMaterial(const String &name,
|
||||||
if(!texName.empty())
|
if(!texName.empty())
|
||||||
{
|
{
|
||||||
Pass *pass = material->getTechnique(0)->getPass(0);
|
Pass *pass = material->getTechnique(0)->getPass(0);
|
||||||
TextureUnitState *txt = pass->createTextureUnitState(texName);
|
/*TextureUnitState *txt =*/ pass->createTextureUnitState(texName);
|
||||||
|
|
||||||
/* As of yet UNTESTED code from Chris:
|
/* As of yet UNTESTED code from Chris:
|
||||||
pass->setTextureFiltering(Ogre::TFO_ANISOTROPIC);
|
pass->setTextureFiltering(Ogre::TFO_ANISOTROPIC);
|
||||||
|
|
Loading…
Reference in a new issue