https://github.com/libsdl-org/Maelstrom/commit/5ecd9527a1f33267d46cc31f8fb0b480ca3469ec
From 5ecd9527a1f33267d46cc31f8fb0b480ca3469ec Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 9 Nov 2011 01:17:38 -0500
Subject: [PATCH] Moved the game code to the game directory to clean things up
a little bit.
---
MaelstromLobby.cpp | 4 +-
Makefile.am | 50 +-
Makefile.in | 71 +--
configure | 4 +-
configure.in | 2 +-
MacDialog.cpp => game/MacDialog.cpp | 10 +-
MacDialog.h => game/MacDialog.h | 4 +-
Maelstrom.h => game/Maelstrom.h | 5 -
MaelstromUI.cpp => game/MaelstromUI.cpp | 18 +-
MaelstromUI.h => game/MaelstromUI.h | 4 +-
.../Maelstrom_Globals.h | 12 +-
game/Makefile.am | 52 ++
{netlogic => game}/Makefile.in | 74 ++-
{netlogic => game}/about.cpp | 2 +-
{netlogic => game}/about.h | 2 +-
colortable.h => game/colortable.h | 0
controls.cpp => game/controls.cpp | 6 +-
controls.h => game/controls.h | 2 +-
fastrand.cpp => game/fastrand.cpp | 0
fastrand.h => game/fastrand.h | 0
{netlogic => game}/game.cpp | 4 +-
{netlogic => game}/game.h | 0
{netlogic => game}/gameinfo.cpp | 2 +-
{netlogic => game}/gameinfo.h | 0
{netlogic => game}/globals.h | 0
init.cpp => game/init.cpp | 2 +-
init.h => game/init.h | 0
load.cpp => game/load.cpp | 0
load.h => game/load.h | 4 +-
{netlogic => game}/lobby.cpp | 2 +-
{netlogic => game}/lobby.h | 0
{netlogic => game}/logic.cpp | 2 +-
logic.h => game/logic.h | 2 +-
game/main.cpp | 528 ++++++++++++++++++
main.h => game/main.h | 0
{netlogic => game}/make.cpp | 2 +-
{netlogic => game}/make.h | 0
myerror.cpp => game/myerror.cpp | 0
myerror.h => game/myerror.h | 0
{netlogic => game}/netlogic.h | 0
{netlogic => game}/netplay.cpp | 2 +-
{netlogic => game}/netplay.h | 0
{netlogic => game}/object.cpp | 2 +-
{netlogic => game}/object.h | 0
{netlogic => game}/objects.cpp | 2 +-
{netlogic => game}/objects.h | 0
{netlogic => game}/packet.h | 0
{netlogic => game}/player.cpp | 2 +-
{netlogic => game}/player.h | 0
{netlogic => game}/protocol.h | 0
rect.cpp => game/rect.cpp | 0
rect.h => game/rect.h | 0
scores.cpp => game/scores.cpp | 0
scores.h => game/scores.h | 0
{netlogic => game}/shinobi.h | 0
main.cpp | 525 +----------------
netlogic/Makefile.am | 27 -
utils/Makefile.am | 15 +-
utils/Makefile.in | 15 +-
59 files changed, 735 insertions(+), 725 deletions(-)
rename MacDialog.cpp => game/MacDialog.cpp (98%)
rename MacDialog.h => game/MacDialog.h (97%)
rename Maelstrom.h => game/Maelstrom.h (93%)
rename MaelstromUI.cpp => game/MaelstromUI.cpp (97%)
rename MaelstromUI.h => game/MaelstromUI.h (97%)
rename Maelstrom_Globals.h => game/Maelstrom_Globals.h (95%)
create mode 100644 game/Makefile.am
rename {netlogic => game}/Makefile.in (86%)
rename {netlogic => game}/about.cpp (98%)
rename {netlogic => game}/about.h (97%)
rename colortable.h => game/colortable.h (100%)
rename controls.cpp => game/controls.cpp (98%)
rename controls.h => game/controls.h (98%)
rename fastrand.cpp => game/fastrand.cpp (100%)
rename fastrand.h => game/fastrand.h (100%)
rename {netlogic => game}/game.cpp (99%)
rename {netlogic => game}/game.h (100%)
rename {netlogic => game}/gameinfo.cpp (99%)
rename {netlogic => game}/gameinfo.h (100%)
rename {netlogic => game}/globals.h (100%)
rename init.cpp => game/init.cpp (99%)
rename init.h => game/init.h (100%)
rename load.cpp => game/load.cpp (100%)
rename load.h => game/load.h (93%)
rename {netlogic => game}/lobby.cpp (99%)
rename {netlogic => game}/lobby.h (100%)
rename {netlogic => game}/logic.cpp (97%)
rename logic.h => game/logic.h (97%)
create mode 100644 game/main.cpp
rename main.h => game/main.h (100%)
rename {netlogic => game}/make.cpp (99%)
rename {netlogic => game}/make.h (100%)
rename myerror.cpp => game/myerror.cpp (100%)
rename myerror.h => game/myerror.h (100%)
rename {netlogic => game}/netlogic.h (100%)
rename {netlogic => game}/netplay.cpp (99%)
rename {netlogic => game}/netplay.h (100%)
rename {netlogic => game}/object.cpp (98%)
rename {netlogic => game}/object.h (100%)
rename {netlogic => game}/objects.cpp (99%)
rename {netlogic => game}/objects.h (100%)
rename {netlogic => game}/packet.h (100%)
rename {netlogic => game}/player.cpp (99%)
rename {netlogic => game}/player.h (100%)
rename {netlogic => game}/protocol.h (100%)
rename rect.cpp => game/rect.cpp (100%)
rename rect.h => game/rect.h (100%)
rename scores.cpp => game/scores.cpp (100%)
rename scores.h => game/scores.h (100%)
rename {netlogic => game}/shinobi.h (100%)
delete mode 100644 netlogic/Makefile.am
diff --git a/MaelstromLobby.cpp b/MaelstromLobby.cpp
index d2d68b77..e8cdafff 100644
--- a/MaelstromLobby.cpp
+++ b/MaelstromLobby.cpp
@@ -22,8 +22,8 @@
#include "SDL_net.h"
-#include "netlogic/packet.h"
-#include "netlogic/protocol.h"
+#include "game/packet.h"
+#include "game/protocol.h"
#include "utils/array.h"
diff --git a/Makefile.am b/Makefile.am
index 2a2df79e..981132b2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,34 +3,10 @@
bin_PROGRAMS = Maelstrom
noinst_PROGRAMS = MaelstromLobby
-Maelstrom_SOURCES = \
- Maelstrom.h \
- Maelstrom_Globals.h \
- MaelstromUI.cpp \
- MaelstromUI.h \
- MacDialog.cpp \
- MacDialog.h \
- buttonlist.h \
- colortable.h \
- controls.cpp \
- controls.h \
- fastrand.cpp \
- fastrand.h \
- init.cpp \
- load.cpp \
- load.h \
- logic.h \
- main.cpp \
- main.h \
- myerror.cpp \
- myerror.h \
- rect.cpp \
- rect.h \
- scores.cpp \
- scores.h
+Maelstrom_SOURCES = main.cpp
Maelstrom_LDADD = \
- netlogic/liblogic.a \
+ game/libgame.a \
screenlib/libSDLscreen.a \
maclib/libSDLmac.a \
utils/libutils.a \
@@ -40,26 +16,26 @@ MaelstromLobby_SOURCES = MaelstromLobby.cpp
MaelstromLobby_LDADD = @INETLIB@
-SUBDIRS = netlogic screenlib maclib utils
+SUBDIRS = game screenlib maclib utils
EXTRA_DIST = \
- autogen.sh \
- VisualC.zip \
- PBProjects.tar.gz \
- MPWmake.sea.bin \
+ Docs \
+ COPYING \
+ COPYING.GPL \
CREDITS \
Changelog \
- Docs \
+ MPWmake.sea.bin \
+ Maelstrom.spec \
+ Maelstrom_Data.zip \
+ PBProjects.tar.gz \
README.joystick \
README.network \
README.options \
README.simple \
- COPYING \
- COPYING.GPL \
- Maelstrom_Data.zip \
+ VisualC.zip \
+ autogen.sh \
ico_o \
- icon.xpm \
- Maelstrom.spec
+ icon.xpm
DIST_SUBDIRS = $(SUBDIRS)
diff --git a/Makefile.in b/Makefile.in
index 3ea8f89f..a3df31d1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -52,12 +52,9 @@ CONFIG_CLEAN_FILES = Maelstrom.spec
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
-am_Maelstrom_OBJECTS = MaelstromUI.$(OBJEXT) MacDialog.$(OBJEXT) \
- controls.$(OBJEXT) fastrand.$(OBJEXT) init.$(OBJEXT) \
- load.$(OBJEXT) main.$(OBJEXT) myerror.$(OBJEXT) rect.$(OBJEXT) \
- scores.$(OBJEXT)
+am_Maelstrom_OBJECTS = main.$(OBJEXT)
Maelstrom_OBJECTS = $(am_Maelstrom_OBJECTS)
-Maelstrom_DEPENDENCIES = netlogic/liblogic.a screenlib/libSDLscreen.a \
+Maelstrom_DEPENDENCIES = game/libgame.a screenlib/libSDLscreen.a \
maclib/libSDLmac.a utils/libutils.a
am_MaelstromLobby_OBJECTS = MaelstromLobby.$(OBJEXT)
MaelstromLobby_OBJECTS = $(am_MaelstromLobby_OBJECTS)
@@ -70,10 +67,6 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(Maelstrom_SOURCES) $(MaelstromLobby_SOURCES)
DIST_SOURCES = $(Maelstrom_SOURCES) $(MaelstromLobby_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -203,34 +196,9 @@ target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-Maelstrom_SOURCES = \
- Maelstrom.h \
- Maelstrom_Globals.h \
- MaelstromUI.cpp \
- MaelstromUI.h \
- MacDialog.cpp \
- MacDialog.h \
- buttonlist.h \
- colortable.h \
- controls.cpp \
- controls.h \
- fastrand.cpp \
- fastrand.h \
- init.cpp \
- load.cpp \
- load.h \
- logic.h \
- main.cpp \
- main.h \
- myerror.cpp \
- myerror.h \
- rect.cpp \
- rect.h \
- scores.cpp \
- scores.h
-
+Maelstrom_SOURCES = main.cpp
Maelstrom_LDADD = \
- netlogic/liblogic.a \
+ game/libgame.a \
screenlib/libSDLscreen.a \
maclib/libSDLmac.a \
utils/libutils.a \
@@ -238,25 +206,25 @@ Maelstrom_LDADD = \
MaelstromLobby_SOURCES = MaelstromLobby.cpp
MaelstromLobby_LDADD = @INETLIB@
-SUBDIRS = netlogic screenlib maclib utils
+SUBDIRS = game screenlib maclib utils
EXTRA_DIST = \
- autogen.sh \
- VisualC.zip \
- PBProjects.tar.gz \
- MPWmake.sea.bin \
+ Docs \
+ COPYING \
+ COPYING.GPL \
CREDITS \
Changelog \
- Docs \
+ MPWmake.sea.bin \
+ Maelstrom.spec \
+ Maelstrom_Data.zip \
+ PBProjects.tar.gz \
README.joystick \
README.network \
README.options \
README.simple \
- COPYING \
- COPYING.GPL \
- Maelstrom_Data.zip \
+ VisualC.zip \
+ autogen.sh \
ico_o \
- icon.xpm \
- Maelstrom.spec
+ icon.xpm
DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive
@@ -337,17 +305,8 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MacDialog.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MaelstromLobby.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MaelstromUI.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/controls.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fastrand.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/myerror.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rect.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scores.Po@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/configure b/configure
index 13f6a037..b87efd00 100755
--- a/configure
+++ b/configure
@@ -4624,7 +4624,7 @@ esac
CXXFLAGS="$CXXFLAGS $CFLAGS"
# Finally create all the generated files
-ac_config_files="$ac_config_files Makefile netlogic/Makefile screenlib/Makefile maclib/Makefile utils/Makefile Maelstrom.spec"
+ac_config_files="$ac_config_files Makefile game/Makefile screenlib/Makefile maclib/Makefile utils/Makefile Maelstrom.spec"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -5227,7 +5227,7 @@ do
case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "netlogic/Makefile") CONFIG_FILES="$CONFIG_FILES netlogic/Makefile" ;;
+ "game/Makefile") CONFIG_FILES="$CONFIG_FILES game/Makefile" ;;
"screenlib/Makefile") CONFIG_FILES="$CONFIG_FILES screenlib/Makefile" ;;
"maclib/Makefile") CONFIG_FILES="$CONFIG_FILES maclib/Makefile" ;;
"utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;;
diff --git a/configure.in b/configure.in
index e2cde2e2..87a281a7 100644
--- a/configure.in
+++ b/configure.in
@@ -110,7 +110,7 @@ CXXFLAGS="$CXXFLAGS $CFLAGS"
# Finally create all the generated files
AC_OUTPUT([
Makefile
-netlogic/Makefile
+game/Makefile
screenlib/Makefile
maclib/Makefile
utils/Makefile
diff --git a/MacDialog.cpp b/game/MacDialog.cpp
similarity index 98%
rename from MacDialog.cpp
rename to game/MacDialog.cpp
index 78b2dd04..dd6774a2 100644
--- a/MacDialog.cpp
+++ b/game/MacDialog.cpp
@@ -20,11 +20,11 @@
slouken@libsdl.org
*/
-#include "screenlib/SDL_FrameBuf.h"
-#include "screenlib/UIDialogButton.h"
-#include "screenlib/UIElementCheckbox.h"
-#include "screenlib/UIElementEditbox.h"
-#include "screenlib/UIElementRadio.h"
+#include "../screenlib/SDL_FrameBuf.h"
+#include "../screenlib/UIDialogButton.h"
+#include "../screenlib/UIElementCheckbox.h"
+#include "../screenlib/UIElementEditbox.h"
+#include "../screenlib/UIElementRadio.h"
#include "MacDialog.h"
diff --git a/MacDialog.h b/game/MacDialog.h
similarity index 97%
rename from MacDialog.h
rename to game/MacDialog.h
index ef3598b2..03dc4617 100644
--- a/MacDialog.h
+++ b/game/MacDialog.h
@@ -23,8 +23,8 @@
#ifndef _MacDialog_h
#define _MacDialog_h
-#include "screenlib/UIDialog.h"
-#include "screenlib/UIDrawEngine.h"
+#include "../screenlib/UIDialog.h"
+#include "../screenlib/UIDrawEngine.h"
class MacDialog : public UIDialog
{
diff --git a/Maelstrom.h b/game/Maelstrom.h
similarity index 93%
rename from Maelstrom.h
rename to game/Maelstrom.h
index 857eefd9..1df6713a 100644
--- a/Maelstrom.h
+++ b/game/Maelstrom.h
@@ -21,11 +21,6 @@
*/
/* Definitions useful for our sprite world */
-/* Definitions that are particular to a particular logic module are
- in "logicdir/logicdir.h", i.e. netlogic/netlogic.h
- Note especially that this includes timing constants, etc.
-*/
-
#include "rect.h"
diff --git a/MaelstromUI.cpp b/game/MaelstromUI.cpp
similarity index 97%
rename from MaelstromUI.cpp
rename to game/MaelstromUI.cpp
index 0a21a353..c6a3e0a1 100644
--- a/MaelstromUI.cpp
+++ b/game/MaelstromUI.cpp
@@ -25,16 +25,16 @@
#include "main.h"
#include "load.h"
#include "controls.h"
-#include "netlogic/about.h"
-#include "netlogic/game.h"
-#include "netlogic/lobby.h"
+#include "about.h"
+#include "game.h"
+#include "lobby.h"
#include "MacDialog.h"
-#include "screenlib/UIElementButton.h"
-#include "screenlib/UIElementCheckbox.h"
-#include "screenlib/UIElementEditbox.h"
-#include "screenlib/UIElementRadio.h"
-#include "screenlib/UIDialogButton.h"
-#include "utils/hashtable.h"
+#include "../screenlib/UIElementButton.h"
+#include "../screenlib/UIElementCheckbox.h"
+#include "../screenlib/UIElementEditbox.h"
+#include "../screenlib/UIElementRadio.h"
+#include "../screenlib/UIDialogButton.h"
+#include "../utils/hashtable.h"
static void
diff --git a/MaelstromUI.h b/game/MaelstromUI.h
similarity index 97%
rename from MaelstromUI.h
rename to game/MaelstromUI.h
index 30e103be..6cd48cbd 100644
--- a/MaelstromUI.h
+++ b/game/MaelstromUI.h
@@ -22,8 +22,8 @@
#include "Maelstrom_Globals.h"
-#include "screenlib/UIManager.h"
-#include "screenlib/UIDrawEngine.h"
+#include "../screenlib/UIManager.h"
+#include "../screenlib/UIDrawEngine.h"
class HashTable;
diff --git a/Maelstrom_Globals.h b/game/Maelstrom_Globals.h
similarity index 95%
rename from Maelstrom_Globals.h
rename to game/Maelstrom_Globals.h
index a8757b6c..f641da9e 100644
--- a/Maelstrom_Globals.h
+++ b/game/Maelstrom_Globals.h
@@ -25,14 +25,14 @@
#include <stdlib.h>
-#include "screenlib/SDL_FrameBuf.h"
-#include "screenlib/UIManager.h"
+#include "../screenlib/SDL_FrameBuf.h"
+#include "../screenlib/UIManager.h"
-#include "maclib/Mac_FontServ.h"
-#include "maclib/Mac_Sound.h"
-#include "maclib/Mac_Compat.h"
+#include "../maclib/Mac_FontServ.h"
+#include "../maclib/Mac_Sound.h"
+#include "../maclib/Mac_Compat.h"
-#include "utils/prefs.h"
+#include "../utils/prefs.h"
#include "Maelstrom.h"
diff --git a/game/Makefile.am b/game/Makefile.am
new file mode 100644
index 00000000..90bec181
--- /dev/null
+++ b/game/Makefile.am
@@ -0,0 +1,52 @@
+
+noinst_LIBRARIES = libgame.a
+
+libgame_a_SOURCES = \
+ MacDialog.cpp \
+ MacDialog.h \
+ Maelstrom.h \
+ MaelstromUI.cpp \
+ MaelstromUI.h \
+ Maelstrom_Globals.h \
+ about.cpp \
+ about.h \
+ colortable.h \
+ controls.cpp \
+ controls.h \
+ fastrand.cpp \
+ fastrand.h \
+ game.cpp \
+ game.h \
+ gameinfo.cpp \
+ gameinfo.h \
+ globals.h \
+ init.cpp \
+ init.h \
+ load.cpp \
+ load.h \
+ lobby.cpp \
+ lobby.h \
+ logic.cpp \
+ logic.h \
+ main.cpp \
+ main.h \
+ make.cpp \
+ make.h \
+ myerror.cpp \
+ myerror.h \
+ netlogic.h \
+ netplay.cpp \
+ netplay.h \
+ object.cpp \
+ object.h \
+ objects.cpp \
+ objects.h \
+ packet.h \
+ player.cpp \
+ player.h \
+ protocol.h \
+ rect.cpp \
+ rect.h \
+ scores.cpp \
+ scores.h \
+ shinobi.h
diff --git a/netlogic/Makefile.in b/game/Makefile.in
similarity index 86%
rename from netlogic/Makefile.in
rename to game/Makefile.in
index d6668a96..68258299 100644
--- a/netlogic/Makefile.in
+++ b/game/Makefile.in
@@ -33,7 +33,7 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-subdir = netlogic
+subdir = game
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
@@ -45,13 +45,16 @@ CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
AR = ar
ARFLAGS = cru
-liblogic_a_AR = $(AR) $(ARFLAGS)
-liblogic_a_LIBADD =
-am_liblogic_a_OBJECTS = about.$(OBJEXT) game.$(OBJEXT) \
- gameinfo.$(OBJEXT) lobby.$(OBJEXT) logic.$(OBJEXT) \
- make.$(OBJEXT) netplay.$(OBJEXT) object.$(OBJEXT) \
- objects.$(OBJEXT) player.$(OBJEXT)
-liblogic_a_OBJECTS = $(am_liblogic_a_OBJECTS)
+libgame_a_AR = $(AR) $(ARFLAGS)
+libgame_a_LIBADD =
+am_libgame_a_OBJECTS = MacDialog.$(OBJEXT) MaelstromUI.$(OBJEXT) \
+ about.$(OBJEXT) controls.$(OBJEXT) fastrand.$(OBJEXT) \
+ game.$(OBJEXT) gameinfo.$(OBJEXT) init.$(OBJEXT) \
+ load.$(OBJEXT) lobby.$(OBJEXT) logic.$(OBJEXT) main.$(OBJEXT) \
+ make.$(OBJEXT) myerror.$(OBJEXT) netplay.$(OBJEXT) \
+ object.$(OBJEXT) objects.$(OBJEXT) player.$(OBJEXT) \
+ rect.$(OBJEXT) scores.$(OBJEXT)
+libgame_a_OBJECTS = $(am_libgame_a_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -64,8 +67,8 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(liblogic_a_SOURCES)
-DIST_SOURCES = $(liblogic_a_SOURCES)
+SOURCES = $(libgame_a_SOURCES)
+DIST_SOURCES = $(libgame_a_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -174,19 +177,40 @@ target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-noinst_LIBRARIES = liblogic.a
-liblogic_a_SOURCES = \
+noinst_LIBRARIES = libgame.a
+libgame_a_SOURCES = \
+ MacDialog.cpp \
+ MacDialog.h \
+ Maelstrom.h \
+ MaelstromUI.cpp \
+ MaelstromUI.h \
+ Maelstrom_Globals.h \
about.cpp \
+ about.h \
+ colortable.h \
+ controls.cpp \
+ controls.h \
+ fastrand.cpp \
+ fastrand.h \
game.cpp \
game.h \
gameinfo.cpp \
gameinfo.h \
globals.h \
+ init.cpp \
+ init.h \
+ load.cpp \
+ load.h \
lobby.cpp \
lobby.h \
logic.cpp \
+ logic.h \
+ main.cpp \
+ main.h \
make.cpp \
make.h \
+ myerror.cpp \
+ myerror.h \
netlogic.h \
netplay.cpp \
netplay.h \
@@ -198,6 +222,10 @@ liblogic_a_SOURCES = \
player.cpp \
player.h \
protocol.h \
+ rect.cpp \
+ rect.h \
+ scores.cpp \
+ scores.h \
shinobi.h
all: all-am
@@ -213,9 +241,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign netlogic/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign game/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign netlogic/Makefile
+ $(AUTOMAKE) --foreign game/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -236,10 +264,10 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-liblogic.a: $(liblogic_a_OBJECTS) $(liblogic_a_DEPENDENCIES)
- -rm -f liblogic.a
- $(liblogic_a_AR) liblogic.a $(liblogic_a_OBJECTS) $(liblogic_a_LIBADD)
- $(RANLIB) liblogic.a
+libgame.a: $(libgame_a_OBJECTS) $(libgame_a_DEPENDENCIES)
+ -rm -f libgame.a
+ $(libgame_a_AR) libgame.a $(libgame_a_OBJECTS) $(libgame_a_LIBADD)
+ $(RANLIB) libgame.a
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -247,16 +275,26 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MacDialog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MaelstromUI.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/about.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/controls.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fastrand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/game.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gameinfo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lobby.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logic.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/make.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/myerror.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netplay.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objects.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rect.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scores.Po@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/netlogic/about.cpp b/game/about.cpp
similarity index 98%
rename from netlogic/about.cpp
rename to game/about.cpp
index 4fb9d881..e207dc56 100644
--- a/netlogic/about.cpp
+++ b/game/about.cpp
@@ -20,7 +20,7 @@
slouken@libsdl.org
*/
-#include "../Maelstrom_Globals.h"
+#include "Maelstrom_Globals.h"
#include "object.h"
#include "about.h"
diff --git a/netlogic/about.h b/game/about.h
similarity index 97%
rename from netlogic/about.h
rename to game/about.h
index f523ad4b..8d610a9a 100644
--- a/netlogic/about.h
+++ b/game/about.h
@@ -23,7 +23,7 @@
#ifndef _about_h
#define _about_h
-#include "../Maelstrom_Globals.h"
+#include "Maelstrom_Globals.h"
class Object;
diff --git a/colortable.h b/game/colortable.h
similarity index 100%
rename from colortable.h
rename to game/colortable.h
diff --git a/controls.cpp b/game/controls.cpp
similarity index 98%
rename from controls.cpp
rename to game/controls.cpp
index 0b558902..58f89a6a 100644
--- a/controls.cpp
+++ b/game/controls.cpp
@@ -28,9 +28,9 @@
#include "Maelstrom_Globals.h"
#include "load.h"
-#include "screenlib/UIDialog.h"
-#include "screenlib/UIElement.h"
-#include "screenlib/UIElementRadio.h"
+#include "../screenlib/UIDialog.h"
+#include "../screenlib/UIElement.h"
+#include "../screenlib/UIElementRadio.h"
#define MAELSTROM_DATA ".Maelstrom-data"
diff --git a/controls.h b/game/controls.h
similarity index 98%
rename from controls.h
rename to game/controls.h
index 1d811b35..55c3977f 100644
--- a/controls.h
+++ b/game/controls.h
@@ -23,7 +23,7 @@
#ifndef _controls_h
#define _controls_h
-#include "screenlib/UIDialog.h"
+#include "../screenlib/UIDialog.h"
// Functions from controls.cc
#ifdef USE_JOYSTICK
diff --git a/fastrand.cpp b/game/fastrand.cpp
similarity index 100%
rename from fastrand.cpp
rename to game/fastrand.cpp
diff --git a/fastrand.h b/game/fastrand.h
similarity index 100%
rename from fastrand.h
rename to game/fastrand.h
diff --git a/netlogic/game.cpp b/game/game.cpp
similarity index 99%
rename from netlogic/game.cpp
rename to game/game.cpp
index b5ad16bf..1358db99 100644
--- a/netlogic/game.cpp
+++ b/game/game.cpp
@@ -20,8 +20,8 @@
slouken@libsdl.org
*/
-#include "../Maelstrom_Globals.h"
-#include "../load.h"
+#include "Maelstrom_Globals.h"
+#include "load.h"
#include "object.h"
#include "player.h"
#include "netplay.h"
diff --git a/netlogic/game.h b/game/game.h
similarity index 100%
rename from netlogic/game.h
rename to game/game.h
diff --git a/netlogic/gameinfo.cpp b/game/gameinfo.cpp
similarity index 99%
rename from netlogic/gameinfo.cpp
rename to game/gameinfo.cpp
index b7165ded..5f4ebfb6 100644
--- a/netlogic/gameinfo.cpp
+++ b/game/gameinfo.cpp
@@ -20,7 +20,7 @@
slouken@libsdl.org
*/
-#include "../Maelstrom_Globals.h"
+#include "Maelstrom_Globals.h"
#include "../screenlib/UIElement.h"
#include "../screenlib/UIElementCheckbox.h"
#include "../screenlib/UIElementRadio.h"
diff --git a/netlogic/gameinfo.h b/game/gameinfo.h
similarity index 100%
rename from netlogic/gameinfo.h
rename to game/gameinfo.h
diff --git a/netlogic/globals.h b/game/globals.h
similarity index 100%
rename from netlogic/globals.h
rename to game/globals.h
diff --git a/init.cpp b/game/init.cpp
similarity index 99%
rename from init.cpp
rename to game/init.cpp
index 618b891d..b2a7d1bc 100644
--- a/init.cpp
+++ b/game/init.cpp
@@ -32,7 +32,7 @@
#include "colortable.h"
#include "fastrand.h"
#include "MaelstromUI.h"
-#include "screenlib/UIElement.h"
+#include "../screenlib/UIElement.h"
#define GAME_PREFS_FILE "Maelstrom_Prefs.txt"
diff --git a/init.h b/game/init.h
similarity index 100%
rename from init.h
rename to game/init.h
diff --git a/load.cpp b/game/load.cpp
similarity index 100%
rename from load.cpp
rename to game/load.cpp
diff --git a/load.h b/game/load.h
similarity index 93%
rename from load.h
rename to game/load.h
index 351ba4c0..54f2260c 100644
--- a/load.h
+++ b/game/load.h
@@ -24,9 +24,9 @@
#define _load_h
#include "physfs.h"
-#include "utils/physfsrwops.h"
+#include "../utils/physfsrwops.h"
-#include "screenlib/SDL_FrameBuf.h"
+#include "../screenlib/SDL_FrameBuf.h"
/* Functions exported from load.cpp */
extern SDL_Texture *Load_Title(FrameBuf *screen, int title_id);
diff --git a/netlogic/lobby.cpp b/game/lobby.cpp
similarity index 99%
rename from netlogic/lobby.cpp
rename to game/lobby.cpp
index 91465da8..2011279e 100644
--- a/netlogic/lobby.cpp
+++ b/game/lobby.cpp
@@ -24,7 +24,7 @@
#include <time.h>
#include "SDL_net.h"
-#include "../Maelstrom_Globals.h"
+#include "Maelstrom_Globals.h"
#include "../screenlib/UIElement.h"
#include "../screenlib/UIElementCheckbox.h"
#include "../screenlib/UIElementRadio.h"
diff --git a/netlogic/lobby.h b/game/lobby.h
similarity index 100%
rename from netlogic/lobby.h
rename to game/lobby.h
diff --git a/netlogic/logic.cpp b/game/logic.cpp
similarity index 97%
rename from netlogic/logic.cpp
rename to game/logic.cpp
index 7dc8f467..c6723466 100644
--- a/netlogic/logic.cpp
+++ b/game/logic.cpp
@@ -20,7 +20,7 @@
slouken@libsdl.org
*/
-#include "../Maelstrom_Globals.h"
+#include "Maelstrom_Globals.h"
#include "object.h"
#include "player.h"
#include "globals.h"
diff --git a/logic.h b/game/logic.h
similarity index 97%
rename from logic.h
rename to game/logic.h
index 1504b22a..7c6dcee9 100644
--- a/logic.h
+++ b/game/logic.h
@@ -22,7 +22,7 @@
/* Game Logic interface routines and variables */
-#include "netlogic/netlogic.h"
+#include "netlogic.h"
/* From logic.cpp */
extern int InitPlayerSprites(void);
diff --git a/game/main.cpp b/game/main.cpp
new file mode 100644
index 00000000..7873a047
--- /dev/null
+++ b/game/main.cpp
@@ -0,0 +1,528 @@
+/*
+ Maelstrom: Open Source version of the classic game by Ambrosia Software
+ Copyright (C) 1997-2011 Sam Lantinga
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* ------------------------------------------------------------- */
+/* */
+/* Maelstrom */
+/* By Andrew Welch */
+/* */
+/* Ported to Linux (Spring 1995) */
+/* Ported to Win95 (Fall 1996) -- not releasable */
+/* Ported to SDL (Fall 1997) */
+/* By Sam Lantinga (slouken@libsdl.org) */
+/* */
+/* ------------------------------------------------------------- */
+
+#include "Maelstrom_Globals.h"
+#include "load.h"
+#include "init.h"
+#include "fastrand.h"
+#include "about.h"
+#include "netplay.h"
+#include "main.h"
+
+#include "../screenlib/UIDialog.h"
+#include "../screenlib/UIElement.h"
+#include "../screenlib/UIElementCheckbox.h"
+#include "../screenlib/UIElementEditbox.h"
+
+#define MAELSTROM_PREFS "com.galaxygameworks.Maelstrom"
+#define MAELSTROM_DATA "Maelstrom_Data.zip"
+
+static const char *Version =
+"Maelstrom v1.4.3 (GPL version 4.0.0) -- 10/08/2011 by Sam Lantinga\n";
+
+// Global variables set in this file...
+int gStartLives;
+int gStartLevel;
+Bool gUpdateBuffer;
+Bool gRunning;
+int gNoDelay;
+
+
+// Main Menu actions:
+static void RunDoAbout(void*)
+{
+ ui->ShowPanel(PANEL_ABOUT);
+}
+static void RunSinglePlayerGame()
+{
+ if (InitNetData(false) < 0) {
+ return;
+ }
+ NewGame();
+ HaltNetData();
+}
+static void RunPlayGame(void*)
+{
+ gStartLevel = 1;
+ gStartLives = 3;
+ gNoDelay = 0;
+ RunSinglePlayerGame();
+}
+static void RunQuitGame(void*)
+{
+ while ( sound->Playing() )
+ Delay(SOUND_DELAY);
+ gRunning = false;
+}
+static void IncrementSound(void*)
+{
+ if ( gSoundLevel < 8 ) {
+ sound->Volume(++gSoundLevel);
+ sound->PlaySound(gNewLife, 5);
+
+ /* -- Draw the new sound level */
+ gUpdateBuffer = true;
+ }
+}
+static void DecrementSound(void*)
+{
+ if ( gSoundLevel > 0 ) {
+ sound->Volume(--gSoundLevel);
+ sound->PlaySound(gNewLife, 5);
+
+ /* -- Draw the new sound level */
+ gUpdateBuffer = true;
+ }
+}
+static void SetSoundLevel(int volume)
+{
+ /* Make sure the device is working *
(Patch may be truncated, please check the link at the top of this post.)