From 197540763e417184d41cc1ba76cbfddf16be7b86 Mon Sep 17 00:00:00 2001 From: Tobias Loose Date: Mon, 3 Feb 2014 13:52:40 +0100 Subject: [PATCH 1/4] Remove unused Effects.h/.cpp and class Effect There was an empty vector of effect* in PlayGuiObject. --- projects/mtg/include/Effects.h | 13 ------------- projects/mtg/include/PlayGuiObject.h | 2 -- projects/mtg/src/Effects.cpp | 3 --- projects/mtg/src/PlayGuiObject.cpp | 4 ---- projects/mtg/template.vcxproj | 3 +-- projects/mtg/template.vcxproj.filters | 5 +---- projects/mtg/wagic.pri | 2 -- projects/mtg/wagic.xcodeproj/project.pbxproj | 8 -------- 8 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 projects/mtg/include/Effects.h delete mode 100644 projects/mtg/src/Effects.cpp diff --git a/projects/mtg/include/Effects.h b/projects/mtg/include/Effects.h deleted file mode 100644 index 248e22a3c..000000000 --- a/projects/mtg/include/Effects.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _EFFECTS_H_ -#define _EFFECTS_H_ - -#include - -class Effect: public JGuiObject -{ - static int id_counter; -public: - Effect() : JGuiObject(++id_counter) {}; -}; - -#endif // _EFFECTS_H_ diff --git a/projects/mtg/include/PlayGuiObject.h b/projects/mtg/include/PlayGuiObject.h index 5855c2884..c09d1a4c8 100644 --- a/projects/mtg/include/PlayGuiObject.h +++ b/projects/mtg/include/PlayGuiObject.h @@ -12,7 +12,6 @@ #define GUI_OPPONENTHAND 5 #include -#include "Effects.h" #include "WEvent.h" #include "Pos.h" @@ -65,7 +64,6 @@ public: } ; virtual ~PlayGuiObject() {}; - vector effects; }; #endif diff --git a/projects/mtg/src/Effects.cpp b/projects/mtg/src/Effects.cpp deleted file mode 100644 index 50056df0d..000000000 --- a/projects/mtg/src/Effects.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "../include/Effects.h" - -int Effect::id_counter = 0; diff --git a/projects/mtg/src/PlayGuiObject.cpp b/projects/mtg/src/PlayGuiObject.cpp index 5d84ca3a8..56069802a 100644 --- a/projects/mtg/src/PlayGuiObject.cpp +++ b/projects/mtg/src/PlayGuiObject.cpp @@ -38,13 +38,9 @@ void PlayGuiObject::Update(float dt) if (mHeight < defaultHeight) mHeight = defaultHeight; } wave = (wave + 2 * (int) (100 * dt)) % 255; - for (vector::iterator it = effects.begin(); it != effects.end(); ++it) - (*it)->Update(dt); Pos::Update(dt); } void PlayGuiObject::Render() { - for (vector::iterator it = effects.begin(); it != effects.end(); ++it) - (*it)->Render(); } diff --git a/projects/mtg/template.vcxproj b/projects/mtg/template.vcxproj index 912ece289..16e66111e 100644 --- a/projects/mtg/template.vcxproj +++ b/projects/mtg/template.vcxproj @@ -493,7 +493,6 @@ - @@ -592,4 +591,4 @@ - \ No newline at end of file + diff --git a/projects/mtg/template.vcxproj.filters b/projects/mtg/template.vcxproj.filters index 0e2cdef9e..263d9ab9e 100644 --- a/projects/mtg/template.vcxproj.filters +++ b/projects/mtg/template.vcxproj.filters @@ -417,9 +417,6 @@ inc - - inc - inc @@ -725,4 +722,4 @@ res - \ No newline at end of file + diff --git a/projects/mtg/wagic.pri b/projects/mtg/wagic.pri index 85ea223a2..a292833a1 100644 --- a/projects/mtg/wagic.pri +++ b/projects/mtg/wagic.pri @@ -80,7 +80,6 @@ SOURCES += \ src/DeckStats.cpp\ src/DeckView.cpp\ src/DuelLayers.cpp\ - src/Effects.cpp\ src/ExtraCost.cpp\ src/GameApp.cpp\ src/GameLauncher.cpp\ @@ -271,7 +270,6 @@ HEADERS += \ include/WResourceManager.h\ include/DuelLayers.h\ include/GuiStatic.h\ - include/Effects.h\ include/StyleManager.h\ include/WFont.h\ include/DeckManager.h\ diff --git a/projects/mtg/wagic.xcodeproj/project.pbxproj b/projects/mtg/wagic.xcodeproj/project.pbxproj index 6f4b9057d..2a9feb644 100755 --- a/projects/mtg/wagic.xcodeproj/project.pbxproj +++ b/projects/mtg/wagic.xcodeproj/project.pbxproj @@ -85,7 +85,6 @@ 12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; }; 12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; }; 12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377081291C60500B9016A /* DuelLayers.cpp */; }; - 12059DBD14980B7300DAC43B /* Effects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377091291C60500B9016A /* Effects.cpp */; }; 12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770A1291C60500B9016A /* ExtraCost.cpp */; }; 12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; }; 12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; }; @@ -325,7 +324,6 @@ CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; }; CEA377711291C60500B9016A /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; }; CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377081291C60500B9016A /* DuelLayers.cpp */; }; - CEA377731291C60500B9016A /* Effects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377091291C60500B9016A /* Effects.cpp */; }; CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770A1291C60500B9016A /* ExtraCost.cpp */; }; CEA377751291C60500B9016A /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; }; CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; }; @@ -627,7 +625,6 @@ CEA3769E1291C60500B9016A /* DeckMetaData.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckMetaData.h; sourceTree = ""; }; CEA3769F1291C60500B9016A /* DeckStats.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckStats.h; sourceTree = ""; }; CEA376A01291C60500B9016A /* DuelLayers.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DuelLayers.h; sourceTree = ""; }; - CEA376A11291C60500B9016A /* Effects.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = Effects.h; sourceTree = ""; }; CEA376A21291C60500B9016A /* ExtraCost.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = ExtraCost.h; sourceTree = ""; }; CEA376A31291C60500B9016A /* GameApp.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameApp.h; sourceTree = ""; }; CEA376A41291C60500B9016A /* GameObserver.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameObserver.h; sourceTree = ""; }; @@ -729,7 +726,6 @@ CEA377061291C60500B9016A /* DeckMetaData.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckMetaData.cpp; sourceTree = ""; }; CEA377071291C60500B9016A /* DeckStats.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckStats.cpp; sourceTree = ""; }; CEA377081291C60500B9016A /* DuelLayers.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DuelLayers.cpp; sourceTree = ""; }; - CEA377091291C60500B9016A /* Effects.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = Effects.cpp; sourceTree = ""; }; CEA3770A1291C60500B9016A /* ExtraCost.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = ExtraCost.cpp; sourceTree = ""; }; CEA3770B1291C60500B9016A /* GameApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameApp.cpp; sourceTree = ""; }; CEA3770C1291C60500B9016A /* GameLauncher.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameLauncher.cpp; sourceTree = ""; }; @@ -1324,7 +1320,6 @@ CEA3769E1291C60500B9016A /* DeckMetaData.h */, CEA3769F1291C60500B9016A /* DeckStats.h */, CEA376A01291C60500B9016A /* DuelLayers.h */, - CEA376A11291C60500B9016A /* Effects.h */, CEA376A21291C60500B9016A /* ExtraCost.h */, CEA376A31291C60500B9016A /* GameApp.h */, CEA376A41291C60500B9016A /* GameObserver.h */, @@ -1445,7 +1440,6 @@ CEA377061291C60500B9016A /* DeckMetaData.cpp */, CEA377071291C60500B9016A /* DeckStats.cpp */, CEA377081291C60500B9016A /* DuelLayers.cpp */, - CEA377091291C60500B9016A /* Effects.cpp */, CEA3770A1291C60500B9016A /* ExtraCost.cpp */, CEA3770B1291C60500B9016A /* GameApp.cpp */, CEA3770C1291C60500B9016A /* GameLauncher.cpp */, @@ -1845,7 +1839,6 @@ 12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */, 12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */, 12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */, - 12059DBD14980B7300DAC43B /* Effects.cpp in Sources */, 12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */, 12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */, 12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */, @@ -2027,7 +2020,6 @@ CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */, CEA377711291C60500B9016A /* DeckStats.cpp in Sources */, CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */, - CEA377731291C60500B9016A /* Effects.cpp in Sources */, CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */, CEA377751291C60500B9016A /* GameApp.cpp in Sources */, CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */, From 8f233b302707498761779b29c8cac4dd0aa5bbf5 Mon Sep 17 00:00:00 2001 From: Tobias Loose Date: Mon, 3 Feb 2014 19:44:51 +0100 Subject: [PATCH 2/4] Avoid circular initialization --- projects/mtg/include/ActionStack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/mtg/include/ActionStack.h b/projects/mtg/include/ActionStack.h index 06e7f2afe..7a3bdde16 100644 --- a/projects/mtg/include/ActionStack.h +++ b/projects/mtg/include/ActionStack.h @@ -72,7 +72,7 @@ public: } Interruptible(GameObserver* observer, int inID = 0, bool hasFocus = false) - : PlayGuiObject(40, x, y, inID, hasFocus), Targetable(observer), state(NOT_RESOLVED), display(0), source(NULL) + : PlayGuiObject(40, 0.0f, 0.0f, inID, hasFocus), Targetable(observer), state(NOT_RESOLVED), display(0), source(NULL) { } From 225dd23753aa954606eccb141bbbb67eb7f7b8a7 Mon Sep 17 00:00:00 2001 From: Tobias Loose Date: Tue, 11 Mar 2014 17:17:36 +0100 Subject: [PATCH 3/4] Fix makefile --- projects/mtg/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/mtg/Makefile b/projects/mtg/Makefile index a5db9bda5..7b53ff162 100644 --- a/projects/mtg/Makefile +++ b/projects/mtg/Makefile @@ -6,7 +6,7 @@ OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o\ objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\ objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\ objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\ - objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\ + objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\ objs/GameObserver.o objs/GameOptions.o objs/GameState.o\ objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\ objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\ @@ -128,7 +128,7 @@ clean: endif define compile -$(CXX) -c $(CXXFLAGS) $< -o $@ +$(CXX) -c $(CXXFLAGS) $< -o $@ endef PrecompiledHeader.h.gch: ../../projects/mtg/include/PrecompiledHeader.h From b078dd1f6a4641a9cfc135f92745b078e06a869c Mon Sep 17 00:00:00 2001 From: Tobias Loose Date: Tue, 11 Mar 2014 17:31:25 +0100 Subject: [PATCH 4/4] Fix android makefile --- projects/mtg/Android/jni/Android.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/mtg/Android/jni/Android.mk b/projects/mtg/Android/jni/Android.mk index 31f425266..563b80b63 100644 --- a/projects/mtg/Android/jni/Android.mk +++ b/projects/mtg/Android/jni/Android.mk @@ -57,7 +57,6 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \ $(MTG_PATH)/src/DeckMetaData.cpp \ $(MTG_PATH)/src/DeckStats.cpp \ $(MTG_PATH)/src/DuelLayers.cpp \ - $(MTG_PATH)/src/Effects.cpp \ $(MTG_PATH)/src/ExtraCost.cpp \ $(MTG_PATH)/src/GameApp.cpp \ $(MTG_PATH)/src/GameLauncher.cpp \