diff --git a/client/makefile b/client/makefile index 06f6b50..218f19d 100644 --- a/client/makefile +++ b/client/makefile @@ -1,5 +1,5 @@ #config -COMMONDIR+=../common ../common/mapsystem +COMMONDIR+=../common ../common/map ../common/network ../common/ui COMMON+=../libcommon.a LIB+=$(COMMON) -lmingw32 -lSDLmain -lSDL -llua -lsqlite3 CXXFLAGS+=-std=c++11 -DDEBUG $(addprefix -I,$(COMMONDIR)) diff --git a/common/makefile b/common/makefile index 0d0176e..da39ca9 100644 --- a/common/makefile +++ b/common/makefile @@ -19,7 +19,9 @@ OUT=$(addprefix $(OUTDIR)/,libcommon.a) #targets all: $(OBJ) $(OUT) ar -crs $(OUT) $(OBJ) - $(MAKE) -C mapsystem + $(MAKE) -C map + $(MAKE) -C network + $(MAKE) -C ui $(OBJ): | $(OBJDIR) diff --git a/common/mapsystem/makefile b/common/map/makefile similarity index 100% rename from common/mapsystem/makefile rename to common/map/makefile diff --git a/common/mapsystem/region.cpp b/common/map/region.cpp similarity index 100% rename from common/mapsystem/region.cpp rename to common/map/region.cpp diff --git a/common/mapsystem/region.hpp b/common/map/region.hpp similarity index 100% rename from common/mapsystem/region.hpp rename to common/map/region.hpp diff --git a/common/mapsystem/region_pager.cpp b/common/map/region_pager.cpp similarity index 100% rename from common/mapsystem/region_pager.cpp rename to common/map/region_pager.cpp diff --git a/common/mapsystem/region_pager.hpp b/common/map/region_pager.hpp similarity index 100% rename from common/mapsystem/region_pager.hpp rename to common/map/region_pager.hpp diff --git a/common/mapsystem/tile.cpp b/common/map/tile.cpp similarity index 100% rename from common/mapsystem/tile.cpp rename to common/map/tile.cpp diff --git a/common/mapsystem/tile.hpp b/common/map/tile.hpp similarity index 100% rename from common/mapsystem/tile.hpp rename to common/map/tile.hpp diff --git a/common/mapsystem/tile_sheet.cpp b/common/map/tile_sheet.cpp similarity index 100% rename from common/mapsystem/tile_sheet.cpp rename to common/map/tile_sheet.cpp diff --git a/common/mapsystem/tile_sheet.hpp b/common/map/tile_sheet.hpp similarity index 100% rename from common/mapsystem/tile_sheet.hpp rename to common/map/tile_sheet.hpp diff --git a/common/mapsystem/tile_sheet_manager.cpp b/common/map/tile_sheet_manager.cpp similarity index 100% rename from common/mapsystem/tile_sheet_manager.cpp rename to common/map/tile_sheet_manager.cpp diff --git a/common/mapsystem/tile_sheet_manager.hpp b/common/map/tile_sheet_manager.hpp similarity index 100% rename from common/mapsystem/tile_sheet_manager.hpp rename to common/map/tile_sheet_manager.hpp diff --git a/common/mapsystem/map_loader.cpp b/common/mapsystem/map_loader.cpp deleted file mode 100644 index 1e5d718..0000000 --- a/common/mapsystem/map_loader.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2013 - * - * 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. -*/ -#include "map_loader.hpp" - -#include "utility.hpp" - -#include -#include - -void loadGameMap(std::string mapPathName, RegionPager* const, TileSheetManager* const) { - // -} - -void saveGameMap(std::string mapPathName, RegionPager* const, TileSheetManager* const) { - // -} \ No newline at end of file diff --git a/common/mapsystem/map_loader.hpp b/common/mapsystem/map_loader.hpp deleted file mode 100644 index adfb5b4..0000000 --- a/common/mapsystem/map_loader.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2013 - * - * 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 MAPLOADER_HPP_ -#define MAPLOADER_HPP_ - -#include "region_pager.hpp" -#include "tile_sheet_manager.hpp" - -#include - -/* Given the map name and pointers to containers, this is a generic loading system -*/ -void loadGameMap(std::string mapPathName, RegionPager* const, TileSheetManager* const); -void saveGameMap(std::string mapPathName, RegionPager* const, TileSheetManager* const); - -#endif diff --git a/common/network/makefile b/common/network/makefile new file mode 100644 index 0000000..85c3910 --- /dev/null +++ b/common/network/makefile @@ -0,0 +1,44 @@ +#config +COMMONDIR+=.. +COMMON+=../../libcommon.a +LIB+= +CXXFLAGS+=-std=c++11 -DDEBUG $(addprefix -I,$(COMMONDIR)) +CFLAGS+=-DDEBUG $(addprefix -I,$(COMMONDIR)) + +#source +CXXSRC=$(wildcard *.cpp) +CSRC=$(wildcard *.c) + +#objects +OBJDIR=obj +OBJ+=$(addprefix $(OBJDIR)/,$(CXXSRC:.cpp=.o)) +OBJ+=$(addprefix $(OBJDIR)/,$(CSRC:.c=.o)) + +#output +OUTDIR=../.. +OUT=$(addprefix $(OUTDIR)/,libcommon.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 $@ $< + +$(OBJDIR)/%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +clean: + $(RM) *.o *.a *.exe + +rebuild: clean all diff --git a/common/network_packet.hpp b/common/network/network_packet.hpp similarity index 100% rename from common/network_packet.hpp rename to common/network/network_packet.hpp diff --git a/common/udp_network_utility.cpp b/common/network/udp_network_utility.cpp similarity index 100% rename from common/udp_network_utility.cpp rename to common/network/udp_network_utility.cpp diff --git a/common/udp_network_utility.hpp b/common/network/udp_network_utility.hpp similarity index 100% rename from common/udp_network_utility.hpp rename to common/network/udp_network_utility.hpp diff --git a/common/button.cpp b/common/ui/button.cpp similarity index 100% rename from common/button.cpp rename to common/ui/button.cpp diff --git a/common/button.hpp b/common/ui/button.hpp similarity index 100% rename from common/button.hpp rename to common/ui/button.hpp diff --git a/common/ui/makefile b/common/ui/makefile new file mode 100644 index 0000000..85c3910 --- /dev/null +++ b/common/ui/makefile @@ -0,0 +1,44 @@ +#config +COMMONDIR+=.. +COMMON+=../../libcommon.a +LIB+= +CXXFLAGS+=-std=c++11 -DDEBUG $(addprefix -I,$(COMMONDIR)) +CFLAGS+=-DDEBUG $(addprefix -I,$(COMMONDIR)) + +#source +CXXSRC=$(wildcard *.cpp) +CSRC=$(wildcard *.c) + +#objects +OBJDIR=obj +OBJ+=$(addprefix $(OBJDIR)/,$(CXXSRC:.cpp=.o)) +OBJ+=$(addprefix $(OBJDIR)/,$(CSRC:.c=.o)) + +#output +OUTDIR=../.. +OUT=$(addprefix $(OUTDIR)/,libcommon.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 $@ $< + +$(OBJDIR)/%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +clean: + $(RM) *.o *.a *.exe + +rebuild: clean all diff --git a/common/menu_bar.cpp b/common/ui/menu_bar.cpp similarity index 100% rename from common/menu_bar.cpp rename to common/ui/menu_bar.cpp diff --git a/common/menu_bar.hpp b/common/ui/menu_bar.hpp similarity index 100% rename from common/menu_bar.hpp rename to common/ui/menu_bar.hpp diff --git a/common/raster_font.cpp b/common/ui/raster_font.cpp similarity index 100% rename from common/raster_font.cpp rename to common/ui/raster_font.cpp diff --git a/common/raster_font.hpp b/common/ui/raster_font.hpp similarity index 100% rename from common/raster_font.hpp rename to common/ui/raster_font.hpp diff --git a/editor/makefile b/editor/makefile index c194503..b787db3 100644 --- a/editor/makefile +++ b/editor/makefile @@ -1,5 +1,5 @@ #config -COMMONDIR+=../common ../common/mapsystem +COMMONDIR+=../common ../common/map ../common/network ../common/ui COMMON+=../libcommon.a LIB+=$(COMMON) -lmingw32 -lSDLmain -lSDL -llua -lsqlite3 CXXFLAGS+=-std=c++11 -DDEBUG $(addprefix -I,$(COMMONDIR)) diff --git a/server/makefile b/server/makefile index 0948f34..387cf39 100644 --- a/server/makefile +++ b/server/makefile @@ -1,5 +1,5 @@ #config -COMMONDIR+=../common ../common/mapsystem +COMMONDIR+=../common ../common/map ../common/network ../common/ui COMMON+=../libcommon.a LIB+=$(COMMON) -lSDL_net -lwsock32 -liphlpapi -lmingw32 -lSDLmain -lSDL -llua -lsqlite3 CXXFLAGS+=-std=c++11 -DDEBUG $(addprefix -I,$(COMMONDIR))