summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-08-17 12:58:30 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-08-17 12:58:30 +0000
commitf8d05f8bc96a6ee96fd2e49b78381279e5b4290b (patch)
tree708511ee6739aa6bf510bc287a01688d80ddc911 /src
parentd79991329627f1a54226f2b3d08180dc32dd6e47 (diff)
- jednoduchy modul modBasic.so
( staci ho iba uviset do areny *.map ako loadModule file="libmodBasic" ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@213 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src')
-rw-r--r--src/modules/CMakeLists.txt8
-rwxr-xr-xsrc/modules/modBasic.c74
2 files changed, 82 insertions, 0 deletions
diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt
index 675ee57..b398358 100644
--- a/src/modules/CMakeLists.txt
+++ b/src/modules/CMakeLists.txt
@@ -27,6 +27,10 @@ SET ( SRC_base_modules
${WORKDIR}/base/list ${WORKDIR}/base/gun.h
${WORKDIR}/base/space ${WORKDIR}/base/index
)
+SET ( SRC_modBasic
+ ${SRC_base_modules}
+ modBasic.c
+)
SET ( SRC_modWall
${SRC_base_modules}
modWall.c
@@ -50,11 +54,15 @@ SET ( SRC_modAI
###############################################################################
# COMPILATION AND INSTALLATION ITSELF
###############################################################################
+ADD_LIBRARY ( modBasic SHARED ${SRC_modBasic} )
ADD_LIBRARY ( modWall SHARED ${SRC_modWall} )
ADD_LIBRARY ( modPipe SHARED ${SRC_modPipe} )
ADD_LIBRARY ( modMove SHARED ${SRC_modMove} )
ADD_LIBRARY ( modTeleport SHARED ${SRC_modTeleport} )
ADD_LIBRARY ( modAI SHARED ${SRC_modAI} )
+INSTALL ( TARGETS modBasic
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${APPNAME}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
INSTALL ( TARGETS modWall
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${APPNAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
diff --git a/src/modules/modBasic.c b/src/modules/modBasic.c
new file mode 100755
index 0000000..1532759
--- /dev/null
+++ b/src/modules/modBasic.c
@@ -0,0 +1,74 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include "main.h"
+#include "modules.h"
+#include "tux.h"
+#include "shot.h"
+#include "list.h"
+#include "gun.h"
+#include "space.h"
+
+#ifndef PUBLIC_SERVER
+#include "interface.h"
+#include "image.h"
+#endif
+
+#ifdef PUBLIC_SERVER
+#include "publicServer.h"
+#endif
+
+static export_fce_t *export_fce;
+
+int init(export_fce_t *p)
+{
+ export_fce = p;
+
+ printf("init basic module.\n");
+ return 0;
+}
+
+#ifndef PUBLIC_SERVER
+
+int draw(int x, int y, int w, int h)
+{
+ printf("draw basic module.\n");
+ return 0;
+}
+#endif
+
+int event()
+{
+ printf("event basic module.\n");
+ return 0;
+}
+
+int isConflict(int x, int y, int w, int h)
+{
+ printf("isConflict(%d, %d, %d, %d) basic module.\n", x, y, w, h);
+ return 0;
+}
+
+static void cmd_basic(char *line)
+{
+ printf("cmd_basic(%s) basic module.\n", line);
+}
+
+void cmdArena(char *line)
+{
+ if( strncmp(line, "basic", 5) == 0 )cmd_basic(line);
+}
+
+void recvMsg(char *msg)
+{
+ printf("recvMsg(%s) basic module.\n", msg);
+}
+
+int destroy()
+{
+ printf("destroy basic module.\n");
+ return 0;
+}