From 7c4762852bfaefd26f7ee3b882b179f7a0d3179a Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 10 Oct 2014 06:16:31 +1100 Subject: [PATCH] Moved Renderable and Character into Renderable/ --- .../base_character.cpp} | 10 ----- .../base_character.hpp} | 6 --- client/renderable/makefile | 37 +++++++++++++++++++ client/{ => renderable}/renderable.cpp | 0 client/{ => renderable}/renderable.hpp | 0 common/gameplay/combat_defines.hpp | 34 ----------------- 6 files changed, 37 insertions(+), 50 deletions(-) rename client/{character.cpp => renderable/base_character.cpp} (88%) rename client/{character.hpp => renderable/base_character.hpp} (96%) create mode 100644 client/renderable/makefile rename client/{ => renderable}/renderable.cpp (100%) rename client/{ => renderable}/renderable.hpp (100%) delete mode 100644 common/gameplay/combat_defines.hpp diff --git a/client/character.cpp b/client/renderable/base_character.cpp similarity index 88% rename from client/character.cpp rename to client/renderable/base_character.cpp index 5970adc..71cc13a 100644 --- a/client/character.cpp +++ b/client/renderable/base_character.cpp @@ -21,16 +21,6 @@ */ #include "character.hpp" -void Character::Update() { - if (motion.x && motion.y) { - origin += motion * CHARACTER_WALKING_MOD; - } - else if (motion != 0) { - origin += motion; - } - sprite.Update(0.016); -} - void Character::CorrectSprite() { //NOTE: These must correspond to the sprite sheet in use if (motion.y > 0) { diff --git a/client/character.hpp b/client/renderable/base_character.hpp similarity index 96% rename from client/character.hpp rename to client/renderable/base_character.hpp index 1178495..cd9fc43 100644 --- a/client/character.hpp +++ b/client/renderable/base_character.hpp @@ -36,16 +36,12 @@ public: Character() = default; ~Character() = default; - void Update() override; - //graphics void CorrectSprite(); //gameplay Statistics* GetStats() { return &stats; } - //accessors and mutators - //metadata int SetOwner(int i) { return owner = i; } int GetOwner() { return owner; } @@ -54,8 +50,6 @@ public: std::string SetAvatar(std::string s) { return avatar = s; } std::string GetAvatar() const { return avatar; } - //position - private: //base statistics Statistics stats; diff --git a/client/renderable/makefile b/client/renderable/makefile new file mode 100644 index 0000000..f8d8358 --- /dev/null +++ b/client/renderable/makefile @@ -0,0 +1,37 @@ +#config +INCLUDES+=. .. ../../common/gameplay ../../common/graphics ../../common/map ../../common/network ../../common/network/packet_types ../../common/ui ../../common/utilities +LIBS+= +CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES)) + +#source +CXXSRC=$(wildcard *.cpp) + +#objects +OBJDIR=obj +OBJ+=$(addprefix $(OBJDIR)/,$(CXXSRC:.cpp=.o)) + +#output +OUTDIR=.. +OUT=$(addprefix $(OUTDIR)/,client.a) + +#targets +all: $(OBJ) $(OUT) + ar -crs $(OUT) $(OBJ) + +$(OBJ): | $(OBJDIR) + +$(OUT): | $(OUTDIR) + +$(OBJDIR): + mkdir $(OBJDIR) + +$(OUTDIR): + mkdir $(OUTDIR) + +$(OBJDIR)/%.o: %.cpp + $(CXX) $(CXXFLAGS) -c -o $@ $< + +clean: + $(RM) *.o *.a *.exe + +rebuild: clean all diff --git a/client/renderable.cpp b/client/renderable/renderable.cpp similarity index 100% rename from client/renderable.cpp rename to client/renderable/renderable.cpp diff --git a/client/renderable.hpp b/client/renderable/renderable.hpp similarity index 100% rename from client/renderable.hpp rename to client/renderable/renderable.hpp diff --git a/common/gameplay/combat_defines.hpp b/common/gameplay/combat_defines.hpp deleted file mode 100644 index db6421c..0000000 --- a/common/gameplay/combat_defines.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2014 - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source - * distribution. -*/ -#ifndef COMBATDEFINES_HPP_ -#define COMBATDEFINES_HPP_ - -#define COMBAT_MAX_CHARACTERS 16 -#define COMBAT_MAX_ENEMIES 16 - -enum class TerrainType { - NONE = 0, - GRASSLANDS, - //etc. -}; - -#endif