diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/CMakeLists.txt | 8 | ||||
| -rwxr-xr-x | src/modules/modBasic.c | 74 |
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; +} |