From 7252cb63a6b129811d4594ee97e29c1b7fb5cedf Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 26 Sep 2014 17:12:48 +0200 Subject: [PATCH] Fix cppcheck issues --- apps/esmtool/labels.cpp | 890 +++++++++--------- apps/esmtool/record.cpp | 38 +- apps/mwiniimporter/importer.cpp | 7 +- apps/mwiniimporter/main.cpp | 2 + apps/opencs/model/doc/savingstages.hpp | 5 - apps/opencs/view/render/navigation.cpp | 7 +- apps/opencs/view/render/navigation.hpp | 1 + apps/opencs/view/render/scenewidget.cpp | 5 - apps/opencs/view/render/scenewidget.hpp | 2 - .../opencs/view/world/datadisplaydelegate.cpp | 2 +- .../opencs/view/world/datadisplaydelegate.hpp | 2 +- apps/openmw/crashcatcher.cpp | 2 +- apps/openmw/main.cpp | 3 +- apps/openmw/mwbase/windowmanager.hpp | 1 - apps/openmw/mwclass/npc.cpp | 7 - apps/openmw/mwclass/npc.hpp | 2 - apps/openmw/mwdialogue/dialoguemanagerimp.cpp | 6 +- apps/openmw/mwgui/class.cpp | 8 - apps/openmw/mwgui/class.hpp | 2 - apps/openmw/mwgui/console.cpp | 5 - apps/openmw/mwgui/console.hpp | 2 - apps/openmw/mwgui/dialogue.cpp | 4 +- apps/openmw/mwgui/formatting.cpp | 3 +- apps/openmw/mwgui/itemmodel.cpp | 3 +- apps/openmw/mwgui/journalviewmodel.cpp | 18 +- apps/openmw/mwgui/journalviewmodel.hpp | 3 - apps/openmw/mwgui/journalwindow.cpp | 12 - apps/openmw/mwgui/levelupdialog.cpp | 2 +- apps/openmw/mwgui/messagebox.cpp | 8 +- apps/openmw/mwgui/messagebox.hpp | 1 - apps/openmw/mwgui/race.cpp | 3 +- apps/openmw/mwgui/settingswindow.cpp | 3 +- apps/openmw/mwgui/spellcreationdialog.cpp | 3 +- apps/openmw/mwgui/spellcreationdialog.hpp | 2 - apps/openmw/mwgui/widgets.cpp | 19 +- apps/openmw/mwgui/widgets.hpp | 3 - apps/openmw/mwgui/windowmanagerimp.cpp | 10 +- apps/openmw/mwgui/windowmanagerimp.hpp | 1 - apps/openmw/mwmechanics/actors.cpp | 10 +- apps/openmw/mwmechanics/aiactivate.hpp | 2 - apps/openmw/mwmechanics/aiavoiddoor.cpp | 2 +- apps/openmw/mwmechanics/aicombataction.cpp | 22 +- apps/openmw/mwmechanics/aiescort.cpp | 1 + apps/openmw/mwmechanics/aipackage.hpp | 1 - apps/openmw/mwmechanics/aipursue.hpp | 2 - apps/openmw/mwmechanics/aisequence.cpp | 37 +- apps/openmw/mwmechanics/aisequence.hpp | 4 - apps/openmw/mwmechanics/aiwander.cpp | 11 +- apps/openmw/mwmechanics/alchemy.cpp | 5 + apps/openmw/mwmechanics/alchemy.hpp | 2 + apps/openmw/mwmechanics/combat.cpp | 4 +- apps/openmw/mwmechanics/creaturestats.cpp | 11 - apps/openmw/mwmechanics/creaturestats.hpp | 5 - apps/openmw/mwmechanics/enchanting.cpp | 13 +- apps/openmw/mwmechanics/pathfinding.cpp | 7 - apps/openmw/mwmechanics/pathfinding.hpp | 2 - apps/openmw/mwrender/animation.cpp | 5 +- apps/openmw/mwrender/camera.cpp | 8 - apps/openmw/mwrender/camera.hpp | 3 - apps/openmw/mwrender/characterpreview.cpp | 2 +- apps/openmw/mwrender/creatureanimation.cpp | 2 +- apps/openmw/mwrender/globalmap.cpp | 4 +- apps/openmw/mwrender/npcanimation.cpp | 15 +- apps/openmw/mwrender/renderingmanager.cpp | 23 - apps/openmw/mwrender/renderingmanager.hpp | 3 - apps/openmw/mwrender/ripplesimulation.hpp | 3 + apps/openmw/mwrender/shadows.cpp | 10 - apps/openmw/mwrender/shadows.hpp | 2 - apps/openmw/mwrender/sky.cpp | 17 +- apps/openmw/mwrender/sky.hpp | 3 - apps/openmw/mwrender/videoplayer.cpp | 8 +- apps/openmw/mwrender/videoplayer.hpp | 4 - apps/openmw/mwscript/interpretercontext.cpp | 6 - apps/openmw/mwscript/interpretercontext.hpp | 3 - apps/openmw/mwscript/scriptmanagerimp.cpp | 3 +- apps/openmw/mwsound/ffmpeg_decoder.cpp | 3 +- apps/openmw/mwworld/class.cpp | 4 - apps/openmw/mwworld/class.hpp | 2 - apps/openmw/mwworld/inventorystore.cpp | 16 +- apps/openmw/mwworld/scene.cpp | 7 +- apps/openmw/mwworld/worldimp.cpp | 2 +- components/compiler/generator.cpp | 15 - components/compiler/generator.hpp | 2 - components/compiler/lineparser.cpp | 6 +- components/compiler/parser.cpp | 7 - components/compiler/parser.hpp | 3 - .../contentselector/model/contentmodel.cpp | 1 - components/esm/esmreader.cpp | 8 - components/esm/esmreader.hpp | 3 - components/esm/esmwriter.cpp | 7 +- components/esm/loadcell.cpp | 5 - components/esm/loadcell.hpp | 1 - components/esm/loadland.cpp | 4 +- components/nif/niffile.cpp | 2 +- components/nifogre/material.hpp | 6 - components/nifogre/ogrenifloader.cpp | 2 +- components/nifogre/particles.cpp | 2 +- components/ogreinit/ogreinit.cpp | 2 +- components/terrain/defaultworld.hpp | 4 +- components/terrain/world.cpp | 2 + components/translation/translation.cpp | 5 + components/translation/translation.hpp | 1 + components/widgets/list.cpp | 5 - components/widgets/list.hpp | 1 - extern/oics/CMakeLists.txt | 1 + extern/oics/ICSChannel.cpp | 31 +- extern/oics/ICSControl.cpp | 8 +- extern/oics/ICSInputControlSystem.cpp | 14 +- .../oics/ICSInputControlSystem_joystick.cpp | 4 +- .../oics/ICSInputControlSystem_keyboard.cpp | 2 +- extern/oics/ICSInputControlSystem_mouse.cpp | 4 +- extern/oics/ICSPrerequisites.h | 4 +- libs/openengine/bullet/physic.cpp | 4 - libs/openengine/bullet/physic.hpp | 12 +- libs/openengine/gui/manager.cpp | 14 - libs/openengine/gui/manager.hpp | 2 - libs/openengine/ogre/renderer.cpp | 5 - libs/openengine/ogre/renderer.hpp | 2 - plugins/mygui_resource_plugin/plugin.cpp | 3 +- 119 files changed, 655 insertions(+), 945 deletions(-) diff --git a/apps/esmtool/labels.cpp b/apps/esmtool/labels.cpp index 74b2c5fd2..9543628f5 100644 --- a/apps/esmtool/labels.cpp +++ b/apps/esmtool/labels.cpp @@ -18,137 +18,143 @@ std::string bodyPartLabel(int idx) { - const char *bodyPartLabels[] = { - "Head", - "Hair", - "Neck", - "Cuirass", - "Groin", - "Skirt", - "Right Hand", - "Left Hand", - "Right Wrist", - "Left Wrist", - "Shield", - "Right Forearm", - "Left Forearm", - "Right Upperarm", - "Left Upperarm", - "Right Foot", - "Left Foot", - "Right Ankle", - "Left Ankle", - "Right Knee", - "Left Knee", - "Right Leg", - "Left Leg", - "Right Shoulder", - "Left Shoulder", - "Weapon", - "Tail" - }; - if (idx >= 0 && idx <= 26) + { + const char *bodyPartLabels[] = { + "Head", + "Hair", + "Neck", + "Cuirass", + "Groin", + "Skirt", + "Right Hand", + "Left Hand", + "Right Wrist", + "Left Wrist", + "Shield", + "Right Forearm", + "Left Forearm", + "Right Upperarm", + "Left Upperarm", + "Right Foot", + "Left Foot", + "Right Ankle", + "Left Ankle", + "Right Knee", + "Left Knee", + "Right Leg", + "Left Leg", + "Right Shoulder", + "Left Shoulder", + "Weapon", + "Tail" + }; return bodyPartLabels[idx]; + } else return "Invalid"; } std::string meshPartLabel(int idx) { - const char *meshPartLabels[] = { - "Head", - "Hair", - "Neck", - "Chest", - "Groin", - "Hand", - "Wrist", - "Forearm", - "Upperarm", - "Foot", - "Ankle", - "Knee", - "Upper Leg", - "Clavicle", - "Tail" - }; - if (idx >= 0 && idx <= ESM::BodyPart::MP_Tail) + { + const char *meshPartLabels[] = { + "Head", + "Hair", + "Neck", + "Chest", + "Groin", + "Hand", + "Wrist", + "Forearm", + "Upperarm", + "Foot", + "Ankle", + "Knee", + "Upper Leg", + "Clavicle", + "Tail" + }; return meshPartLabels[idx]; + } else return "Invalid"; } std::string meshTypeLabel(int idx) { - const char *meshTypeLabels[] = { - "Skin", - "Clothing", - "Armor" - }; - if (idx >= 0 && idx <= ESM::BodyPart::MT_Armor) + { + const char *meshTypeLabels[] = { + "Skin", + "Clothing", + "Armor" + }; return meshTypeLabels[idx]; + } else return "Invalid"; } std::string clothingTypeLabel(int idx) { - const char *clothingTypeLabels[] = { - "Pants", - "Shoes", - "Shirt", - "Belt", - "Robe", - "Right Glove", - "Left Glove", - "Skirt", - "Ring", - "Amulet" - }; - if (idx >= 0 && idx <= 9) + { + const char *clothingTypeLabels[] = { + "Pants", + "Shoes", + "Shirt", + "Belt", + "Robe", + "Right Glove", + "Left Glove", + "Skirt", + "Ring", + "Amulet" + }; return clothingTypeLabels[idx]; + } else return "Invalid"; } std::string armorTypeLabel(int idx) -{ - const char *armorTypeLabels[] = { - "Helmet", - "Cuirass", - "Left Pauldron", - "Right Pauldron", - "Greaves", - "Boots", - "Left Gauntlet", - "Right Gauntlet", - "Shield", - "Left Bracer", - "Right Bracer" - }; - +{ if (idx >= 0 && idx <= 10) + { + const char *armorTypeLabels[] = { + "Helmet", + "Cuirass", + "Left Pauldron", + "Right Pauldron", + "Greaves", + "Boots", + "Left Gauntlet", + "Right Gauntlet", + "Shield", + "Left Bracer", + "Right Bracer" + }; return armorTypeLabels[idx]; + } else return "Invalid"; } std::string dialogTypeLabel(int idx) { - const char *dialogTypeLabels[] = { - "Topic", - "Voice", - "Greeting", - "Persuasion", - "Journal" - }; - if (idx >= 0 && idx <= 4) + { + const char *dialogTypeLabels[] = { + "Topic", + "Voice", + "Greeting", + "Persuasion", + "Journal" + }; return dialogTypeLabels[idx]; + } else if (idx == -1) return "Deleted"; else @@ -157,75 +163,79 @@ std::string dialogTypeLabel(int idx) std::string questStatusLabel(int idx) { - const char *questStatusLabels[] = { - "None", - "Name", - "Finished", - "Restart", - "Deleted" - }; - if (idx >= 0 && idx <= 4) + { + const char *questStatusLabels[] = { + "None", + "Name", + "Finished", + "Restart", + "Deleted" + }; return questStatusLabels[idx]; + } else return "Invalid"; } std::string creatureTypeLabel(int idx) { - const char *creatureTypeLabels[] = { - "Creature", - "Daedra", - "Undead", - "Humanoid", - }; - if (idx >= 0 && idx <= 3) + { + const char *creatureTypeLabels[] = { + "Creature", + "Daedra", + "Undead", + "Humanoid", + }; return creatureTypeLabels[idx]; + } else return "Invalid"; } std::string soundTypeLabel(int idx) { - const char *soundTypeLabels[] = { - "Left Foot", - "Right Foot", - "Swim Left", - "Swim Right", - "Moan", - "Roar", - "Scream", - "Land" - }; - if (idx >= 0 && idx <= 7) + { + const char *soundTypeLabels[] = { + "Left Foot", + "Right Foot", + "Swim Left", + "Swim Right", + "Moan", + "Roar", + "Scream", + "Land" + }; return soundTypeLabels[idx]; + } else return "Invalid"; } std::string weaponTypeLabel(int idx) { - const char *weaponTypeLabels[] = { - "Short Blade One Hand", - "Long Blade One Hand", - "Long Blade Two Hand", - "Blunt One Hand", - "Blunt Two Close", - "Blunt Two Wide", - "Spear Two Wide", - "Axe One Hand", - "Axe Two Hand", - "Marksman Bow", - "Marksman Crossbow", - "Marksman Thrown", - "Arrow", - "Bolt" - }; - if (idx >= 0 && idx <= 13) + { + const char *weaponTypeLabels[] = { + "Short Blade One Hand", + "Long Blade One Hand", + "Long Blade Two Hand", + "Blunt One Hand", + "Blunt Two Close", + "Blunt Two Wide", + "Spear Two Wide", + "Axe One Hand", + "Axe Two Hand", + "Marksman Bow", + "Marksman Crossbow", + "Marksman Thrown", + "Arrow", + "Bolt" + }; return weaponTypeLabels[idx]; + } else return "Invalid"; } @@ -242,377 +252,397 @@ std::string aiTypeLabel(int type) std::string magicEffectLabel(int idx) { - const char* magicEffectLabels [] = { - "Water Breathing", - "Swift Swim", - "Water Walking", - "Shield", - "Fire Shield", - "Lightning Shield", - "Frost Shield", - "Burden", - "Feather", - "Jump", - "Levitate", - "SlowFall", - "Lock", - "Open", - "Fire Damage", - "Shock Damage", - "Frost Damage", - "Drain Attribute", - "Drain Health", - "Drain Magicka", - "Drain Fatigue", - "Drain Skill", - "Damage Attribute", - "Damage Health", - "Damage Magicka", - "Damage Fatigue", - "Damage Skill", - "Poison", - "Weakness to Fire", - "Weakness to Frost", - "Weakness to Shock", - "Weakness to Magicka", - "Weakness to Common Disease", - "Weakness to Blight Disease", - "Weakness to Corprus Disease", - "Weakness to Poison", - "Weakness to Normal Weapons", - "Disintegrate Weapon", - "Disintegrate Armor", - "Invisibility", - "Chameleon", - "Light", - "Sanctuary", - "Night Eye", - "Charm", - "Paralyze", - "Silence", - "Blind", - "Sound", - "Calm Humanoid", - "Calm Creature", - "Frenzy Humanoid", - "Frenzy Creature", - "Demoralize Humanoid", - "Demoralize Creature", - "Rally Humanoid", - "Rally Creature", - "Dispel", - "Soultrap", - "Telekinesis", - "Mark", - "Recall", - "Divine Intervention", - "Almsivi Intervention", - "Detect Animal", - "Detect Enchantment", - "Detect Key", - "Spell Absorption", - "Reflect", - "Cure Common Disease", - "Cure Blight Disease", - "Cure Corprus Disease", - "Cure Poison", - "Cure Paralyzation", - "Restore Attribute", - "Restore Health", - "Restore Magicka", - "Restore Fatigue", - "Restore Skill", - "Fortify Attribute", - "Fortify Health", - "Fortify Magicka", - "Fortify Fatigue", - "Fortify Skill", - "Fortify Maximum Magicka", - "Absorb Attribute", - "Absorb Health", - "Absorb Magicka", - "Absorb Fatigue", - "Absorb Skill", - "Resist Fire", - "Resist Frost", - "Resist Shock", - "Resist Magicka", - "Resist Common Disease", - "Resist Blight Disease", - "Resist Corprus Disease", - "Resist Poison", - "Resist Normal Weapons", - "Resist Paralysis", - "Remove Curse", - "Turn Undead", - "Summon Scamp", - "Summon Clannfear", - "Summon Daedroth", - "Summon Dremora", - "Summon Ancestral Ghost", - "Summon Skeletal Minion", - "Summon Bonewalker", - "Summon Greater Bonewalker", - "Summon Bonelord", - "Summon Winged Twilight", - "Summon Hunger", - "Summon Golden Saint", - "Summon Flame Atronach", - "Summon Frost Atronach", - "Summon Storm Atronach", - "Fortify Attack", - "Command Creature", - "Command Humanoid", - "Bound Dagger", - "Bound Longsword", - "Bound Mace", - "Bound Battle Axe", - "Bound Spear", - "Bound Longbow", - "EXTRA SPELL", - "Bound Cuirass", - "Bound Helm", - "Bound Boots", - "Bound Shield", - "Bound Gloves", - "Corprus", - "Vampirism", - "Summon Centurion Sphere", - "Sun Damage", - "Stunted Magicka", - "Summon Fabricant", - "sEffectSummonCreature01", - "sEffectSummonCreature02", - "sEffectSummonCreature03", - "sEffectSummonCreature04", - "sEffectSummonCreature05" - }; if (idx >= 0 && idx <= 142) + { + const char* magicEffectLabels [] = { + "Water Breathing", + "Swift Swim", + "Water Walking", + "Shield", + "Fire Shield", + "Lightning Shield", + "Frost Shield", + "Burden", + "Feather", + "Jump", + "Levitate", + "SlowFall", + "Lock", + "Open", + "Fire Damage", + "Shock Damage", + "Frost Damage", + "Drain Attribute", + "Drain Health", + "Drain Magicka", + "Drain Fatigue", + "Drain Skill", + "Damage Attribute", + "Damage Health", + "Damage Magicka", + "Damage Fatigue", + "Damage Skill", + "Poison", + "Weakness to Fire", + "Weakness to Frost", + "Weakness to Shock", + "Weakness to Magicka", + "Weakness to Common Disease", + "Weakness to Blight Disease", + "Weakness to Corprus Disease", + "Weakness to Poison", + "Weakness to Normal Weapons", + "Disintegrate Weapon", + "Disintegrate Armor", + "Invisibility", + "Chameleon", + "Light", + "Sanctuary", + "Night Eye", + "Charm", + "Paralyze", + "Silence", + "Blind", + "Sound", + "Calm Humanoid", + "Calm Creature", + "Frenzy Humanoid", + "Frenzy Creature", + "Demoralize Humanoid", + "Demoralize Creature", + "Rally Humanoid", + "Rally Creature", + "Dispel", + "Soultrap", + "Telekinesis", + "Mark", + "Recall", + "Divine Intervention", + "Almsivi Intervention", + "Detect Animal", + "Detect Enchantment", + "Detect Key", + "Spell Absorption", + "Reflect", + "Cure Common Disease", + "Cure Blight Disease", + "Cure Corprus Disease", + "Cure Poison", + "Cure Paralyzation", + "Restore Attribute", + "Restore Health", + "Restore Magicka", + "Restore Fatigue", + "Restore Skill", + "Fortify Attribute", + "Fortify Health", + "Fortify Magicka", + "Fortify Fatigue", + "Fortify Skill", + "Fortify Maximum Magicka", + "Absorb Attribute", + "Absorb Health", + "Absorb Magicka", + "Absorb Fatigue", + "Absorb Skill", + "Resist Fire", + "Resist Frost", + "Resist Shock", + "Resist Magicka", + "Resist Common Disease", + "Resist Blight Disease", + "Resist Corprus Disease", + "Resist Poison", + "Resist Normal Weapons", + "Resist Paralysis", + "Remove Curse", + "Turn Undead", + "Summon Scamp", + "Summon Clannfear", + "Summon Daedroth", + "Summon Dremora", + "Summon Ancestral Ghost", + "Summon Skeletal Minion", + "Summon Bonewalker", + "Summon Greater Bonewalker", + "Summon Bonelord", + "Summon Winged Twilight", + "Summon Hunger", + "Summon Golden Saint", + "Summon Flame Atronach", + "Summon Frost Atronach", + "Summon Storm Atronach", + "Fortify Attack", + "Command Creature", + "Command Humanoid", + "Bound Dagger", + "Bound Longsword", + "Bound Mace", + "Bound Battle Axe", + "Bound Spear", + "Bound Longbow", + "EXTRA SPELL", + "Bound Cuirass", + "Bound Helm", + "Bound Boots", + "Bound Shield", + "Bound Gloves", + "Corprus", + "Vampirism", + "Summon Centurion Sphere", + "Sun Damage", + "Stunted Magicka", + "Summon Fabricant", + "sEffectSummonCreature01", + "sEffectSummonCreature02", + "sEffectSummonCreature03", + "sEffectSummonCreature04", + "sEffectSummonCreature05" + }; return magicEffectLabels[idx]; + } else return "Invalid"; } std::string attributeLabel(int idx) { - const char* attributeLabels [] = { - "Strength", - "Intelligence", - "Willpower", - "Agility", - "Speed", - "Endurance", - "Personality", - "Luck" - }; if (idx >= 0 && idx <= 7) + { + const char* attributeLabels [] = { + "Strength", + "Intelligence", + "Willpower", + "Agility", + "Speed", + "Endurance", + "Personality", + "Luck" + }; return attributeLabels[idx]; + } else return "Invalid"; } std::string spellTypeLabel(int idx) { - const char* spellTypeLabels [] = { - "Spells", - "Abilities", - "Blight Disease", - "Disease", - "Curse", - "Powers" - }; if (idx >= 0 && idx <= 5) + { + const char* spellTypeLabels [] = { + "Spells", + "Abilities", + "Blight Disease", + "Disease", + "Curse", + "Powers" + }; return spellTypeLabels[idx]; + } else return "Invalid"; } std::string specializationLabel(int idx) { - const char* specializationLabels [] = { - "Combat", - "Magic", - "Stealth" - }; if (idx >= 0 && idx <= 2) + { + const char* specializationLabels [] = { + "Combat", + "Magic", + "Stealth" + }; return specializationLabels[idx]; + } else return "Invalid"; } std::string skillLabel(int idx) { - const char* skillLabels [] = { - "Block", - "Armorer", - "Medium Armor", - "Heavy Armor", - "Blunt Weapon", - "Long Blade", - "Axe", - "Spear", - "Athletics", - "Enchant", - "Destruction", - "Alteration", - "Illusion", - "Conjuration", - "Mysticism", - "Restoration", - "Alchemy", - "Unarmored", - "Security", - "Sneak", - "Acrobatics", - "Light Armor", - "Short Blade", - "Marksman", - "Mercantile", - "Speechcraft", - "Hand-to-hand" - }; if (idx >= 0 && idx <= 26) + { + const char* skillLabels [] = { + "Block", + "Armorer", + "Medium Armor", + "Heavy Armor", + "Blunt Weapon", + "Long Blade", + "Axe", + "Spear", + "Athletics", + "Enchant", + "Destruction", + "Alteration", + "Illusion", + "Conjuration", + "Mysticism", + "Restoration", + "Alchemy", + "Unarmored", + "Security", + "Sneak", + "Acrobatics", + "Light Armor", + "Short Blade", + "Marksman", + "Mercantile", + "Speechcraft", + "Hand-to-hand" + }; return skillLabels[idx]; + } else return "Invalid"; } std::string apparatusTypeLabel(int idx) { - const char* apparatusTypeLabels [] = { - "Mortar", - "Alembic", - "Calcinator", - "Retort", - }; if (idx >= 0 && idx <= 3) + { + const char* apparatusTypeLabels [] = { + "Mortar", + "Alembic", + "Calcinator", + "Retort", + }; return apparatusTypeLabels[idx]; + } else return "Invalid"; } std::string rangeTypeLabel(int idx) { - const char* rangeTypeLabels [] = { - "Self", - "Touch", - "Target" - }; if (idx >= 0 && idx <= 2) + { + const char* rangeTypeLabels [] = { + "Self", + "Touch", + "Target" + }; return rangeTypeLabels[idx]; + } else return "Invalid"; } std::string schoolLabel(int idx) { - const char* schoolLabels [] = { - "Alteration", - "Conjuration", - "Destruction", - "Illusion", - "Mysticism", - "Restoration" - }; if (idx >= 0 && idx <= 5) + { + const char* schoolLabels [] = { + "Alteration", + "Conjuration", + "Destruction", + "Illusion", + "Mysticism", + "Restoration" + }; return schoolLabels[idx]; + } else return "Invalid"; } std::string enchantTypeLabel(int idx) { - const char* enchantTypeLabels [] = { - "Cast Once", - "Cast When Strikes", - "Cast When Used", - "Constant Effect" - }; if (idx >= 0 && idx <= 3) + { + const char* enchantTypeLabels [] = { + "Cast Once", + "Cast When Strikes", + "Cast When Used", + "Constant Effect" + }; return enchantTypeLabels[idx]; + } else return "Invalid"; } std::string ruleFunction(int idx) { - std::string ruleFunctions[] = { - "Reaction Low", - "Reaction High", - "Rank Requirement", - "NPC? Reputation", - "Health Percent", - "Player Reputation", - "NPC Level", - "Player Health Percent", - "Player Magicka", - "Player Fatigue", - "Player Attribute Strength", - "Player Skill Block", - "Player Skill Armorer", - "Player Skill Medium Armor", - "Player Skill Heavy Armor", - "Player Skill Blunt Weapon", - "Player Skill Long Blade", - "Player Skill Axe", - "Player Skill Spear", - "Player Skill Athletics", - "Player Skill Enchant", - "Player Skill Destruction", - "Player Skill Alteration", - "Player Skill Illusion", - "Player Skill Conjuration", - "Player Skill Mysticism", - "Player SKill Restoration", - "Player Skill Alchemy", - "Player Skill Unarmored", - "Player Skill Security", - "Player Skill Sneak", - "Player Skill Acrobatics", - "Player Skill Light Armor", - "Player Skill Short Blade", - "Player Skill Marksman", - "Player Skill Mercantile", - "Player Skill Speechcraft", - "Player Skill Hand to Hand", - "Player Gender", - "Player Expelled from Faction", - "Player Diseased (Common)", - "Player Diseased (Blight)", - "Player Clothing Modifier", - "Player Crime Level", - "Player Same Sex", - "Player Same Race", - "Player Same Faction", - "Faction Rank Difference", - "Player Detected", - "Alarmed", - "Choice Selected", - "Player Attribute Intelligence", - "Player Attribute Willpower", - "Player Attribute Agility", - "Player Attribute Speed", - "Player Attribute Endurance", - "Player Attribute Personality", - "Player Attribute Luck", - "Player Diseased (Corprus)", - "Weather", - "Player is a Vampire", - "Player Level", - "Attacked", - "NPC Talked to Player", - "Player Health", - "Creature Target", - "Friend Hit", - "Fight", - "Hello", - "Alarm", - "Flee", - "Should Attack", - "Werewolf" - }; if (idx >= 0 && idx <= 72) + { + std::string ruleFunctions[] = { + "Reaction Low", + "Reaction High", + "Rank Requirement", + "NPC? Reputation", + "Health Percent", + "Player Reputation", + "NPC Level", + "Player Health Percent", + "Player Magicka", + "Player Fatigue", + "Player Attribute Strength", + "Player Skill Block", + "Player Skill Armorer", + "Player Skill Medium Armor", + "Player Skill Heavy Armor", + "Player Skill Blunt Weapon", + "Player Skill Long Blade", + "Player Skill Axe", + "Player Skill Spear", + "Player Skill Athletics", + "Player Skill Enchant", + "Player Skill Destruction", + "Player Skill Alteration", + "Player Skill Illusion", + "Player Skill Conjuration", + "Player Skill Mysticism", + "Player SKill Restoration", + "Player Skill Alchemy", + "Player Skill Unarmored", + "Player Skill Security", + "Player Skill Sneak", + "Player Skill Acrobatics", + "Player Skill Light Armor", + "Player Skill Short Blade", + "Player Skill Marksman", + "Player Skill Mercantile", + "Player Skill Speechcraft", + "Player Skill Hand to Hand", + "Player Gender", + "Player Expelled from Faction", + "Player Diseased (Common)", + "Player Diseased (Blight)", + "Player Clothing Modifier", + "Player Crime Level", + "Player Same Sex", + "Player Same Race", + "Player Same Faction", + "Faction Rank Difference", + "Player Detected", + "Alarmed", + "Choice Selected", + "Player Attribute Intelligence", + "Player Attribute Willpower", + "Player Attribute Agility", + "Player Attribute Speed", + "Player Attribute Endurance", + "Player Attribute Personality", + "Player Attribute Luck", + "Player Diseased (Corprus)", + "Weather", + "Player is a Vampire", + "Player Level", + "Attacked", + "NPC Talked to Player", + "Player Health", + "Creature Target", + "Friend Hit", + "Fight", + "Hello", + "Alarm", + "Flee", + "Should Attack", + "Werewolf" + }; return ruleFunctions[idx]; + } else return "Invalid"; } diff --git a/apps/esmtool/record.cpp b/apps/esmtool/record.cpp index 07c1ef431..3f2ebc2ba 100644 --- a/apps/esmtool/record.cpp +++ b/apps/esmtool/record.cpp @@ -412,7 +412,7 @@ void Record::print() std::cout << " Armor: " << mData.mData.mArmor << std::endl; std::cout << " Enchantment Points: " << mData.mData.mEnchant << std::endl; std::vector::iterator pit; - for (pit = mData.mParts.mParts.begin(); pit != mData.mParts.mParts.end(); pit++) + for (pit = mData.mParts.mParts.begin(); pit != mData.mParts.mParts.end(); ++pit) { std::cout << " Body Part: " << bodyPartLabel(pit->mPart) << " (" << (int)(pit->mPart) << ")" << std::endl; @@ -484,7 +484,7 @@ void Record::print() std::cout << " Texture: " << mData.mTexture << std::endl; std::cout << " Description: " << mData.mDescription << std::endl; std::vector::iterator pit; - for (pit = mData.mPowers.mList.begin(); pit != mData.mPowers.mList.end(); pit++) + for (pit = mData.mPowers.mList.begin(); pit != mData.mPowers.mList.end(); ++pit) std::cout << " Power: " << *pit << std::endl; } @@ -554,7 +554,7 @@ void Record::print() std::cout << " Value: " << mData.mData.mValue << std::endl; std::cout << " Enchantment Points: " << mData.mData.mEnchant << std::endl; std::vector::iterator pit; - for (pit = mData.mParts.mParts.begin(); pit != mData.mParts.mParts.end(); pit++) + for (pit = mData.mParts.mParts.begin(); pit != mData.mParts.mParts.end(); ++pit) { std::cout << " Body Part: " << bodyPartLabel(pit->mPart) << " (" << (int)(pit->mPart) << ")" << std::endl; @@ -574,7 +574,7 @@ void Record::print() std::cout << " Flags: " << containerFlags(mData.mFlags) << std::endl; std::cout << " Weight: " << mData.mWeight << std::endl; std::vector::iterator cit; - for (cit = mData.mInventory.mList.begin(); cit != mData.mInventory.mList.end(); cit++) + for (cit = mData.mInventory.mList.begin(); cit != mData.mInventory.mList.end(); ++cit) std::cout << " Inventory: Count: " << boost::format("%4d") % cit->mCount << " Item: " << cit->mItem.toString() << std::endl; } @@ -619,12 +619,12 @@ void Record::print() std::cout << " Gold: " << mData.mData.mGold << std::endl; std::vector::iterator cit; - for (cit = mData.mInventory.mList.begin(); cit != mData.mInventory.mList.end(); cit++) + for (cit = mData.mInventory.mList.begin(); cit != mData.mInventory.mList.end(); ++cit) std::cout << " Inventory: Count: " << boost::format("%4d") % cit->mCount << " Item: " << cit->mItem.toString() << std::endl; std::vector::iterator sit; - for (sit = mData.mSpells.mList.begin(); sit != mData.mSpells.mList.end(); sit++) + for (sit = mData.mSpells.mList.begin(); sit != mData.mSpells.mList.end(); ++sit) std::cout << " Spell: " << *sit << std::endl; std::cout << " Artifical Intelligence: " << mData.mHasAI << std::endl; @@ -639,7 +639,7 @@ void Record::print() std::cout << " AI Services:" << boost::format("0x%08X") % mData.mAiData.mServices << std::endl; std::vector::iterator pit; - for (pit = mData.mAiPackage.mList.begin(); pit != mData.mAiPackage.mList.end(); pit++) + for (pit = mData.mAiPackage.mList.begin(); pit != mData.mAiPackage.mList.end(); ++pit) printAIPackage(*pit); } @@ -706,7 +706,7 @@ void Record::print() << mData.mData.mRankData[i].mFactReaction << std::endl; } std::map::iterator rit; - for (rit = mData.mReactions.begin(); rit != mData.mReactions.end(); rit++) + for (rit = mData.mReactions.begin(); rit != mData.mReactions.end(); ++rit) std::cout << " Reaction: " << rit->second << " = " << rit->first << std::endl; } @@ -763,7 +763,7 @@ void Record::print() std::cout << " Unknown2: " << (int)mData.mData.mUnknown2 << std::endl; std::vector::iterator sit; - for (sit = mData.mSelects.begin(); sit != mData.mSelects.end(); sit++) + for (sit = mData.mSelects.begin(); sit != mData.mSelects.end(); ++sit) std::cout << " Select Rule: " << ruleString(*sit) << std::endl; if (mData.mResultScript != "") @@ -835,7 +835,7 @@ void Record::print() std::cout << " Flags: " << creatureListFlags(mData.mFlags) << std::endl; std::cout << " Number of items: " << mData.mList.size() << std::endl; std::vector::iterator iit; - for (iit = mData.mList.begin(); iit != mData.mList.end(); iit++) + for (iit = mData.mList.begin(); iit != mData.mList.end(); ++iit) std::cout << " Creature: Level: " << iit->mLevel << " Creature: " << iit->mId << std::endl; } @@ -847,7 +847,7 @@ void Record::print() std::cout << " Flags: " << itemListFlags(mData.mFlags) << std::endl; std::cout << " Number of items: " << mData.mList.size() << std::endl; std::vector::iterator iit; - for (iit = mData.mList.begin(); iit != mData.mList.end(); iit++) + for (iit = mData.mList.begin(); iit != mData.mList.end(); ++iit) std::cout << " Inventory: Level: " << iit->mLevel << " Item: " << iit->mId << std::endl; } @@ -1031,16 +1031,16 @@ void Record::print() } std::vector::iterator cit; - for (cit = mData.mInventory.mList.begin(); cit != mData.mInventory.mList.end(); cit++) + for (cit = mData.mInventory.mList.begin(); cit != mData.mInventory.mList.end(); ++cit) std::cout << " Inventory: Count: " << boost::format("%4d") % cit->mCount << " Item: " << cit->mItem.toString() << std::endl; std::vector::iterator sit; - for (sit = mData.mSpells.mList.begin(); sit != mData.mSpells.mList.end(); sit++) + for (sit = mData.mSpells.mList.begin(); sit != mData.mSpells.mList.end(); ++sit) std::cout << " Spell: " << *sit << std::endl; std::vector::iterator dit; - for (dit = mData.mTransport.begin(); dit != mData.mTransport.end(); dit++) + for (dit = mData.mTransport.begin(); dit != mData.mTransport.end(); ++dit) { std::cout << " Destination Position: " << boost::format("%12.3f") % dit->mPos.pos[0] << "," @@ -1066,7 +1066,7 @@ void Record::print() std::cout << " AI Services:" << boost::format("0x%08X") % mData.mAiData.mServices << std::endl; std::vector::iterator pit; - for (pit = mData.mAiPackage.mList.begin(); pit != mData.mAiPackage.mList.end(); pit++) + for (pit = mData.mAiPackage.mList.begin(); pit != mData.mAiPackage.mList.end(); ++pit) printAIPackage(*pit); } @@ -1140,7 +1140,7 @@ void Record::print() << mData.mData.mBonus[i].mBonus << std::endl; std::vector::iterator sit; - for (sit = mData.mPowers.mList.begin(); sit != mData.mPowers.mList.end(); sit++) + for (sit = mData.mPowers.mList.begin(); sit != mData.mPowers.mList.end(); ++sit) std::cout << " Power: " << *sit << std::endl; } @@ -1164,7 +1164,7 @@ void Record::print() if (mData.mSleepList != "") std::cout << " Sleep List: " << mData.mSleepList << std::endl; std::vector::iterator sit; - for (sit = mData.mSoundList.begin(); sit != mData.mSoundList.end(); sit++) + for (sit = mData.mSoundList.begin(); sit != mData.mSoundList.end(); ++sit) std::cout << " Sound: " << (int)sit->mChance << " = " << sit->mSound.toString() << std::endl; } @@ -1181,12 +1181,12 @@ void Record::print() std::vector::iterator vit; - for (vit = mData.mVarNames.begin(); vit != mData.mVarNames.end(); vit++) + for (vit = mData.mVarNames.begin(); vit != mData.mVarNames.end(); ++vit) std::cout << " Variable: " << *vit << std::endl; std::cout << " ByteCode: "; std::vector::iterator cit; - for (cit = mData.mScriptData.begin(); cit != mData.mScriptData.end(); cit++) + for (cit = mData.mScriptData.begin(); cit != mData.mScriptData.end(); ++cit) std::cout << boost::format("%02X") % (int)(*cit); std::cout << std::endl; diff --git a/apps/mwiniimporter/importer.cpp b/apps/mwiniimporter/importer.cpp index 3a52592ae..80f186b1f 100644 --- a/apps/mwiniimporter/importer.cpp +++ b/apps/mwiniimporter/importer.cpp @@ -15,6 +15,7 @@ namespace bfs = boost::filesystem; MwIniImporter::MwIniImporter() : mVerbose(false) + , mEncoding(ToUTF8::WINDOWS_1250) { const char *map[][2] = { @@ -709,8 +710,7 @@ MwIniImporter::multistrmap MwIniImporter::loadIniFile(const std::string& filenam continue; } - multistrmap::iterator it; - if((it = map.find(key)) == map.end()) { + if(map.find(key) == map.end()) { map.insert( std::make_pair (key, std::vector() ) ); } map[key].push_back(value); @@ -746,8 +746,7 @@ MwIniImporter::multistrmap MwIniImporter::loadCfgFile(const std::string& filenam std::string key(line.substr(0,pos)); std::string value(line.substr(pos+1)); - multistrmap::iterator it; - if((it = map.find(key)) == map.end()) { + if(map.find(key) == map.end()) { map.insert( std::make_pair (key, std::vector() ) ); } map[key].push_back(value); diff --git a/apps/mwiniimporter/main.cpp b/apps/mwiniimporter/main.cpp index c10103cd6..fdf6db804 100644 --- a/apps/mwiniimporter/main.cpp +++ b/apps/mwiniimporter/main.cpp @@ -37,6 +37,8 @@ public: char **get() const { return const_cast(argv); } private: + utf8argv(const utf8argv&); + utf8argv& operator=(const utf8argv&); const char **argv; std::vector args; diff --git a/apps/opencs/model/doc/savingstages.hpp b/apps/opencs/model/doc/savingstages.hpp index d766b774e..54e877ef3 100644 --- a/apps/opencs/model/doc/savingstages.hpp +++ b/apps/opencs/model/doc/savingstages.hpp @@ -103,11 +103,6 @@ namespace CSMDoc if (state==CSMWorld::RecordBase::State_Modified || state==CSMWorld::RecordBase::State_ModifiedOnly) { - std::string type; - for (int i=0; i<4; ++i) - /// \todo make endianess agnostic (change ESMWriter interface?) - type += reinterpret_cast (&mCollection.getRecord (stage).mModified.sRecordId)[i]; - mState.getWriter().startRecord (mCollection.getRecord (stage).mModified.sRecordId); mState.getWriter().writeHNCString ("NAME", mCollection.getId (stage)); mCollection.getRecord (stage).mModified.save (mState.getWriter()); diff --git a/apps/opencs/view/render/navigation.cpp b/apps/opencs/view/render/navigation.cpp index 14ae7f0b7..705759104 100644 --- a/apps/opencs/view/render/navigation.cpp +++ b/apps/opencs/view/render/navigation.cpp @@ -11,9 +11,14 @@ float CSVRender::Navigation::getFactor (bool mouse) const return factor; } +CSVRender::Navigation::Navigation() + : mFastModeFactor(1) +{ +} + CSVRender::Navigation::~Navigation() {} void CSVRender::Navigation::setFastModeFactor (float factor) { mFastModeFactor = factor; -} \ No newline at end of file +} diff --git a/apps/opencs/view/render/navigation.hpp b/apps/opencs/view/render/navigation.hpp index 873519609..ead8f3e13 100644 --- a/apps/opencs/view/render/navigation.hpp +++ b/apps/opencs/view/render/navigation.hpp @@ -20,6 +20,7 @@ namespace CSVRender public: + Navigation(); virtual ~Navigation(); void setFastModeFactor (float factor); diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 1a720ff33..06b041786 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -361,11 +361,6 @@ namespace CSVRender } } - int SceneWidget::getFastFactor() const - { - return mFast ? mFastFactor : 1; - } - void SceneWidget::setLighting (Lighting *lighting) { if (mLighting) diff --git a/apps/opencs/view/render/scenewidget.hpp b/apps/opencs/view/render/scenewidget.hpp index 9f79aee17..6361589a4 100644 --- a/apps/opencs/view/render/scenewidget.hpp +++ b/apps/opencs/view/render/scenewidget.hpp @@ -80,8 +80,6 @@ namespace CSVRender void updateOgreWindow(); - int getFastFactor() const; - void setLighting (Lighting *lighting); ///< \attention The ownership of \a lighting is not transferred to *this. diff --git a/apps/opencs/view/world/datadisplaydelegate.cpp b/apps/opencs/view/world/datadisplaydelegate.cpp index 20cf22cdf..46ca17a29 100644 --- a/apps/opencs/view/world/datadisplaydelegate.cpp +++ b/apps/opencs/view/world/datadisplaydelegate.cpp @@ -38,7 +38,7 @@ void CSVWorld::DataDisplayDelegate::buildPixmaps () } } -void CSVWorld::DataDisplayDelegate::setIconSize(const QSize size) +void CSVWorld::DataDisplayDelegate::setIconSize(const QSize& size) { mIconSize = size; buildPixmaps(); diff --git a/apps/opencs/view/world/datadisplaydelegate.hpp b/apps/opencs/view/world/datadisplaydelegate.hpp index a29675e74..73790e3c6 100755 --- a/apps/opencs/view/world/datadisplaydelegate.hpp +++ b/apps/opencs/view/world/datadisplaydelegate.hpp @@ -50,7 +50,7 @@ namespace CSVWorld virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; /// pass a QSize defining height / width of icon. Default is QSize (16,16). - void setIconSize (const QSize icon); + void setIconSize (const QSize& icon); /// offset the horizontal position of the icon from the left edge of the cell. Default is 3 pixels. void setIconLeftOffset (int offset); diff --git a/apps/openmw/crashcatcher.cpp b/apps/openmw/crashcatcher.cpp index a21583402..b9d78540e 100644 --- a/apps/openmw/crashcatcher.cpp +++ b/apps/openmw/crashcatcher.cpp @@ -127,7 +127,6 @@ static int (*cc_user_info)(char*, char*); static void gdb_info(pid_t pid) { char respfile[64]; - char cmd_buf[128]; FILE *f; int fd; @@ -156,6 +155,7 @@ static void gdb_info(pid_t pid) fclose(f); /* Run gdb and print process info. */ + char cmd_buf[128]; snprintf(cmd_buf, sizeof(cmd_buf), "gdb --quiet --batch --command=%s", respfile); printf("Executing: %s\n", cmd_buf); fflush(stdout); diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index ebadeb732..744780b25 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -62,7 +62,6 @@ void validate(boost::any &v, std::vector const &tokens, FallbackMap FallbackMap *map = boost::any_cast(&v); - std::map::iterator mapIt; for(std::vector::const_iterator it=tokens.begin(); it != tokens.end(); ++it) { int sep = it->find(","); @@ -76,7 +75,7 @@ void validate(boost::any &v, std::vector const &tokens, FallbackMap std::string key(it->substr(0,sep)); std::string value(it->substr(sep+1)); - if((mapIt = map->mMap.find(key)) == map->mMap.end()) + if(map->mMap.find(key) == map->mMap.end()) { map->mMap.insert(std::make_pair (key,value)); } diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp index b4332b0fd..e8286bdd1 100644 --- a/apps/openmw/mwbase/windowmanager.hpp +++ b/apps/openmw/mwbase/windowmanager.hpp @@ -225,7 +225,6 @@ namespace MWBase virtual void showCrosshair(bool show) = 0; virtual bool getSubtitlesEnabled() = 0; - virtual void toggleHud() = 0; virtual bool toggleGui() = 0; virtual void disallowMouse() = 0; diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index dd879305d..cf1b74485 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -1188,13 +1188,6 @@ namespace MWClass + shield; } - - void Npc::adjustRotation(const MWWorld::Ptr& ptr,float& x,float& y,float& z) const - { - y = 0; - x = 0; - } - void Npc::adjustScale(const MWWorld::Ptr &ptr, float &scale) const { MWWorld::LiveCellRef *ref = diff --git a/apps/openmw/mwclass/npc.hpp b/apps/openmw/mwclass/npc.hpp index 05594a530..fd16e6f08 100644 --- a/apps/openmw/mwclass/npc.hpp +++ b/apps/openmw/mwclass/npc.hpp @@ -139,8 +139,6 @@ namespace MWClass virtual void skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType, float extraFactor=1.f) const; ///< Inform actor \a ptr that a skill use has succeeded. - virtual void adjustRotation(const MWWorld::Ptr& ptr,float& x,float& y,float& z) const; - virtual bool isEssential (const MWWorld::Ptr& ptr) const; ///< Is \a ptr essential? (i.e. may losing \a ptr make the game unwinnable) diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp index f09b81b40..892669678 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp @@ -729,10 +729,10 @@ namespace MWDialogue { std::vector result; MyGUI::UString utext(text); - size_t pos_begin, pos_end, iteration_pos = 0; + size_t pos_end, iteration_pos = 0; for(;;) { - pos_begin = utext.find('@', iteration_pos); + size_t pos_begin = utext.find('@', iteration_pos); if (pos_begin != std::string::npos) pos_end = utext.find('#', pos_begin); @@ -758,12 +758,12 @@ namespace MWDialogue size_t RemovePseudoAsterisks(std::string& phrase) { size_t pseudoAsterisksCount = 0; - const char specialPseudoAsteriskCharacter = 127; if( !phrase.empty() ) { std::string::reverse_iterator rit = phrase.rbegin(); + const char specialPseudoAsteriskCharacter = 127; while( rit != phrase.rend() && *rit == specialPseudoAsteriskCharacter ) { pseudoAsterisksCount++; diff --git a/apps/openmw/mwgui/class.cpp b/apps/openmw/mwgui/class.cpp index b4308858a..4e45f1a7c 100644 --- a/apps/openmw/mwgui/class.cpp +++ b/apps/openmw/mwgui/class.cpp @@ -277,7 +277,6 @@ namespace MWGui InfoBoxDialog::InfoBoxDialog() : WindowModal("openmw_infobox.layout") - , mCurrentButton(-1) { getWidget(mTextBox, "TextBox"); getWidget(mText, "Text"); @@ -306,7 +305,6 @@ namespace MWGui MyGUI::Gui::getInstance().destroyWidget(*it); } this->mButtons.clear(); - mCurrentButton = -1; // TODO: The buttons should be generated from a template in the layout file, ie. cloning an existing widget MyGUI::Button* button; @@ -336,11 +334,6 @@ namespace MWGui center(); } - int InfoBoxDialog::getChosenButton() const - { - return mCurrentButton; - } - void InfoBoxDialog::onButtonClicked(MyGUI::Widget* _sender) { std::vector::const_iterator end = mButtons.end(); @@ -349,7 +342,6 @@ namespace MWGui { if (*it == _sender) { - mCurrentButton = i; eventButtonSelected(i); return; } diff --git a/apps/openmw/mwgui/class.hpp b/apps/openmw/mwgui/class.hpp index 846edc667..40056ca5e 100644 --- a/apps/openmw/mwgui/class.hpp +++ b/apps/openmw/mwgui/class.hpp @@ -24,7 +24,6 @@ namespace MWGui void setButtons(ButtonList &buttons); virtual void open(); - int getChosenButton() const; // Events typedef MyGUI::delegates::CMultiDelegate1 EventHandle_Int; @@ -41,7 +40,6 @@ namespace MWGui void fitToText(MyGUI::TextBox* widget); void layoutVertically(MyGUI::Widget* widget, int margin); - int mCurrentButton; MyGUI::Widget* mTextBox; MyGUI::TextBox* mText; MyGUI::Widget* mButtonBar; diff --git a/apps/openmw/mwgui/console.cpp b/apps/openmw/mwgui/console.cpp index af0eb6ef9..5a7193d65 100644 --- a/apps/openmw/mwgui/console.cpp +++ b/apps/openmw/mwgui/console.cpp @@ -155,11 +155,6 @@ namespace MWGui mCommandLine->setFontName(fntName); } - void Console::clearHistory() - { - mHistory->setCaption(""); - } - void Console::print(const std::string &msg) { mHistory->addText(msg); diff --git a/apps/openmw/mwgui/console.hpp b/apps/openmw/mwgui/console.hpp index 90da740c2..09a05be48 100644 --- a/apps/openmw/mwgui/console.hpp +++ b/apps/openmw/mwgui/console.hpp @@ -48,8 +48,6 @@ namespace MWGui void onResChange(int width, int height); - void clearHistory(); - // Print a message to the console. Messages may contain color // code, eg. "#FFFFFF this is white". void print(const std::string &msg); diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp index 28639a8e1..a3f82e65d 100644 --- a/apps/openmw/mwgui/dialogue.cpp +++ b/apps/openmw/mwgui/dialogue.cpp @@ -125,10 +125,10 @@ namespace MWGui // We need this copy for when @# hyperlinks are replaced std::string text = mText; - size_t pos_begin, pos_end; + size_t pos_end; for(;;) { - pos_begin = text.find('@'); + size_t pos_begin = text.find('@'); if (pos_begin != std::string::npos) pos_end = text.find('#', pos_begin); diff --git a/apps/openmw/mwgui/formatting.cpp b/apps/openmw/mwgui/formatting.cpp index d838ae8af..096c7db0b 100644 --- a/apps/openmw/mwgui/formatting.cpp +++ b/apps/openmw/mwgui/formatting.cpp @@ -183,10 +183,9 @@ namespace MWGui paper->setNeedMouseFocus(false); BookTextParser parser(markup); - BookTextParser::Events event; for (;;) { - event = parser.next(); + BookTextParser::Events event = parser.next(); if (event == BookTextParser::Event_BrTag || event == BookTextParser::Event_PTag) continue; diff --git a/apps/openmw/mwgui/itemmodel.cpp b/apps/openmw/mwgui/itemmodel.cpp index 17f787dcb..f5135ce80 100644 --- a/apps/openmw/mwgui/itemmodel.cpp +++ b/apps/openmw/mwgui/itemmodel.cpp @@ -36,7 +36,8 @@ namespace MWGui Misc::StringUtils::toLower(currentGMSTID); // Don't bother checking this GMST if it's not a sMagicBound* one. - if (currentGMSTID.find("smagicbound") != 0) + const std::string& toFind = "smagicbound"; + if (currentGMSTID.compare(0, toFind.length(), toFind) != 0) continue; // All sMagicBound* GMST's should be of type string diff --git a/apps/openmw/mwgui/journalviewmodel.cpp b/apps/openmw/mwgui/journalviewmodel.cpp index b71e64a19..45a1858d2 100644 --- a/apps/openmw/mwgui/journalviewmodel.cpp +++ b/apps/openmw/mwgui/journalviewmodel.cpp @@ -113,10 +113,10 @@ struct JournalViewModelImpl : JournalViewModel utf8text = getText (); - size_t pos_begin, pos_end; + size_t pos_end = 0; for(;;) { - pos_begin = utf8text.find('@'); + size_t pos_begin = utf8text.find('@'); if (pos_begin != std::string::npos) pos_end = utf8text.find('#', pos_begin); @@ -223,15 +223,6 @@ struct JournalViewModelImpl : JournalViewModel } } - void visitQuestName (QuestId questId, boost::function visitor) const - { - MWDialogue::Quest const * quest = reinterpret_cast (questId); - - std::string name = quest->getName (); - - visitor (toUtf8Span (name)); - } - template struct JournalEntryImpl : BaseEntry { @@ -301,11 +292,6 @@ struct JournalViewModelImpl : JournalViewModel } } - void visitTopics (boost::function visitor) const - { - throw std::runtime_error ("not implemented"); - } - void visitTopicName (TopicId topicId, boost::function visitor) const { MWDialogue::Topic const & topic = * reinterpret_cast (topicId); diff --git a/apps/openmw/mwgui/journalviewmodel.hpp b/apps/openmw/mwgui/journalviewmodel.hpp index 4b827d1ab..5f0189b59 100644 --- a/apps/openmw/mwgui/journalviewmodel.hpp +++ b/apps/openmw/mwgui/journalviewmodel.hpp @@ -67,9 +67,6 @@ namespace MWGui /// returns true if their are no journal entries to display virtual bool isEmpty () const = 0; - /// provides access to the name of the quest with the specified identifier - virtual void visitQuestName (TopicId topicId, boost::function visitor) const = 0; - /// walks the active and optionally completed, quests providing the name virtual void visitQuestNames (bool active_only, boost::function visitor) const = 0; diff --git a/apps/openmw/mwgui/journalwindow.cpp b/apps/openmw/mwgui/journalwindow.cpp index 6cf8bb003..4139a7d24 100644 --- a/apps/openmw/mwgui/journalwindow.cpp +++ b/apps/openmw/mwgui/journalwindow.cpp @@ -393,18 +393,6 @@ namespace popBook (); } - void showList (char const * listId, char const * pageId, Book book) - { - std::pair size = book->getSize (); - - getPage (pageId)->showPage (book, 0); - - // Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the scrollbar is hidden - getWidget (listId)->setVisibleVScroll(false); - getWidget (listId)->setCanvasSize (size.first, size.second); - getWidget (listId)->setVisibleVScroll(true); - } - void notifyIndexLinkClicked (MWGui::TypesetBook::InteractiveId character) { setVisible (LeftTopicIndex, false); diff --git a/apps/openmw/mwgui/levelupdialog.cpp b/apps/openmw/mwgui/levelupdialog.cpp index 7188ab9df..56a231947 100644 --- a/apps/openmw/mwgui/levelupdialog.cpp +++ b/apps/openmw/mwgui/levelupdialog.cpp @@ -140,7 +140,7 @@ namespace MWGui // Vanilla uses thief.dds for custom classes. // Choosing Stealth specialization and Speed/Agility as attributes, if possible. Otherwise fall back to first class found. MWWorld::SharedIterator it = world->getStore().get().begin(); - for(; it != world->getStore().get().end(); it++) + for(; it != world->getStore().get().end(); ++it) { if(it->mData.mIsPlayable && it->mData.mSpecialization == 2 && it->mData.mAttribute[0] == 4 && it->mData.mAttribute[1] == 3) break; diff --git a/apps/openmw/mwgui/messagebox.cpp b/apps/openmw/mwgui/messagebox.cpp index 09074d8f0..80f38ba40 100644 --- a/apps/openmw/mwgui/messagebox.cpp +++ b/apps/openmw/mwgui/messagebox.cpp @@ -139,11 +139,6 @@ namespace MWGui return false; } - void MessageBoxManager::setMessageBoxSpeed (int speed) - { - mMessageBoxSpeed = speed; - } - int MessageBoxManager::readPressedButton () { int pressed = mLastButtonPressed; @@ -218,7 +213,6 @@ namespace MWGui MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize(); int biggestButtonWidth = 0; - int buttonWidth = 0; int buttonsWidth = 0; int buttonsHeight = 0; int buttonHeight = 0; @@ -241,7 +235,7 @@ namespace MWGui if (buttonsWidth != 0) buttonsWidth += buttonLeftPadding; - buttonWidth = button->getTextSize().width + 2*buttonPadding; + int buttonWidth = button->getTextSize().width + 2*buttonPadding; buttonsWidth += buttonWidth; buttonHeight = button->getTextSize().height + 2*buttonPadding; diff --git a/apps/openmw/mwgui/messagebox.hpp b/apps/openmw/mwgui/messagebox.hpp index 406d98c48..5f180df20 100644 --- a/apps/openmw/mwgui/messagebox.hpp +++ b/apps/openmw/mwgui/messagebox.hpp @@ -34,7 +34,6 @@ namespace MWGui void clear(); bool removeMessageBox (MessageBox *msgbox); - void setMessageBoxSpeed (int speed); int readPressedButton (); diff --git a/apps/openmw/mwgui/race.cpp b/apps/openmw/mwgui/race.cpp index a51250c9d..e3bec3789 100644 --- a/apps/openmw/mwgui/race.cpp +++ b/apps/openmw/mwgui/race.cpp @@ -393,7 +393,6 @@ namespace MWGui if (mCurrentRaceId.empty()) return; - Widgets::MWSpellPtr spellPowerWidget; const int lineHeight = 18; MyGUI::IntCoord coord(0, 0, mSpellPowerList->getWidth(), 18); @@ -405,7 +404,7 @@ namespace MWGui for (int i = 0; it != end; ++it) { const std::string &spellpower = *it; - spellPowerWidget = mSpellPowerList->createWidget("MW_StatName", coord, MyGUI::Align::Default, std::string("SpellPower") + boost::lexical_cast(i)); + Widgets::MWSpellPtr spellPowerWidget = mSpellPowerList->createWidget("MW_StatName", coord, MyGUI::Align::Default, std::string("SpellPower") + boost::lexical_cast(i)); spellPowerWidget->setSpellId(spellpower); spellPowerWidget->setUserString("ToolTipType", "Spell"); spellPowerWidget->setUserString("Spell", spellpower); diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index 71cf7fdb3..74def66e3 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -362,8 +362,7 @@ namespace MWGui void SettingsWindow::onShaderModeToggled(MyGUI::Widget* _sender) { - std::string val = _sender->castType()->getCaption(); - val = hlslGlsl(); + std::string val = hlslGlsl(); _sender->castType()->setCaption(val); diff --git a/apps/openmw/mwgui/spellcreationdialog.cpp b/apps/openmw/mwgui/spellcreationdialog.cpp index cdab79af1..1116d6543 100644 --- a/apps/openmw/mwgui/spellcreationdialog.cpp +++ b/apps/openmw/mwgui/spellcreationdialog.cpp @@ -39,6 +39,7 @@ namespace MWGui EditEffectDialog::EditEffectDialog() : WindowModal("openmw_edit_effect.layout") , mEditing(false) + , mMagicEffect(NULL) { getWidget(mCancelButton, "CancelButton"); getWidget(mOkButton, "OkButton"); @@ -181,7 +182,7 @@ namespace MWGui { mAreaBox->setPosition(mAreaBox->getPosition().left, curY); mAreaBox->setVisible (true); - curY += mAreaBox->getSize().height; + //curY += mAreaBox->getSize().height; } } diff --git a/apps/openmw/mwgui/spellcreationdialog.hpp b/apps/openmw/mwgui/spellcreationdialog.hpp index e77c0eecf..ecccf3baf 100644 --- a/apps/openmw/mwgui/spellcreationdialog.hpp +++ b/apps/openmw/mwgui/spellcreationdialog.hpp @@ -158,8 +158,6 @@ namespace MWGui MyGUI::Button* mCancelButton; MyGUI::TextBox* mPriceLabel; - Widgets::MWEffectList* mUsedEffectsList; - ESM::Spell mSpell; }; diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp index 6059d2d0d..d7bc2c96e 100644 --- a/apps/openmw/mwgui/widgets.cpp +++ b/apps/openmw/mwgui/widgets.cpp @@ -225,11 +225,10 @@ namespace MWGui const ESM::Spell *spell = store.get().search(mId); MYGUI_ASSERT(spell, "spell with id '" << mId << "' not found"); - MWSpellEffectPtr effect = NULL; std::vector::const_iterator end = spell->mEffects.mList.end(); for (std::vector::const_iterator it = spell->mEffects.mList.begin(); it != end; ++it) { - effect = creator->createWidget("MW_EffectImage", coord, MyGUI::Align::Default); + MWSpellEffectPtr effect = creator->createWidget("MW_EffectImage", coord, MyGUI::Align::Default); SpellEffectParams params; params.mEffectID = it->mEffectID; params.mSkill = it->mSkill; @@ -565,22 +564,6 @@ namespace MWGui } } - void MWScrollBar::setEnableRepeat(bool enable) - { - mEnableRepeat = enable; - } - - bool MWScrollBar::getEnableRepeat() - { - return mEnableRepeat; - } - - void MWScrollBar::getRepeat(float &trigger, float &step) - { - trigger = mRepeatTriggerTime; - step = mRepeatStepTime; - } - void MWScrollBar::setRepeat(float trigger, float step) { mRepeatTriggerTime = trigger; diff --git a/apps/openmw/mwgui/widgets.hpp b/apps/openmw/mwgui/widgets.hpp index fff7bdbfc..aae28a686 100644 --- a/apps/openmw/mwgui/widgets.hpp +++ b/apps/openmw/mwgui/widgets.hpp @@ -307,9 +307,6 @@ namespace MWGui MWScrollBar(); virtual ~MWScrollBar(); - void setEnableRepeat(bool enable); - bool getEnableRepeat(); - void getRepeat(float &trigger, float &step); void setRepeat(float trigger, float step); protected: diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index ef7622a62..fabdf4dae 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -1348,12 +1348,6 @@ namespace MWGui return mSubtitlesEnabled; } - void WindowManager::toggleHud () - { - mHudEnabled = !mHudEnabled; - mHud->setVisible (mHudEnabled); - } - bool WindowManager::toggleGui() { mGuiEnabled = !mGuiEnabled; @@ -1669,7 +1663,7 @@ namespace MWGui WindowModal* WindowManager::getCurrentModal() const { - if(mCurrentModals.size() > 0) + if(!mCurrentModals.empty()) return mCurrentModals.top(); else return NULL; @@ -1679,7 +1673,7 @@ namespace MWGui { // Only remove the top if it matches the current pointer. A lot of things hide their visibility before showing it, //so just popping the top would cause massive issues. - if(mCurrentModals.size() > 0) + if(!mCurrentModals.empty()) if(input == mCurrentModals.top()) mCurrentModals.pop(); } diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index 21a2cc45b..e7853b84f 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -222,7 +222,6 @@ namespace MWGui virtual void showCrosshair(bool show); virtual bool getSubtitlesEnabled(); - virtual void toggleHud(); /// Turn visibility of *all* GUI elements on or off (HUD and all windows, except the console) virtual bool toggleGui(); diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index fb387afea..e55ccba17 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1232,14 +1232,14 @@ namespace MWMechanics } static float sneakTimer = 0.f; // times update of sneak icon - static float sneakSkillTimer = 0.f; // times sneak skill progress from "avoid notice" // if player is in sneak state see if anyone detects him if (player.getClass().getCreatureStats(player).getMovementFlag(MWMechanics::CreatureStats::Flag_Sneak)) { + static float sneakSkillTimer = 0.f; // times sneak skill progress from "avoid notice" + const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore(); const int radius = esmStore.get().find("fSneakUseDist")->getInt(); - bool detected = false; static float fSneakUseDelay = esmStore.get().find("fSneakUseDelay")->getFloat(); @@ -1251,6 +1251,8 @@ namespace MWMechanics // Set when an NPC is within line of sight and distance, but is still unaware. Used for skill progress. bool avoidedNotice = false; + bool detected = false; + for (PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter) { if (iter->first == player) // not the player @@ -1418,7 +1420,7 @@ namespace MWMechanics std::list Actors::getActorsFollowing(const MWWorld::Ptr& actor) { std::list list; - for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();iter++) + for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter) { const MWWorld::Class &cls = iter->first.getClass(); CreatureStats &stats = cls.getCreatureStats(iter->first); @@ -1450,7 +1452,7 @@ namespace MWMechanics getObjectsInRange(position, MWBase::Environment::get().getWorld()->getStore().get().find("fAlarmRadius")->getFloat(), neighbors); //only care about those within the alarm disance - for(std::vector::iterator iter(neighbors.begin());iter != neighbors.end();iter++) + for(std::vector::iterator iter(neighbors.begin());iter != neighbors.end();++iter) { const MWWorld::Class &cls = iter->getClass(); CreatureStats &stats = cls.getCreatureStats(*iter); diff --git a/apps/openmw/mwmechanics/aiactivate.hpp b/apps/openmw/mwmechanics/aiactivate.hpp index 8003c2a36..2a0f67709 100644 --- a/apps/openmw/mwmechanics/aiactivate.hpp +++ b/apps/openmw/mwmechanics/aiactivate.hpp @@ -35,8 +35,6 @@ namespace MWMechanics private: std::string mObjectId; - int mCellX; - int mCellY; }; } #endif // GAME_MWMECHANICS_AIACTIVATE_H diff --git a/apps/openmw/mwmechanics/aiavoiddoor.cpp b/apps/openmw/mwmechanics/aiavoiddoor.cpp index eea1b4850..7cb4f1c25 100644 --- a/apps/openmw/mwmechanics/aiavoiddoor.cpp +++ b/apps/openmw/mwmechanics/aiavoiddoor.cpp @@ -64,7 +64,7 @@ bool MWMechanics::AiAvoidDoor::execute (const MWWorld::Ptr& actor,float duration // Make all nearby actors also avoid the door std::vector actors; MWBase::Environment::get().getMechanicsManager()->getActorsInRange(Ogre::Vector3(pos.pos[0],pos.pos[1],pos.pos[2]),100,actors); - for(std::vector::iterator it = actors.begin(); it != actors.end(); it++) { + for(std::vector::iterator it = actors.begin(); it != actors.end(); ++it) { if(*it != MWBase::Environment::get().getWorld()->getPlayerPtr()) { //Not the player MWMechanics::AiSequence& seq = it->getClass().getCreatureStats(*it).getAiSequence(); if(seq.getTypeId() != MWMechanics::AiPackage::TypeIdAvoidDoor) { //Only add it once diff --git a/apps/openmw/mwmechanics/aicombataction.cpp b/apps/openmw/mwmechanics/aicombataction.cpp index 67afad7a5..152854af9 100644 --- a/apps/openmw/mwmechanics/aicombataction.cpp +++ b/apps/openmw/mwmechanics/aicombataction.cpp @@ -301,18 +301,20 @@ namespace MWMechanics if (!target.isEmpty() && target.getClass().getCreatureStats(target).getAttribute(effect.mAttribute).getModified() <= 0) return 0.f; { - const float attributePriorities[ESM::Attribute::Length] = { - 1.f, // Strength - 0.5, // Intelligence - 0.6, // Willpower - 0.7, // Agility - 0.5, // Speed - 0.8, // Endurance - 0.7, // Personality - 0.3 // Luck - }; if (effect.mAttribute >= 0 && effect.mAttribute < ESM::Attribute::Length) + { + const float attributePriorities[ESM::Attribute::Length] = { + 1.f, // Strength + 0.5, // Intelligence + 0.6, // Willpower + 0.7, // Agility + 0.5, // Speed + 0.8, // Endurance + 0.7, // Personality + 0.3 // Luck + }; rating *= attributePriorities[effect.mAttribute]; + } } break; diff --git a/apps/openmw/mwmechanics/aiescort.cpp b/apps/openmw/mwmechanics/aiescort.cpp index 02ad2d0a2..98fc64090 100644 --- a/apps/openmw/mwmechanics/aiescort.cpp +++ b/apps/openmw/mwmechanics/aiescort.cpp @@ -54,6 +54,7 @@ namespace MWMechanics , mCellY(std::numeric_limits::max()) , mCellId(escort->mCellId) , mRemainingDuration(escort->mRemainingDuration) + , mMaxDist(450) { } diff --git a/apps/openmw/mwmechanics/aipackage.hpp b/apps/openmw/mwmechanics/aipackage.hpp index 0a5e1c545..ff3e84b98 100644 --- a/apps/openmw/mwmechanics/aipackage.hpp +++ b/apps/openmw/mwmechanics/aipackage.hpp @@ -69,7 +69,6 @@ namespace MWMechanics PathFinder mPathFinder; ObstacleCheck mObstacleCheck; - float mDoorCheckDuration; float mTimer; float mStuckTimer; diff --git a/apps/openmw/mwmechanics/aipursue.hpp b/apps/openmw/mwmechanics/aipursue.hpp index 18a22b676..a6eef2984 100644 --- a/apps/openmw/mwmechanics/aipursue.hpp +++ b/apps/openmw/mwmechanics/aipursue.hpp @@ -41,8 +41,6 @@ namespace MWMechanics private: int mTargetActorId; // The actor to pursue - int mCellX; - int mCellY; }; } #endif diff --git a/apps/openmw/mwmechanics/aisequence.cpp b/apps/openmw/mwmechanics/aisequence.cpp index f15b357e5..0341c9745 100644 --- a/apps/openmw/mwmechanics/aisequence.cpp +++ b/apps/openmw/mwmechanics/aisequence.cpp @@ -31,9 +31,11 @@ void AiSequence::copy (const AiSequence& sequence) AiSequence::AiSequence() : mDone (false), mLastAiPackage(-1) {} -AiSequence::AiSequence (const AiSequence& sequence) : mDone (false) +AiSequence::AiSequence (const AiSequence& sequence) { copy (sequence); + mDone = sequence.mDone; + mLastAiPackage = sequence.mLastAiPackage; } AiSequence& AiSequence::operator= (const AiSequence& sequence) @@ -43,6 +45,7 @@ AiSequence& AiSequence::operator= (const AiSequence& sequence) clear(); copy (sequence); mDone = sequence.mDone; + mLastAiPackage = sequence.mLastAiPackage; } return *this; @@ -120,33 +123,6 @@ bool AiSequence::isInCombat(const MWWorld::Ptr &actor) const return false; } -bool AiSequence::canAddTarget(const ESM::Position& actorPos, float distToTarget) const -{ - bool firstCombatFound = false; - MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); - - for(std::list::const_iterator it = mPackages.begin(); it != mPackages.end(); ++it) - { - if ((*it)->getTypeId() == AiPackage::TypeIdCombat) - { - firstCombatFound = true; - - const AiCombat *combat = static_cast(*it); - if (combat->getTarget() != player ) return false; // only 1 non-player target allowed - else - { - // add new target only if current target (player) is farther - const ESM::Position &targetPos = combat->getTarget().getRefData().getPosition(); - - float distToCurrTarget = (Ogre::Vector3(targetPos.pos) - Ogre::Vector3(actorPos.pos)).length(); - return (distToCurrTarget > distToTarget); - } - } - else if (firstCombatFound) break; // assumes combat packages go one-by-one in packages list - } - return true; -} - void AiSequence::stopCombat() { while (getTypeId() == AiPackage::TypeIdCombat) @@ -295,11 +271,6 @@ void AiSequence::stack (const AiPackage& package, const MWWorld::Ptr& actor) mPackages.push_front (package.clone()); } -void AiSequence::queue (const AiPackage& package) -{ - mPackages.push_back (package.clone()); -} - AiPackage* MWMechanics::AiSequence::getActivePackage() { if(mPackages.empty()) diff --git a/apps/openmw/mwmechanics/aisequence.hpp b/apps/openmw/mwmechanics/aisequence.hpp index c7d176661..56f5dee31 100644 --- a/apps/openmw/mwmechanics/aisequence.hpp +++ b/apps/openmw/mwmechanics/aisequence.hpp @@ -98,10 +98,6 @@ namespace MWMechanics @param actor The actor that owns this AiSequence **/ void stack (const AiPackage& package, const MWWorld::Ptr& actor); - /// Add \a package to the end of the sequence - /** Executed after all other packages have been completed **/ - void queue (const AiPackage& package); - /// Return the current active package. /** If there is no active package, it will throw an exception **/ AiPackage* getActivePackage(); diff --git a/apps/openmw/mwmechanics/aiwander.cpp b/apps/openmw/mwmechanics/aiwander.cpp index eafbdd59c..aee3e654d 100644 --- a/apps/openmw/mwmechanics/aiwander.cpp +++ b/apps/openmw/mwmechanics/aiwander.cpp @@ -686,16 +686,15 @@ namespace MWMechanics } AiWander::AiWander (const ESM::AiSequence::AiWander* wander) + : mDistance(wander->mData.mDistance) + , mDuration(wander->mData.mDuration) + , mStartTime(MWWorld::TimeStamp(wander->mStartTime)) + , mTimeOfDay(wander->mData.mTimeOfDay) + , mRepeat(wander->mData.mShouldRepeat) { - mDistance = wander->mData.mDistance; - mDuration = wander->mData.mDuration; - mStartTime = MWWorld::TimeStamp(wander->mStartTime); - mTimeOfDay = wander->mData.mTimeOfDay; for (int i=0; i<8; ++i) mIdle.push_back(wander->mData.mIdle[i]); - mRepeat = wander->mData.mShouldRepeat; - init(); } } diff --git a/apps/openmw/mwmechanics/alchemy.cpp b/apps/openmw/mwmechanics/alchemy.cpp index 5b81dff61..24e7b5aa1 100644 --- a/apps/openmw/mwmechanics/alchemy.cpp +++ b/apps/openmw/mwmechanics/alchemy.cpp @@ -27,6 +27,11 @@ #include "creaturestats.hpp" #include "npcstats.hpp" +MWMechanics::Alchemy::Alchemy() + : mValue(0) +{ +} + std::set MWMechanics::Alchemy::listEffects() const { std::map effects; diff --git a/apps/openmw/mwmechanics/alchemy.hpp b/apps/openmw/mwmechanics/alchemy.hpp index 91e024574..a2429ca8e 100644 --- a/apps/openmw/mwmechanics/alchemy.hpp +++ b/apps/openmw/mwmechanics/alchemy.hpp @@ -22,6 +22,8 @@ namespace MWMechanics { public: + Alchemy(); + typedef std::vector TToolsContainer; typedef TToolsContainer::const_iterator TToolsIterator; diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index 657cbf92e..f48e82324 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -193,13 +193,11 @@ namespace MWMechanics return; } - float damage = 0.0f; - float fDamageStrengthBase = gmst.find("fDamageStrengthBase")->getFloat(); float fDamageStrengthMult = gmst.find("fDamageStrengthMult")->getFloat(); const unsigned char* attack = weapon.get()->mBase->mData.mChop; - damage = attack[0] + ((attack[1]-attack[0])*attackerStats.getAttackStrength()); // Bow/crossbow damage + float damage = attack[0] + ((attack[1]-attack[0])*attackerStats.getAttackStrength()); // Bow/crossbow damage if (weapon != projectile) { // Arrow/bolt damage diff --git a/apps/openmw/mwmechanics/creaturestats.cpp b/apps/openmw/mwmechanics/creaturestats.cpp index 8020db85b..c4d316ad6 100644 --- a/apps/openmw/mwmechanics/creaturestats.cpp +++ b/apps/openmw/mwmechanics/creaturestats.cpp @@ -120,11 +120,6 @@ namespace MWMechanics return mSpells; } - void CreatureStats::setSpells(const Spells &spells) - { - mSpells = spells; - } - ActiveSpells &CreatureStats::getActiveSpells() { return mActiveSpells; @@ -200,11 +195,6 @@ namespace MWMechanics mLevel = level; } - void CreatureStats::setActiveSpells(const ActiveSpells &active) - { - mActiveSpells = active; - } - void CreatureStats::modifyMagicEffects(const MagicEffects &effects) { if (effects.get(ESM::MagicEffect::FortifyMaximumMagicka).getModifier() @@ -536,7 +526,6 @@ namespace MWMechanics mLastRestock = MWWorld::TimeStamp(state.mTradeTime); mGoldPool = state.mGoldPool; - mFallHeight = state.mFallHeight; mDead = state.mDead; mDied = state.mDied; diff --git a/apps/openmw/mwmechanics/creaturestats.hpp b/apps/openmw/mwmechanics/creaturestats.hpp index 941668fb2..5e169ffb0 100644 --- a/apps/openmw/mwmechanics/creaturestats.hpp +++ b/apps/openmw/mwmechanics/creaturestats.hpp @@ -40,7 +40,6 @@ namespace MWMechanics bool mTalkedTo; bool mAlarmed; bool mAttacked; - bool mHostile; bool mAttackingOrSpell; bool mKnockdown; bool mKnockdownOneFrame; @@ -138,10 +137,6 @@ namespace MWMechanics void setDynamic (int index, const DynamicStat &value); - void setSpells(const Spells &spells); - - void setActiveSpells(const ActiveSpells &active); - /// Set Modifier for each magic effect according to \a effects. Does not touch Base values. void modifyMagicEffects(const MagicEffects &effects); diff --git a/apps/openmw/mwmechanics/enchanting.cpp b/apps/openmw/mwmechanics/enchanting.cpp index 9663a2d51..63ffbc7e8 100644 --- a/apps/openmw/mwmechanics/enchanting.cpp +++ b/apps/openmw/mwmechanics/enchanting.cpp @@ -166,16 +166,15 @@ namespace MWMechanics float enchantmentCost = 0; int effectsLeftCnt = mEffects.size(); - float baseCost, magnitudeCost, areaCost; - int magMin, magMax, area; for (std::vector::const_iterator it = mEffects.begin(); it != mEffects.end(); ++it) { - baseCost = (store.get().find(it->mEffectID))->mData.mBaseCost; + float baseCost = (store.get().find(it->mEffectID))->mData.mBaseCost; // To reflect vanilla behavior - magMin = (it->mMagnMin == 0) ? 1 : it->mMagnMin; - magMax = (it->mMagnMax == 0) ? 1 : it->mMagnMax; - area = (it->mArea == 0) ? 1 : it->mArea; + int magMin = (it->mMagnMin == 0) ? 1 : it->mMagnMin; + int magMax = (it->mMagnMax == 0) ? 1 : it->mMagnMax; + int area = (it->mArea == 0) ? 1 : it->mArea; + float magnitudeCost = 0; if (mCastStyle == ESM::Enchantment::ConstantEffect) { magnitudeCost = (magMin + magMax) * baseCost * 2.5; @@ -187,7 +186,7 @@ namespace MWMechanics magnitudeCost *= 1.5; } - areaCost = area * 0.025 * baseCost; + float areaCost = area * 0.025 * baseCost; if (it->mRange == ESM::RT_Target) areaCost *= 1.5; diff --git a/apps/openmw/mwmechanics/pathfinding.cpp b/apps/openmw/mwmechanics/pathfinding.cpp index 62c1756c2..62e23db58 100644 --- a/apps/openmw/mwmechanics/pathfinding.cpp +++ b/apps/openmw/mwmechanics/pathfinding.cpp @@ -283,13 +283,6 @@ namespace MWMechanics return Ogre::Radian(Ogre::Math::ACos(directionY / directionResult) * sgn(Ogre::Math::ASin(directionX / directionResult))).valueDegrees(); } - // Used by AiCombat, use Euclidean distance - float PathFinder::getDistToNext(float x, float y, float z) - { - ESM::Pathgrid::Point nextPoint = *mPath.begin(); - return distance(nextPoint, x, y, z); - } - bool PathFinder::checkWaypoint(float x, float y, float z) { if(mPath.empty()) diff --git a/apps/openmw/mwmechanics/pathfinding.hpp b/apps/openmw/mwmechanics/pathfinding.hpp index 603a04f8c..482808dac 100644 --- a/apps/openmw/mwmechanics/pathfinding.hpp +++ b/apps/openmw/mwmechanics/pathfinding.hpp @@ -47,8 +47,6 @@ namespace MWMechanics float getZAngleToNext(float x, float y) const; - float getDistToNext(float x, float y, float z); - bool isPathConstructed() const { return mIsPathConstructed; diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index e4ee1cbe6..12ba3c2da 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -521,7 +521,7 @@ float Animation::getVelocity(const std::string &groupname) const { /* Look in reverse; last-inserted source has priority. */ AnimSourceList::const_reverse_iterator animsrc(mAnimSources.rbegin()); - for(;animsrc != mAnimSources.rend();animsrc++) + for(;animsrc != mAnimSources.rend();++animsrc) { const NifOgre::TextKeyMap &keys = (*animsrc)->mTextKeys; if(findGroupStart(keys, groupname) != keys.end()) @@ -831,8 +831,7 @@ void Animation::handleTextKey(AnimState &state, const std::string &groupname, co void Animation::changeGroups(const std::string &groupname, int groups) { - AnimStateMap::iterator stateiter = mStates.begin(); - stateiter = mStates.find(groupname); + AnimStateMap::iterator stateiter = mStates.find(groupname); if(stateiter != mStates.end()) { if(stateiter->second.mGroups != groups) diff --git a/apps/openmw/mwrender/camera.cpp b/apps/openmw/mwrender/camera.cpp index f38e00cce..bb196f282 100644 --- a/apps/openmw/mwrender/camera.cpp +++ b/apps/openmw/mwrender/camera.cpp @@ -26,7 +26,6 @@ namespace MWRender mNearest(30.f), mFurthest(800.f), mIsNearest(false), - mIsFurthest(false), mHeight(128.f), mCameraDistance(300.f), mDistanceAdjusted(false), @@ -292,7 +291,6 @@ namespace MWRender if(mFirstPersonView && !mPreviewMode && !mVanity.enabled) return; - mIsFurthest = false; mIsNearest = false; Ogre::Vector3 v(0.f, 0.f, dist); @@ -301,7 +299,6 @@ namespace MWRender } if (v.z >= mFurthest) { v.z = mFurthest; - mIsFurthest = true; } else if (!override && v.z < 10.f) { v.z = 10.f; } else if (override && v.z <= mNearest) { @@ -389,9 +386,4 @@ namespace MWRender { return mIsNearest; } - - bool Camera::isFurthest() - { - return mIsFurthest; - } } diff --git a/apps/openmw/mwrender/camera.hpp b/apps/openmw/mwrender/camera.hpp index 1e86bfb48..f7b0ae6e8 100644 --- a/apps/openmw/mwrender/camera.hpp +++ b/apps/openmw/mwrender/camera.hpp @@ -36,7 +36,6 @@ namespace MWRender float mNearest; float mFurthest; bool mIsNearest; - bool mIsFurthest; struct { bool enabled, allowed; @@ -118,8 +117,6 @@ namespace MWRender bool isVanityOrPreviewModeEnabled(); bool isNearest(); - - bool isFurthest(); }; } diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 1af11996e..1630e4005 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -281,9 +281,9 @@ namespace MWRender RaceSelectionPreview::RaceSelectionPreview() : CharacterPreview(MWBase::Environment::get().getWorld()->getPlayerPtr(), 512, 512, "CharacterHeadPreview", Ogre::Vector3(0, 6, -35), Ogre::Vector3(0,125,0)) + , mBase (*mCharacter.get()->mBase) , mRef(&mBase) { - mBase = *mCharacter.get()->mBase; mCharacter = MWWorld::Ptr(&mRef, NULL); } diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp index e4806072a..247a0ba14 100644 --- a/apps/openmw/mwrender/creatureanimation.cpp +++ b/apps/openmw/mwrender/creatureanimation.cpp @@ -150,7 +150,7 @@ void CreatureWeaponAnimation::updatePart(NifOgre::ObjectScenePtr& scene, int slo } std::vector >::iterator ctrl(scene->mControllers.begin()); - for(;ctrl != scene->mControllers.end();ctrl++) + for(;ctrl != scene->mControllers.end();++ctrl) { if(ctrl->getSource().isNull()) { diff --git a/apps/openmw/mwrender/globalmap.cpp b/apps/openmw/mwrender/globalmap.cpp index 4e0bd00f9..fd8b91936 100644 --- a/apps/openmw/mwrender/globalmap.cpp +++ b/apps/openmw/mwrender/globalmap.cpp @@ -106,13 +106,13 @@ namespace MWRender if (land) { const float landHeight = land->mLandData->mHeights[vertexY * ESM::Land::LAND_SIZE + vertexX]; - const float mountainHeight = 15000.f; - const float hillHeight = 2500.f; if (landHeight >= 0) { + const float hillHeight = 2500.f; if (landHeight >= hillHeight) { + const float mountainHeight = 15000.f; float factor = std::min(1.f, float(landHeight-hillHeight)/mountainHeight); r = (hillColour.r * (1-factor) + mountainColour.r * factor) * 255; g = (hillColour.g * (1-factor) + mountainColour.g * factor) * 255; diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 303917c95..9e93bd314 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -410,15 +410,18 @@ void NpcAnimation::updateParts() // Remember body parts so we only have to search through the store once for each race/gender/viewmode combination static std::map< std::pair,std::vector > sRaceMapping; - static const int Flag_Female = 1<<0; - static const int Flag_FirstPerson = 1<<1; - bool isWerewolf = (mNpcType == Type_Werewolf); int flags = (isWerewolf ? -1 : 0); if(!mNpc->isMale()) + { + static const int Flag_Female = 1<<0; flags |= Flag_Female; + } if(mViewMode == VM_FirstPerson) + { + static const int Flag_FirstPerson = 1<<1; flags |= Flag_FirstPerson; + } std::string race = (isWerewolf ? "werewolf" : Misc::StringUtils::lowerCase(mNpc->mRace)); std::pair thisCombination = std::make_pair(race, flags); @@ -604,7 +607,7 @@ Ogre::Vector3 NpcAnimation::runAnimation(float timepassed) if (mObjectParts[i].isNull()) continue; std::vector >::iterator ctrl(mObjectParts[i]->mControllers.begin()); - for(;ctrl != mObjectParts[i]->mControllers.end();ctrl++) + for(;ctrl != mObjectParts[i]->mControllers.end();++ctrl) ctrl->update(); Ogre::Entity *ent = mObjectParts[i]->mSkelBase; @@ -678,7 +681,7 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g } std::vector >::iterator ctrl(mObjectParts[type]->mControllers.begin()); - for(;ctrl != mObjectParts[type]->mControllers.end();ctrl++) + for(;ctrl != mObjectParts[type]->mControllers.end();++ctrl) { if(ctrl->getSource().isNull()) { @@ -715,7 +718,7 @@ void NpcAnimation::addPartGroup(int group, int priority, const std::vector::const_iterator part(parts.begin()); - for(;part != parts.end();part++) + for(;part != parts.end();++part) { const ESM::BodyPart *bodypart = 0; if(!mNpc->isMale() && !part->mFemale.empty()) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index ef5418159..4512bbbeb 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -574,24 +574,6 @@ void RenderingManager::configureAmbient(MWWorld::CellStore &mCell) sunEnable(false); } } -// Switch through lighting modes. - -void RenderingManager::toggleLight() -{ - if (mAmbientMode==2) - mAmbientMode = 0; - else - ++mAmbientMode; - - switch (mAmbientMode) - { - case 0: std::cout << "Setting lights to normal\n"; break; - case 1: std::cout << "Turning the lights up\n"; break; - case 2: std::cout << "Turning the lights to full\n"; break; - } - - setAmbientMode(); -} void RenderingManager::setSunColour(const Ogre::ColourValue& colour) { @@ -695,11 +677,6 @@ void RenderingManager::enableLights(bool sun) sunEnable(sun); } -Shadows* RenderingManager::getShadows() -{ - return mShadows; -} - void RenderingManager::notifyWorldSpaceChanged() { mEffectManager->clear(); diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index c5a77afc7..43d22d5ca 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -93,7 +93,6 @@ public: MWRender::Camera* getCamera() const; - void toggleLight(); bool toggleRenderMode(int mode); void removeCell (MWWorld::CellStore *store); @@ -157,8 +156,6 @@ public: float getTerrainHeightAt (Ogre::Vector3 worldPos); - Shadows* getShadows(); - void notifyWorldSpaceChanged(); void getTriangleBatchCount(unsigned int &triangles, unsigned int &batches); diff --git a/apps/openmw/mwrender/ripplesimulation.hpp b/apps/openmw/mwrender/ripplesimulation.hpp index 7e7eebc1c..e203212cf 100644 --- a/apps/openmw/mwrender/ripplesimulation.hpp +++ b/apps/openmw/mwrender/ripplesimulation.hpp @@ -41,6 +41,9 @@ public: void updateEmitterPtr (const MWWorld::Ptr& old, const MWWorld::Ptr& ptr); private: + RippleSimulation(const RippleSimulation&); + RippleSimulation& operator=(const RippleSimulation&); + std::vector mEmitters; Ogre::RenderTexture* mRenderTargets[4]; diff --git a/apps/openmw/mwrender/shadows.cpp b/apps/openmw/mwrender/shadows.cpp index 33e337649..596c6697a 100644 --- a/apps/openmw/mwrender/shadows.cpp +++ b/apps/openmw/mwrender/shadows.cpp @@ -186,13 +186,3 @@ PSSMShadowCameraSetup* Shadows::getPSSMSetup() { return mPSSMSetup; } - -float Shadows::getShadowFar() const -{ - return mShadowFar; -} - -float Shadows::getFadeStart() const -{ - return mFadeStart; -} diff --git a/apps/openmw/mwrender/shadows.hpp b/apps/openmw/mwrender/shadows.hpp index bc2b141f7..fe125f54c 100644 --- a/apps/openmw/mwrender/shadows.hpp +++ b/apps/openmw/mwrender/shadows.hpp @@ -23,8 +23,6 @@ namespace MWRender void recreate(); Ogre::PSSMShadowCameraSetup* getPSSMSetup(); - float getShadowFar() const; - float getFadeStart() const; protected: OEngine::Render::OgreRenderer* mRendering; diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 229bf92e7..4620173b5 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -188,11 +188,6 @@ void Moon::setPhase(const Moon::Phase& phase) mPhase = phase; } -Moon::Phase Moon::getPhase() const -{ - return mPhase; -} - unsigned int Moon::getPhaseInt() const { if (mPhase == Moon::Phase_New) return 0; @@ -418,7 +413,6 @@ void SkyManager::updateRain(float dt) // Spawn new rain float rainFrequency = mRainFrequency; - float startHeight = 700; if (mRainEnabled) { mRainTimer += dt; @@ -434,6 +428,7 @@ void SkyManager::updateRain(float dt) // Create a separate node to control the offset, since a node with setInheritOrientation(false) will still // consider the orientation of the parent node for its position, just not for its orientation + float startHeight = 700; Ogre::SceneNode* offsetNode = sceneNode->createChildSceneNode(Ogre::Vector3(xOffs,yOffs,startHeight)); NifOgre::ObjectScenePtr objects = NifOgre::Loader::createObjects(offsetNode, mRainEffect); @@ -752,16 +747,6 @@ void SkyManager::setLightningStrength(const float factor) else mLightning->setVisible(false); } -void SkyManager::setLightningEnabled(bool enabled) -{ - /// \todo -} - -void SkyManager::setLightningDirection(const Ogre::Vector3& dir) -{ - if (!mCreated) return; - mLightning->setDirection (dir); -} void SkyManager::setMasserFade(const float fade) { diff --git a/apps/openmw/mwrender/sky.hpp b/apps/openmw/mwrender/sky.hpp index 7c31150f3..e40eb1dce 100644 --- a/apps/openmw/mwrender/sky.hpp +++ b/apps/openmw/mwrender/sky.hpp @@ -103,7 +103,6 @@ namespace MWRender void setPhase(const Phase& phase); void setType(const Type& type); - Phase getPhase() const; unsigned int getPhaseInt() const; private: @@ -169,8 +168,6 @@ namespace MWRender void secundaDisable(); void setLightningStrength(const float factor); - void setLightningDirection(const Ogre::Vector3& dir); - void setLightningEnabled(bool enabled); ///< disable prior to map render void setGlare(const float glare); void setGlareEnabled(bool enabled); diff --git a/apps/openmw/mwrender/videoplayer.cpp b/apps/openmw/mwrender/videoplayer.cpp index ed9ed3f2a..072653898 100644 --- a/apps/openmw/mwrender/videoplayer.cpp +++ b/apps/openmw/mwrender/videoplayer.cpp @@ -864,7 +864,6 @@ void VideoState::video_thread_loop(VideoState *self) AVPacket pkt1, *packet = &pkt1; int frameFinished; AVFrame *pFrame; - double pts; pFrame = av_frame_alloc(); @@ -879,7 +878,7 @@ void VideoState::video_thread_loop(VideoState *self) if(avcodec_decode_video2((*self->video_st)->codec, pFrame, &frameFinished, packet) < 0) throw std::runtime_error("Error decoding video frame"); - pts = 0; + double pts = 0; if(IS_NOTEQ_NOPTS_VAL(packet->dts)) pts = packet->dts; else if(pFrame->opaque && IS_NOTEQ_NOPTS_VAL_PTR(pFrame->opaque)) @@ -1232,11 +1231,6 @@ int VideoPlayer::getVideoHeight() return height; } -void VideoPlayer::stopVideo () -{ - close(); -} - void VideoPlayer::close() { if(mState) diff --git a/apps/openmw/mwrender/videoplayer.hpp b/apps/openmw/mwrender/videoplayer.hpp index 47e252cc1..69b214870 100644 --- a/apps/openmw/mwrender/videoplayer.hpp +++ b/apps/openmw/mwrender/videoplayer.hpp @@ -21,7 +21,6 @@ namespace MWRender void update(); void close(); - void stopVideo(); bool isPlaying(); @@ -32,9 +31,6 @@ namespace MWRender private: VideoState* mState; - - int mWidth; - int mHeight; }; } diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index 336e9431b..21fee5f57 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -480,12 +480,6 @@ namespace MWScript mActivationHandled = true; } - void InterpreterContext::clearActivation() - { - mActivated = MWWorld::Ptr(); - mActivationHandled = false; - } - float InterpreterContext::getSecondsPassed() const { return MWBase::Environment::get().getFrameDuration(); diff --git a/apps/openmw/mwscript/interpretercontext.hpp b/apps/openmw/mwscript/interpretercontext.hpp index bc43f3e44..b54339965 100644 --- a/apps/openmw/mwscript/interpretercontext.hpp +++ b/apps/openmw/mwscript/interpretercontext.hpp @@ -146,9 +146,6 @@ namespace MWScript void executeActivation(MWWorld::Ptr ptr, MWWorld::Ptr actor); ///< Execute the activation action for this ptr. If ptr is mActivated, mark activation as handled. - void clearActivation(); - ///< Discard the action defined by the last activate call. - virtual float getSecondsPassed() const; virtual bool isDisabled (const std::string& id = "") const; diff --git a/apps/openmw/mwscript/scriptmanagerimp.cpp b/apps/openmw/mwscript/scriptmanagerimp.cpp index 5af214268..811080361 100644 --- a/apps/openmw/mwscript/scriptmanagerimp.cpp +++ b/apps/openmw/mwscript/scriptmanagerimp.cpp @@ -43,13 +43,12 @@ namespace MWScript mParser.reset(); mErrorHandler.reset(); - bool Success = true; - if (const ESM::Script *script = mStore.get().find (name)) { if (mVerbose) std::cout << "compiling script: " << name << std::endl; + bool Success = true; try { std::istringstream input (script->mScriptText); diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp index 7b6e12576..414e31d70 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.cpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp @@ -83,7 +83,7 @@ bool FFmpeg_Decoder::getNextPacket() bool FFmpeg_Decoder::getAVAudioData() { - int got_frame, len; + int got_frame; if((*mStream)->codec->codec_type != AVMEDIA_TYPE_AUDIO) return false; @@ -93,6 +93,7 @@ bool FFmpeg_Decoder::getAVAudioData() return false; /* Decode some data, and check for errors */ + int len = 0; if((len=avcodec_decode_audio4((*mStream)->codec, mFrame, &got_frame, &mPacket)) < 0) return false; diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp index c0654a7f4..ebe08dc44 100644 --- a/apps/openmw/mwworld/class.cpp +++ b/apps/openmw/mwworld/class.cpp @@ -303,10 +303,6 @@ namespace MWWorld { } - void Class::adjustRotation(const MWWorld::Ptr& ptr,float& x,float& y,float& z) const - { - } - std::string Class::getModel(const MWWorld::Ptr &ptr) const { return ""; diff --git a/apps/openmw/mwworld/class.hpp b/apps/openmw/mwworld/class.hpp index 5d9c0a0ea..8ac39eaa9 100644 --- a/apps/openmw/mwworld/class.hpp +++ b/apps/openmw/mwworld/class.hpp @@ -267,8 +267,6 @@ namespace MWWorld virtual void adjustScale(const MWWorld::Ptr& ptr,float& scale) const; - virtual void adjustRotation(const MWWorld::Ptr& ptr,float& x,float& y,float& z) const; - virtual bool canSell (const MWWorld::Ptr& item, int npcServices) const; ///< Determine whether or not \a item can be sold to an npc with the given \a npcServices diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index d9139a666..f515f1efb 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -73,15 +73,14 @@ MWWorld::InventoryStore::InventoryStore() } MWWorld::InventoryStore::InventoryStore (const InventoryStore& store) -: ContainerStore (store) + : ContainerStore (store) , mSelectedEnchantItem(end()) + , mMagicEffects(store.mMagicEffects) + , mFirstAutoEquip(store.mFirstAutoEquip) + , mListener(store.mListener) + , mUpdatesEnabled(store.mUpdatesEnabled) + , mPermanentMagicEffectMagnitudes(store.mPermanentMagicEffectMagnitudes) { - mMagicEffects = store.mMagicEffects; - mFirstAutoEquip = store.mFirstAutoEquip; - mListener = store.mListener; - mUpdatesEnabled = store.mUpdatesEnabled; - - mPermanentMagicEffectMagnitudes = store.mPermanentMagicEffectMagnitudes; copySlots (store); } @@ -218,8 +217,6 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor) // Equipping weapons is handled by AiCombat. Anything else (lockpicks, probes) can't be used by NPCs anyway (yet) continue; - bool use = false; - if (slots_.at (*iter2)!=end()) { Ptr old = *slots_.at (*iter2); @@ -227,6 +224,7 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor) // check skill int oldSkill = old.getClass().getEquipmentSkill (old); + bool use = false; if (testSkill!=-1 && oldSkill==-1) use = true; else if (testSkill!=-1 && oldSkill!=-1 && testSkill!=oldSkill) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 80ad66743..a316f0bb2 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -268,8 +268,6 @@ namespace MWWorld loadingListener->setLabel(loadingExteriorText); CellStoreCollection::iterator active = mActiveCells.begin(); - - active = mActiveCells.begin(); while (active!=mActiveCells.end()) { if ((*active)->getCell()->isExterior()) @@ -414,12 +412,9 @@ namespace MWWorld std::cout << "Changing to interior\n"; - // remove active - CellStoreCollection::iterator active = mActiveCells.begin(); - // unload int current = 0; - active = mActiveCells.begin(); + CellStoreCollection::iterator active = mActiveCells.begin(); while (active!=mActiveCells.end()) { unloadCell (active++); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index ed66ae427..c49f1f483 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1315,7 +1315,7 @@ namespace MWWorld const PtrVelocityList &results = mPhysics->applyQueuedMovement(duration); PtrVelocityList::const_iterator player(results.end()); - for(PtrVelocityList::const_iterator iter(results.begin());iter != results.end();iter++) + for(PtrVelocityList::const_iterator iter(results.begin());iter != results.end();++iter) { if(iter->first.getRefData().getHandle() == "player") { diff --git a/components/compiler/generator.cpp b/components/compiler/generator.cpp index 235b163ad..2efa2477e 100644 --- a/components/compiler/generator.cpp +++ b/components/compiler/generator.cpp @@ -105,11 +105,6 @@ namespace code.push_back (Compiler::Generator::segment5 (17)); } - void opFloatToInt1 (Compiler::Generator::CodeContainer& code) - { - code.push_back (Compiler::Generator::segment5 (18)); - } - void opSquareRoot (Compiler::Generator::CodeContainer& code) { code.push_back (Compiler::Generator::segment5 (19)); @@ -606,16 +601,6 @@ namespace Compiler jump (code, offset); } - void jumpOnNonZero (CodeContainer& code, int offset) - { - opSkipOnZero (code); - - if (offset<0) - --offset; // compensate for skip instruction - - jump (code, offset); - } - void compare (CodeContainer& code, char op, char valueType1, char valueType2) { if (valueType1=='l' && valueType2=='l') diff --git a/components/compiler/generator.hpp b/components/compiler/generator.hpp index 2619033c8..a56d7c1f1 100644 --- a/components/compiler/generator.hpp +++ b/components/compiler/generator.hpp @@ -89,8 +89,6 @@ namespace Compiler void jumpOnZero (CodeContainer& code, int offset); - void jumpOnNonZero (CodeContainer& code, int offset); - void compare (CodeContainer& code, char op, char valueType1, char valueType2); void menuMode (CodeContainer& code); diff --git a/components/compiler/lineparser.cpp b/components/compiler/lineparser.cpp index 7d554f2ec..dc19b9a4b 100644 --- a/components/compiler/lineparser.cpp +++ b/components/compiler/lineparser.cpp @@ -57,7 +57,7 @@ namespace Compiler Literals& literals, std::vector& code, bool allowExpression) : Parser (errorHandler, context), mLocals (locals), mLiterals (literals), mCode (code), mState (BeginState), mExprParser (errorHandler, context, locals, literals), - mAllowExpression (allowExpression), mButtons(0), mType(0) + mAllowExpression (allowExpression), mButtons(0), mType(0), mReferenceMember(false) {} bool LineParser::parseInt (int value, const TokenLoc& loc, Scanner& scanner) @@ -295,8 +295,6 @@ namespace Compiler mExplicit.clear(); } - int optionals = 0; - try { // workaround for broken positioncell instructions. @@ -306,7 +304,7 @@ namespace Compiler errorDowngrade.reset (new ErrorDowngrade (getErrorHandler())); std::vector code; - optionals = mExprParser.parseArguments (argumentType, scanner, code); + int optionals = mExprParser.parseArguments (argumentType, scanner, code); mCode.insert (mCode.end(), code.begin(), code.end()); extensions->generateInstructionCode (keyword, mCode, mLiterals, mExplicit, optionals); diff --git a/components/compiler/parser.cpp b/components/compiler/parser.cpp index 781fbad8c..0f442c350 100644 --- a/components/compiler/parser.cpp +++ b/components/compiler/parser.cpp @@ -21,13 +21,6 @@ namespace Compiler throw SourceException(); } - // Report the error - - void Parser::reportError (const std::string& message, const TokenLoc& loc) - { - mErrorHandler.error (message, loc); - } - // Report the warning without throwing an exception. void Parser::reportWarning (const std::string& message, const TokenLoc& loc) diff --git a/components/compiler/parser.hpp b/components/compiler/parser.hpp index 54e913b20..2ef6e85b9 100644 --- a/components/compiler/parser.hpp +++ b/components/compiler/parser.hpp @@ -26,9 +26,6 @@ namespace Compiler void reportSeriousError (const std::string& message, const TokenLoc& loc); ///< Report the error and throw a exception. - void reportError (const std::string& message, const TokenLoc& loc); - ///< Report the error - void reportWarning (const std::string& message, const TokenLoc& loc); ///< Report the warning without throwing an exception. diff --git a/components/contentselector/model/contentmodel.cpp b/components/contentselector/model/contentmodel.cpp index e76930e81..a6e594d2e 100644 --- a/components/contentselector/model/contentmodel.cpp +++ b/components/contentselector/model/contentmodel.cpp @@ -276,7 +276,6 @@ bool ContentSelectorModel::ContentModel::setData(const QModelIndex &index, const case Qt::CheckStateRole: { int checkValue = value.toInt(); - bool success = false; bool setState = false; if ((checkValue==Qt::Checked) && !isChecked(file->filePath())) { diff --git a/components/esm/esmreader.cpp b/components/esm/esmreader.cpp index ebdb1e41f..6facee381 100644 --- a/components/esm/esmreader.cpp +++ b/components/esm/esmreader.cpp @@ -250,14 +250,6 @@ void ESMReader::skipRecord() mCtx.leftRec = 0; } -void ESMReader::skipHRecord() -{ - if (!mCtx.leftFile) - return; - getRecHeader(); - skipRecord(); -} - void ESMReader::getRecHeader(uint32_t &flags) { // General error checking diff --git a/components/esm/esmreader.hpp b/components/esm/esmreader.hpp index 730bdd8c7..1549e15f5 100644 --- a/components/esm/esmreader.hpp +++ b/components/esm/esmreader.hpp @@ -216,9 +216,6 @@ public: // already been read void skipRecord(); - // Skip an entire record, including the header (but not the name) - void skipHRecord(); - /* Read record header. This updatesleftFile BEYOND the data that follows the header, ie beyond the entire record. You should use leftRec to orient yourself inside the record itself. diff --git a/components/esm/esmwriter.cpp b/components/esm/esmwriter.cpp index 06572ce8f..544f8bbed 100644 --- a/components/esm/esmwriter.cpp +++ b/components/esm/esmwriter.cpp @@ -6,7 +6,12 @@ namespace ESM { - ESMWriter::ESMWriter() : mEncoder (0), mRecordCount (0), mCounting (true) {} + ESMWriter::ESMWriter() + : mEncoder (0) + , mRecordCount (0) + , mCounting (true) + , mStream(NULL) + {} unsigned int ESMWriter::getVersion() const { diff --git a/components/esm/loadcell.cpp b/components/esm/loadcell.cpp index 91da936a4..bbd6696f1 100644 --- a/components/esm/loadcell.cpp +++ b/components/esm/loadcell.cpp @@ -113,11 +113,6 @@ void Cell::loadData(ESMReader &esm) esm.getHNT(mData, "DATA", 12); } -void Cell::preLoad(ESMReader &esm) //Can't be "load" because it conflicts with function in esmtool -{ - this->load(esm, false); -} - void Cell::postLoad(ESMReader &esm) { // Save position of the cell references and move on diff --git a/components/esm/loadcell.hpp b/components/esm/loadcell.hpp index f40b3db61..a24b106d4 100644 --- a/components/esm/loadcell.hpp +++ b/components/esm/loadcell.hpp @@ -104,7 +104,6 @@ struct Cell CellRefTracker mLeasedRefs; MovedCellRefTracker mMovedRefs; - void preLoad(ESMReader &esm); void postLoad(ESMReader &esm); // This method is left in for compatibility with esmtool. Parsing moved references currently requires diff --git a/components/esm/loadland.cpp b/components/esm/loadland.cpp index 1b701229e..91b062596 100644 --- a/components/esm/loadland.cpp +++ b/components/esm/loadland.cpp @@ -19,14 +19,14 @@ void Land::LandData::save(ESMWriter &esm) offsets.mUnk1 = mUnk1; offsets.mUnk2 = mUnk2; - float prevY = mHeights[0], prevX; + float prevY = mHeights[0]; int number = 0; // avoid multiplication for (int i = 0; i < LAND_SIZE; ++i) { float diff = (mHeights[number] - prevY) / HEIGHT_SCALE; offsets.mHeightData[number] = (diff >= 0) ? (int8_t) (diff + 0.5) : (int8_t) (diff - 0.5); - prevX = prevY = mHeights[number]; + float prevX = prevY = mHeights[number]; ++number; for (int j = 1; j < LAND_SIZE; ++j) { diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index d53c7d865..2240d65b0 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -18,7 +18,7 @@ NIFFile::NIFFile(const std::string &name) NIFFile::~NIFFile() { - for (std::vector::iterator it = records.begin() ; it != records.end(); it++) + for (std::vector::iterator it = records.begin() ; it != records.end(); ++it) { delete *it; } diff --git a/components/nifogre/material.hpp b/components/nifogre/material.hpp index fc978549e..d485439cf 100644 --- a/components/nifogre/material.hpp +++ b/components/nifogre/material.hpp @@ -29,12 +29,6 @@ class NIFMaterialLoader { std::cerr << "NIFMaterialLoader: Warn: " << msg << std::endl; } - static void fail(const std::string &msg) - { - std::cerr << "NIFMaterialLoader: Fail: "<< msg << std::endl; - abort(); - } - static std::map sMaterialMap; public: diff --git a/components/nifogre/ogrenifloader.cpp b/components/nifogre/ogrenifloader.cpp index 57d3cbe17..dcc34f627 100644 --- a/components/nifogre/ogrenifloader.cpp +++ b/components/nifogre/ogrenifloader.cpp @@ -1048,7 +1048,7 @@ class NIFObjectLoader { std::string::const_iterator last = str.end(); do { - last--; + --last; } while(last != str.begin() && ::isspace(*last)); nextpos = std::distance(str.begin(), ++last); } diff --git a/components/nifogre/particles.cpp b/components/nifogre/particles.cpp index caf82cf42..316e4edc2 100644 --- a/components/nifogre/particles.cpp +++ b/components/nifogre/particles.cpp @@ -130,8 +130,8 @@ public: NifEmitter(Ogre::ParticleSystem *psys) : Ogre::ParticleEmitter(psys) + , mEmitterBones(Ogre::any_cast(psys->getUserObjectBindings().getUserAny()).mBones) { - mEmitterBones = Ogre::any_cast(psys->getUserObjectBindings().getUserAny()).mBones; assert (!mEmitterBones.empty()); Ogre::TagPoint* tag = static_cast(mParent->getParentNode()); mParticleBone = static_cast(tag->getParent()); diff --git a/components/ogreinit/ogreinit.cpp b/components/ogreinit/ogreinit.cpp index 60306459a..40712e282 100644 --- a/components/ogreinit/ogreinit.cpp +++ b/components/ogreinit/ogreinit.cpp @@ -45,7 +45,7 @@ namespace LogListener(const std::string &path) : file((bfs::path(path))) { - memset(buffer, sizeof(buffer), 0); + memset(buffer, 0, sizeof(buffer)); } void timestamp() diff --git a/components/terrain/defaultworld.hpp b/components/terrain/defaultworld.hpp index 8769a0d88..62441c420 100644 --- a/components/terrain/defaultworld.hpp +++ b/components/terrain/defaultworld.hpp @@ -70,9 +70,9 @@ namespace Terrain private: // Called from a background worker thread - Ogre::WorkQueue::Response* handleRequest(const Ogre::WorkQueue::Request* req, const Ogre::WorkQueue* srcQ); + virtual Ogre::WorkQueue::Response* handleRequest(const Ogre::WorkQueue::Request* req, const Ogre::WorkQueue* srcQ); // Called from the main thread - void handleResponse(const Ogre::WorkQueue::Response* res, const Ogre::WorkQueue* srcQ); + virtual void handleResponse(const Ogre::WorkQueue::Response* res, const Ogre::WorkQueue* srcQ); Ogre::uint16 mWorkQueueChannel; bool mVisible; diff --git a/components/terrain/world.cpp b/components/terrain/world.cpp index 49fb9b5c9..93caeb8df 100644 --- a/components/terrain/world.cpp +++ b/components/terrain/world.cpp @@ -15,6 +15,8 @@ World::World(Ogre::SceneManager* sceneMgr, , mShaders(shaders) , mAlign(align) , mCache(storage->getCellVertices()) + , mShadows(false) + , mSplitShadows(false) { } diff --git a/components/translation/translation.cpp b/components/translation/translation.cpp index 5341240af..51947f6f9 100644 --- a/components/translation/translation.cpp +++ b/components/translation/translation.cpp @@ -6,6 +6,11 @@ namespace Translation { + Storage::Storage() + : mEncoder(NULL) + { + } + void Storage::loadTranslationData(const Files::Collections& dataFileCollections, const std::string& esmFileName) { diff --git a/components/translation/translation.hpp b/components/translation/translation.hpp index bca9ea255..6a3f84ba1 100644 --- a/components/translation/translation.hpp +++ b/components/translation/translation.hpp @@ -9,6 +9,7 @@ namespace Translation class Storage { public: + Storage(); void loadTranslationData(const Files::Collections& dataFileCollections, const std::string& esmFileName); diff --git a/components/widgets/list.cpp b/components/widgets/list.cpp index 86db2fdf4..28271e87d 100644 --- a/components/widgets/list.cpp +++ b/components/widgets/list.cpp @@ -113,11 +113,6 @@ namespace Gui Base::setPropertyOverride(_key, _value); } - bool MWList::hasItem(const std::string& name) - { - return (std::find(mItems.begin(), mItems.end(), name) != mItems.end()); - } - unsigned int MWList::getItemCount() { return mItems.size(); diff --git a/components/widgets/list.hpp b/components/widgets/list.hpp index 8b4955a2d..093cd8c18 100644 --- a/components/widgets/list.hpp +++ b/components/widgets/list.hpp @@ -39,7 +39,6 @@ namespace Gui void addItem(const std::string& name); void addSeparator(); ///< add a seperator between the current and the next item. void removeItem(const std::string& name); - bool hasItem(const std::string& name); unsigned int getItemCount(); std::string getItemNameAt(unsigned int at); ///< \attention if there are separators, this method will return "" at the place where the separator is void clear(); diff --git a/extern/oics/CMakeLists.txt b/extern/oics/CMakeLists.txt index 5c1edbf62..52ffb42a2 100644 --- a/extern/oics/CMakeLists.txt +++ b/extern/oics/CMakeLists.txt @@ -9,6 +9,7 @@ set(OICS_SOURCE_FILES ICSInputControlSystem_keyboard.cpp ICSInputControlSystem_mouse.cpp ICSInputControlSystem_joystick.cpp + ICSPrerequisites.h ) set(TINYXML_SOURCE_FILES diff --git a/extern/oics/ICSChannel.cpp b/extern/oics/ICSChannel.cpp index 178fe5aa3..82042d321 100644 --- a/extern/oics/ICSChannel.cpp +++ b/extern/oics/ICSChannel.cpp @@ -58,22 +58,23 @@ namespace ICS return mValue; } - BezierFunction::iterator it = mBezierFunction.begin(); - //size_t size_minus_1 = mBezierFunction.size() - 1; - BezierFunction::iterator last = mBezierFunction.end(); - last--; - for ( ; it != last ; ) - { - BezierPoint left = (*it); - BezierPoint right = (*(++it)); + assert (!mBezierFunction.empty()); + BezierFunction::iterator it = mBezierFunction.begin(); + //size_t size_minus_1 = mBezierFunction.size() - 1; + BezierFunction::iterator last = mBezierFunction.end(); + --last; + for ( ; it != last ; ) + { + BezierPoint left = (*it); + BezierPoint right = (*(++it)); - if( (left.x <= mValue) && (right.x > mValue) ) - { - float val = left.y - (left.x - mValue) * (left.y - right.y) / (left.x - right.x); + if( (left.x <= mValue) && (right.x > mValue) ) + { + float val = left.y - (left.x - mValue) * (left.y - right.y) / (left.x - right.x); - return std::max(0.0,std::min(1.0, val)); - } - } + return std::max(0.0,std::min(1.0, val)); + } + } return -1; } @@ -95,7 +96,7 @@ namespace ICS std::list::iterator pos = mListeners.begin(); while (pos != mListeners.end()) { - ((ChannelListener* )(*pos))->channelChanged((Channel*)this, this->getValue(), previousValue); + (*pos)->channelChanged((Channel*)this, this->getValue(), previousValue); ++pos; } } diff --git a/extern/oics/ICSControl.cpp b/extern/oics/ICSControl.cpp index 934c661c9..7c804d6ee 100644 --- a/extern/oics/ICSControl.cpp +++ b/extern/oics/ICSControl.cpp @@ -86,7 +86,7 @@ namespace ICS std::list::iterator pos = mListeners.begin(); while (pos != mListeners.end()) { - ((ControlListener* )(*pos))->controlChanged((Control*)this, this->getValue(), previousValue); + (*pos)->controlChanged((Control*)this, this->getValue(), previousValue); ++pos; } } @@ -99,13 +99,13 @@ namespace ICS void Control::update(float timeSinceLastFrame) { - if(mPendingActions.size() > 0) + if(!mPendingActions.empty()) { size_t timedActionsCount = 0; std::list::iterator cached_end = mPendingActions.end(); for(std::list::iterator it = mPendingActions.begin() ; - it != cached_end ; it++) + it != cached_end ; ++it) { if( (*it) != Control::STOP ) { @@ -115,7 +115,7 @@ namespace ICS float timeSinceLastFramePart = timeSinceLastFrame / std::max(1, timedActionsCount); for(std::list::iterator it = mPendingActions.begin() ; - it != cached_end ; it++) + it != cached_end ; ++it) { if( (*it) != Control::STOP ) { diff --git a/extern/oics/ICSInputControlSystem.cpp b/extern/oics/ICSInputControlSystem.cpp index e493cdf26..7dc026c7e 100644 --- a/extern/oics/ICSInputControlSystem.cpp +++ b/extern/oics/ICSInputControlSystem.cpp @@ -120,8 +120,6 @@ namespace ICS if(type == "bezier") { - float step = 0.1; - float startX = FromString(xmlInterval->Attribute("startX")); float startY = FromString(xmlInterval->Attribute("startY")); float midX = FromString(xmlInterval->Attribute("midX")); @@ -129,7 +127,7 @@ namespace ICS float endX = FromString(xmlInterval->Attribute("endX")); float endY = FromString(xmlInterval->Attribute("endY")); - step = FromString(xmlInterval->Attribute("step")); + float step = FromString(xmlInterval->Attribute("step")); ICS_LOG("Applying Bezier filter to channel [number=" + ToString(ch) + ", startX=" @@ -334,7 +332,7 @@ namespace ICS TiXmlElement Controller( "Controller" ); - for(std::vector::const_iterator o = mChannels.begin() ; o != mChannels.end(); o++) + for(std::vector::const_iterator o = mChannels.begin() ; o != mChannels.end(); ++o) { ICS::IntervalList intervals = (*o)->getIntervals(); @@ -371,14 +369,14 @@ namespace ICS ChannelFilter.InsertEndChild(XMLInterval); } - interval++; + ++interval; } Controller.InsertEndChild(ChannelFilter); } } - for(std::vector::const_iterator o = mControls.begin() ; o != mControls.end(); o++) + for(std::vector::const_iterator o = mControls.begin() ; o != mControls.end(); ++o) { TiXmlElement control( "Control" ); @@ -687,13 +685,13 @@ namespace ICS control.InsertEndChild(binder); } - it++; + ++it; } std::list channels = (*o)->getAttachedChannels(); for(std::list::iterator it = channels.begin() ; - it != channels.end() ; it++) + it != channels.end() ; ++it) { TiXmlElement binder( "Channel" ); diff --git a/extern/oics/ICSInputControlSystem_joystick.cpp b/extern/oics/ICSInputControlSystem_joystick.cpp index 35762d2b3..8bf931788 100644 --- a/extern/oics/ICSInputControlSystem_joystick.cpp +++ b/extern/oics/ICSInputControlSystem_joystick.cpp @@ -192,7 +192,7 @@ namespace ICS { return it->first; } - it++; + ++it; } } @@ -210,7 +210,7 @@ namespace ICS { return it->first; } - it++; + ++it; } } diff --git a/extern/oics/ICSInputControlSystem_keyboard.cpp b/extern/oics/ICSInputControlSystem_keyboard.cpp index fbfa9af52..af0eec82a 100644 --- a/extern/oics/ICSInputControlSystem_keyboard.cpp +++ b/extern/oics/ICSInputControlSystem_keyboard.cpp @@ -80,7 +80,7 @@ namespace ICS { return it->first; } - it++; + ++it; } return SDL_SCANCODE_UNKNOWN; diff --git a/extern/oics/ICSInputControlSystem_mouse.cpp b/extern/oics/ICSInputControlSystem_mouse.cpp index fb1100528..d1ef721b2 100644 --- a/extern/oics/ICSInputControlSystem_mouse.cpp +++ b/extern/oics/ICSInputControlSystem_mouse.cpp @@ -149,7 +149,7 @@ namespace ICS { return (InputControlSystem::NamedAxis)(it->first); } - it++; + ++it; } return /*NamedAxis::*/UNASSIGNED; @@ -179,7 +179,7 @@ namespace ICS { return it->first; } - it++; + ++it; } return ICS_MAX_DEVICE_BUTTONS; diff --git a/extern/oics/ICSPrerequisites.h b/extern/oics/ICSPrerequisites.h index 6e6cd814b..ed99f4f54 100644 --- a/extern/oics/ICSPrerequisites.h +++ b/extern/oics/ICSPrerequisites.h @@ -77,7 +77,7 @@ namespace ICS { std::stringstream ss(Text); T result; - return ss >> result ? true : false; + return (ss >> result) ? true : false; } // from http://www.cplusplus.com/forum/articles/9645/ @@ -95,7 +95,7 @@ namespace ICS { //character array as argument std::stringstream ss(Text); T result; - return ss >> result ? result : 0; + return (ss >> result) ? result : 0; } class InputControlSystem; diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index 50d82cd37..f2be11386 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -735,10 +735,6 @@ namespace Physic } } - void PhysicEngine::emptyEventLists(void) - { - } - std::pair PhysicEngine::rayTest(const btVector3 &from, const btVector3 &to, bool raycastingObjectOnly, bool ignoreHeightMap, Ogre::Vector3* normal) { std::string name = ""; diff --git a/libs/openengine/bullet/physic.hpp b/libs/openengine/bullet/physic.hpp index d882d85bb..e330a7621 100644 --- a/libs/openengine/bullet/physic.hpp +++ b/libs/openengine/bullet/physic.hpp @@ -168,6 +168,9 @@ namespace Physic std::string mMesh; std::string mName; PhysicEngine *mEngine; + + PhysicActor(const PhysicActor&); + PhysicActor& operator=(const PhysicActor&); }; @@ -272,11 +275,6 @@ namespace Physic */ void stepSimulation(double deltaT); - /** - * Empty events lists - */ - void emptyEventLists(void); - /** * Create a debug rendering. It is called by setDebgRenderingMode if it's not created yet. * Important Note: this will crash if the Render is not yet initialise! @@ -352,6 +350,10 @@ namespace Physic BtOgre::DebugDrawer* mDebugDrawer; bool isDebugCreated; bool mDebugActive; + + private: + PhysicEngine(const PhysicEngine&); + PhysicEngine& operator=(const PhysicEngine&); }; diff --git a/libs/openengine/gui/manager.cpp b/libs/openengine/gui/manager.cpp index 8238a25d4..30a5b938c 100644 --- a/libs/openengine/gui/manager.cpp +++ b/libs/openengine/gui/manager.cpp @@ -638,20 +638,6 @@ void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool mGui->initialise(""); } -void MyGUIManager::updateWindow (Ogre::RenderWindow *wnd) -{ - if (mShaderRenderManager) - { - mShaderRenderManager->setRenderWindow (wnd); - mShaderRenderManager->setActiveViewport(0); - } - else - { - mRenderManager->setRenderWindow (wnd); - mRenderManager->setActiveViewport(0); - } -} - void MyGUIManager::windowResized() { #ifndef ANDROID diff --git a/libs/openengine/gui/manager.hpp b/libs/openengine/gui/manager.hpp index 3fb5245f3..28eb6419b 100644 --- a/libs/openengine/gui/manager.hpp +++ b/libs/openengine/gui/manager.hpp @@ -43,8 +43,6 @@ namespace GUI shutdown(); } - void updateWindow (Ogre::RenderWindow* wnd); - void windowResized(); void setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false, const std::string& logDir = std::string("")); diff --git a/libs/openengine/ogre/renderer.cpp b/libs/openengine/ogre/renderer.cpp index fa98433ac..eb33d5876 100644 --- a/libs/openengine/ogre/renderer.cpp +++ b/libs/openengine/ogre/renderer.cpp @@ -83,11 +83,6 @@ void OgreRenderer::screenshot(const std::string &file, const std::string& imageF } } -float OgreRenderer::getFPS() -{ - return mWindow->getLastFPS(); -} - void OgreRenderer::configure(const std::string &logPath, const std::string& renderSystem, const std::string& rttMode diff --git a/libs/openengine/ogre/renderer.hpp b/libs/openengine/ogre/renderer.hpp index 5dba15b5a..e56f5f816 100644 --- a/libs/openengine/ogre/renderer.hpp +++ b/libs/openengine/ogre/renderer.hpp @@ -110,8 +110,6 @@ namespace OEngine /// Write a screenshot to file void screenshot(const std::string &file, const std::string& imageFormat); - float getFPS(); - void windowResized(int x, int y); /// Get the Root diff --git a/plugins/mygui_resource_plugin/plugin.cpp b/plugins/mygui_resource_plugin/plugin.cpp index ac4c9a3d4..1b718b547 100644 --- a/plugins/mygui_resource_plugin/plugin.cpp +++ b/plugins/mygui_resource_plugin/plugin.cpp @@ -33,7 +33,6 @@ void validate(boost::any &v, std::vector const &tokens, FallbackMap FallbackMap *map = boost::any_cast(&v); - std::map::iterator mapIt; for(std::vector::const_iterator it=tokens.begin(); it != tokens.end(); ++it) { int sep = it->find(","); @@ -47,7 +46,7 @@ void validate(boost::any &v, std::vector const &tokens, FallbackMap std::string key(it->substr(0,sep)); std::string value(it->substr(sep+1)); - if((mapIt = map->mMap.find(key)) == map->mMap.end()) + if(map->mMap.find(key) == map->mMap.end()) { map->mMap.insert(std::make_pair (key,value)); }