mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 10:22:52 +01:00
Fix compiler warnings
This commit is contained in:
parent
34478b6651
commit
04de3c1a8f
@ -45,6 +45,8 @@ public:
|
||||
|
||||
CharacterController(CharacterObject* character);
|
||||
|
||||
virtual ~CharacterController() { }
|
||||
|
||||
Activity* getCurrentActivity() { return _currentActivity; }
|
||||
|
||||
Activity* getNextActivity() { return _nextActivity; }
|
||||
|
@ -41,7 +41,7 @@ void AIGraph::createPathNodes(const glm::vec3& position, const glm::quat& rotati
|
||||
}
|
||||
|
||||
for(size_t pn = 0; pn < path.nodes.size(); ++pn) {
|
||||
if(path.nodes[pn].next > -1 && path.nodes[pn].next < realNodes.size()) {
|
||||
if(path.nodes[pn].next >= 0 && (unsigned) path.nodes[pn].next < realNodes.size()) {
|
||||
auto node = nodes[realNodes[pn]];
|
||||
node->connections.push_back(nodes[realNodes[path.nodes[pn].next]]);
|
||||
nodes[realNodes[path.nodes[pn].next]]->connections.push_back(node);
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
i < entries.size();
|
||||
++i)
|
||||
{
|
||||
if(activeEntry >= 0 && i == activeEntry) {
|
||||
if(activeEntry >= 0 && i == (unsigned) activeEntry) {
|
||||
sf::RectangleShape rs(sf::Vector2f(250.f, entries[i]->getHeight()));
|
||||
rs.setPosition(basis.x, basis.y);
|
||||
rs.setFillColor(sf::Color::Cyan);
|
||||
@ -122,7 +122,7 @@ public:
|
||||
// Activates the menu entry at the current active index.
|
||||
void activate()
|
||||
{
|
||||
if(activeEntry < entries.size()) {
|
||||
if(activeEntry >= 0 && (unsigned) activeEntry < entries.size()) {
|
||||
entries[activeEntry]->activate(0.f, 0.f);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
QVariant AnimationListModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
if(role == Qt::DisplayRole) {
|
||||
if(index.row() < animations.size()) {
|
||||
if(index.row() >= 0 && (unsigned) index.row() < animations.size()) {
|
||||
auto& f = animations.at(index.row());
|
||||
if(index.column() == 0) {
|
||||
return QString(f.first.c_str());
|
||||
|
@ -36,7 +36,7 @@ void AnimationListWidget::setAnimations(const AnimationList& archive)
|
||||
void AnimationListWidget::selectedIndexChanged(const QModelIndex& current)
|
||||
{
|
||||
auto mts = filter->mapToSource(current);
|
||||
if(mts.row() < model->getAnimations().size()) {
|
||||
if(mts.row() >= 0 && (unsigned) mts.row() < model->getAnimations().size()) {
|
||||
auto& f = model->getAnimations().at(mts.row());
|
||||
emit selectedAnimationChanged(f.second);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
QVariant IMGArchiveModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
if(role == Qt::DisplayRole) {
|
||||
if(index.row() < archive.getAssetCount()) {
|
||||
if(index.row() >= 0 && (unsigned) index.row() < archive.getAssetCount()) {
|
||||
auto& f = archive.getAssetInfoByIndex(index.row());
|
||||
if(index.column() == 0) {
|
||||
return QString(f.name);
|
||||
|
@ -6,9 +6,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
/* HACK until Qt curve supports Qt5 */
|
||||
QApplication::setStyle(QStyleFactory::create("GTK+"));
|
||||
|
||||
ViewerWindow viewer;
|
||||
viewer.show();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user