From f8d05f8bc96a6ee96fd2e49b78381279e5b4290b Mon Sep 17 00:00:00 2001 From: oroborus Date: Sun, 17 Aug 2008 12:58:30 +0000 Subject: - 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 --- src/modules/CMakeLists.txt | 8 +++++ src/modules/modBasic.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100755 src/modules/modBasic.c (limited to 'src') 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 +#include +#include +#include + +#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; +} -- cgit v1.2.3