From 6c4fe3323d79253af707df90623e433ce12c35f2 Mon Sep 17 00:00:00 2001 From: scarab Date: Sat, 5 Jul 2008 16:43:55 +0000 Subject: * Prechod na novou verzi instalace pseudoautotools -> cmake * Odstraneni bordelu kterej tu byl (pokud vam neco chybi brecte na me ja to zkusim najit v zaloze) * TODO instalace: SEPSAT AUTORY, IKONKU VYROBIT git-svn-id: http://opensvn.csie.org/tuxanci_ng@94 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/CMakeLists.txt | 84 +++++++++ src/Makefile | 29 ---- src/Makefile-nosound | 28 --- src/Makefile-sdlnet | 29 ---- src/Makefile-server | 26 --- src/audio/Makefile | 17 -- src/audio/audio.c | 6 +- src/audio/audio.h | 2 +- src/audio/music.c | 12 +- src/audio/music.h | 2 +- src/audio/sound.c | 12 +- src/audio/sound.h | 2 +- src/base/Makefile | 70 -------- src/base/arena.c | 20 +-- src/base/arena.h | 8 +- src/base/arenaFile.c | 26 +-- src/base/arenaFile.h | 4 +- src/base/checkFront.c | 12 +- src/base/checkFront.h | 4 +- src/base/director.c | 4 +- src/base/director.h | 4 +- src/base/gun.c | 28 +-- src/base/homeDirector.c | 4 +- src/base/homeDirector.h | 2 +- src/base/idManager.c | 6 +- src/base/idManager.h | 2 +- src/base/item.c | 32 ++-- src/base/item.h | 10 +- src/base/list.c | 4 +- src/base/list.h | 2 +- src/base/main.c | 8 +- src/base/main.h | 8 +- src/base/modules.c | 24 +-- src/base/modules.h | 12 +- src/base/myTimer.c | 8 +- src/base/myTimer.h | 4 +- src/base/net_multiplayer.c | 26 +-- src/base/net_multiplayer.h | 8 +- src/base/path.h | 6 +- src/base/protect.c | 6 +- src/base/protect.h | 4 +- src/base/proto.c | 48 +++--- src/base/proto.h | 28 +-- src/base/server.c | 30 ++-- src/base/server.h | 14 +- src/base/shot.c | 20 +-- src/base/shot.h | 10 +- src/base/storage.h | 4 +- src/base/string_length.h | 2 +- src/base/textFile.c | 4 +- src/base/textFile.h | 2 +- src/base/tux.c | 38 ++-- src/base/tux.h | 6 +- src/client/Makefile | 38 ---- src/client/client.c | 20 +-- src/client/client.h | 2 +- src/client/configFile.c | 4 +- src/client/configFile.h | 4 +- src/client/font.c | 6 +- src/client/font.h | 2 +- src/client/game.c | 60 +++---- src/client/image.c | 10 +- src/client/image.h | 4 +- src/client/interface.c | 8 +- src/client/interface.h | 2 +- src/client/keytable.c | 12 +- src/client/language.c | 12 +- src/client/layer.c | 14 +- src/client/layer.h | 2 +- src/client/panel.c | 16 +- src/client/panel.h | 4 +- src/client/radar.c | 16 +- src/client/radar.h | 2 +- src/client/screen.c | 10 +- src/client/screen.h | 2 +- src/client/term.c | 12 +- src/client/term.h | 2 +- src/modules/CMakeLists.txt | 52 ++++++ src/modules/Makefile | 31 ---- src/modules/modAI.c | 20 +-- src/modules/modPipe.c | 20 +-- src/modules/modTeleport.c | 20 +-- src/modules/modWall.c | 20 +-- src/net/dns.c | 19 ++ src/net/dns.h | 8 + src/net/udp.c | 374 ++++++++++++++++++++++++++++++++++++++++ src/net/udp.h | 31 ++++ src/net_sdl/Makefile | 9 - src/net_sdl/sdl_udp.c | 219 ----------------------- src/net_sdl/sdl_udp.h | 28 --- src/net_unix/Makefile | 12 -- src/net_unix/dns.c | 19 -- src/net_unix/dns.h | 8 - src/net_unix/udp.c | 374 ---------------------------------------- src/net_unix/udp.h | 31 ---- src/screen/Makefile | 31 ---- src/screen/screen_analyze.c | 22 +-- src/screen/screen_analyze.h | 2 +- src/screen/screen_browser.c | 36 ++-- src/screen/screen_choiceArena.c | 28 +-- src/screen/screen_choiceArena.h | 2 +- src/screen/screen_credits.c | 24 +-- src/screen/screen_gameType.c | 32 ++-- src/screen/screen_gameType.h | 2 +- src/screen/screen_mainMenu.c | 28 +-- src/screen/screen_mainMenu.h | 2 +- src/screen/screen_setting.c | 44 ++--- src/screen/screen_setting.h | 2 +- src/screen/screen_table.c | 26 +-- src/screen/screen_world.c | 64 +++---- src/screen/screen_world.h | 8 +- src/server/Makefile | 15 -- src/server/heightScore.c | 8 +- src/server/publicServer.c | 36 ++-- src/server/publicServer.h | 2 +- src/server/serverConfigFile.c | 8 +- src/widget/Makefile | 28 --- src/widget/widget_button.c | 8 +- src/widget/widget_button.h | 2 +- src/widget/widget_buttonimage.c | 8 +- src/widget/widget_buttonimage.h | 2 +- src/widget/widget_check.c | 6 +- src/widget/widget_check.h | 2 +- src/widget/widget_image.c | 8 +- src/widget/widget_image.h | 4 +- src/widget/widget_label.c | 6 +- src/widget/widget_label.h | 2 +- src/widget/widget_select.c | 6 +- src/widget/widget_select.h | 4 +- src/widget/widget_textfield.c | 8 +- src/widget/widget_textfield.h | 2 +- 131 files changed, 1207 insertions(+), 1681 deletions(-) create mode 100644 src/CMakeLists.txt delete mode 100644 src/Makefile delete mode 100644 src/Makefile-nosound delete mode 100644 src/Makefile-sdlnet delete mode 100644 src/Makefile-server delete mode 100644 src/audio/Makefile delete mode 100644 src/base/Makefile delete mode 100644 src/client/Makefile create mode 100644 src/modules/CMakeLists.txt delete mode 100755 src/modules/Makefile create mode 100644 src/net/dns.c create mode 100644 src/net/dns.h create mode 100644 src/net/udp.c create mode 100644 src/net/udp.h delete mode 100644 src/net_sdl/Makefile delete mode 100644 src/net_sdl/sdl_udp.c delete mode 100644 src/net_sdl/sdl_udp.h delete mode 100644 src/net_unix/Makefile delete mode 100644 src/net_unix/dns.c delete mode 100644 src/net_unix/dns.h delete mode 100644 src/net_unix/udp.c delete mode 100644 src/net_unix/udp.h delete mode 100644 src/screen/Makefile delete mode 100644 src/server/Makefile delete mode 100644 src/widget/Makefile (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..065dce7 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,84 @@ +SET ( WORKDIR ${CMAKE_SOURCE_DIR}/src ) +# pro aktualizaci tehle seznamu pouzijte radsi skript nezli to delat rucne +# find ./ -maxdepth 1 -type f -name \*.c |grep "$" |sed -e 's/^\.\//\$\{WORKDIR\}\/DIR\//' -e 's/\.c//' |tr '\n' ' ' > DIRfiles +# nahradte DIR potrebnym adresarem a pak vemte vse co je v DIRfiles a vlozte to sem +SET ( SRC_base +${WORKDIR}/base/main ${WORKDIR}/base/shot ${WORKDIR}/base/space ${WORKDIR}/base/checkFront ${WORKDIR}/base/storage ${WORKDIR}/base/myTimer ${WORKDIR}/base/protect ${WORKDIR}/base/list ${WORKDIR}/base/arena ${WORKDIR}/base/server ${WORKDIR}/base/textFile ${WORKDIR}/base/gun ${WORKDIR}/base/arenaFile ${WORKDIR}/base/modules ${WORKDIR}/base/net_multiplayer ${WORKDIR}/base/index ${WORKDIR}/base/item ${WORKDIR}/base/tux ${WORKDIR}/base/director ${WORKDIR}/base/idManager ${WORKDIR}/base/homeDirector ${WORKDIR}/base/proto + +${WORKDIR}/net/udp ${WORKDIR}/net/dns +) + +SET ( SRC_client + +${WORKDIR}/client/language ${WORKDIR}/client/radar ${WORKDIR}/client/interface ${WORKDIR}/client/game ${WORKDIR}/client/image ${WORKDIR}/client/term ${WORKDIR}/client/layer ${WORKDIR}/client/screen ${WORKDIR}/client/panel ${WORKDIR}/client/client ${WORKDIR}/client/configFile ${WORKDIR}/client/font ${WORKDIR}/client/keytable + +${WORKDIR}/screen/screen_choiceArena ${WORKDIR}/screen/screen_table ${WORKDIR}/screen/screen_setting ${WORKDIR}/screen/screen_credits ${WORKDIR}/screen/screen_world ${WORKDIR}/screen/screen_analyze ${WORKDIR}/screen/screen_mainMenu ${WORKDIR}/screen/screen_browser ${WORKDIR}/screen/screen_gameType + +${WORKDIR}/widget/widget_check ${WORKDIR}/widget/widget_button ${WORKDIR}/widget/widget_textfield ${WORKDIR}/widget/widget_label ${WORKDIR}/widget/widget_buttonimage ${WORKDIR}/widget/widget_image ${WORKDIR}/widget/widget_select +) + +SET ( SRC_audio ${WORKDIR}/audio/audio ${WORKDIR}/audio/music ${WORKDIR}/audio/sound) + +SET ( SRC_server +${WORKDIR}/server/logFile ${WORKDIR}/server/serverConfigFile ${WORKDIR}/server/heightScore ${WORKDIR}/server/publicServer +) +# nechcem sdl +ADD_DEFINITIONS ( -DSUPPORT_NET_UNIX_UDP ) +# server nebo klient +IF ( NOT NO_Server ) + ADD_DEFINITIONS ( -DPUBLIC_SERVER ) + ADD_DEFINITIONS ( -DNO_SOUND ) +ENDIF ( NOT NO_Server ) +#include zdrojaku +INCLUDE_DIRECTORIES ( ${WORKDIR}/base ) +INCLUDE_DIRECTORIES ( ${WORKDIR}/net ) +#vytvoreni knihoven +SET ( CMAKE_INSTALL_BINDIR bin ) +SET ( CMAKE_INSTALL_LIBDIR lib ) +ADD_SUBDIRECTORY ( modules ) +IF ( NO_Server ) # server nebo klient + MESSAGE ( STATUS "" ) + MESSAGE ( STATUS "<******************************>" ) + FIND_PACKAGE ( SDL REQUIRED ) + FIND_PACKAGE ( SDL_image REQUIRED ) + FIND_PACKAGE ( SDL_ttf REQUIRED ) + LINK_LIBRARIES ( ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDLTTF_LIBRARY} SDLmain ) + MESSAGE ( STATUS "" ) + MESSAGE ( STATUS "<******************************>" ) + INCLUDE_DIRECTORIES ( ${WORKDIR}/client ) + INCLUDE_DIRECTORIES ( ${WORKDIR}/screen ) + INCLUDE_DIRECTORIES ( ${WORKDIR}/widget ) + INCLUDE_DIRECTORIES ( ${SDL_INCLUDE_DIR} ${SDLIMAGE_INCLUDE_DIR} ${SDLTTF_INCLUDE_DIR}) + SET ( SRC_compile ${SRC_base} ${SRC_client} ) + IF ( NOT NO_Audio ) + MESSAGE ( STATUS "" ) + MESSAGE ( STATUS "<******************************>" ) + SET ( SRC_compile ${SRC_base} ${SRC_client} ${SRC_audio} ) + INCLUDE_DIRECTORIES ( ${WORKDIR}/audio ) + FIND_PACKAGE ( SDL_mixer REQUIRED ) + INCLUDE_DIRECTORIES ( ${SDLMIXER_INCLUDE_DIR} ) + LINK_LIBRARIES ( ${SDL_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLTTF_LIBRARY} SDLmain ) + ELSE (NOT NO_Audio) + MESSAGE ( STATUS "" ) + ADD_DEFINITIONS ( -DNO_SOUND ) + MESSAGE ( STATUS "<******************************>" ) + ENDIF ( NOT NO_Audio ) + ADD_EXECUTABLE ( tuxanci-ng ${SRC_compile} ) + #TARGET_LINK_LIBRARIES (tuxanci-ng modWall modPipe modTeleport modAI) + SET (TUX_BIN "tuxanci-ng") +ELSE ( NO_Server ) + # kontrola libdl + LINK_LIBRARIES ( ${CMAKE_DL_LIBS} ) + MESSAGE ( STATUS "" ) + MESSAGE ( STATUS "<******************************>" ) + INCLUDE_DIRECTORIES ( ${WORKDIR}/server ) + SET ( SRC_compile ${SRC_base} ${SRC_server} ) + ADD_EXECUTABLE ( tuxanci-ng-server ${SRC_compile} ) + #TARGET_LINK_LIBRARIES (tuxanci-ng-server modWall modPipe modTeleport modAI) + SET (TUX_BIN "tuxanci-ng-server") +ENDIF ( NO_Server ) + +# binarky a knihovny instalace +#MESSAGE ( STATUS "" ) +#MESSAGE ( STATUS "<******************************>" ) +INSTALL ( TARGETS ${TUX_BIN} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${APPNAME} ) \ No newline at end of file diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index a54b508..0000000 --- a/src/Makefile +++ /dev/null @@ -1,29 +0,0 @@ - -CC = gcc -CFLAGS = -g -O0 -std=c99 -I.. -Wall `sdl-config --cflags` -DSUPPORT_NET_UNIX_UDP -LIBS = `sdl-config --libs` -lSDL_image -lSDL_ttf -lSDL_mixer - -all: - make -C ./audio -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./net_unix -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./client -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./screen -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./widget -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./base -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./modules -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - $(CC) $(CFLAGS) $(LIBS) -o tuxanci-ng base/*.o client/*.o widget/*.o screen/*.o net_unix/*.o audio/*.o - cp modules/*.so ../modules/ - cp tuxanci-ng ../ - -clean: - make -C ./base -f Makefile clean - make -C ./client -f Makefile clean - make -C ./screen -f Makefile clean - make -C ./widget -f Makefile clean - make -C ./net_unix -f Makefile clean - make -C ./net_sdl -f Makefile clean - make -C ./audio -f Makefile clean - make -C ./modules -f Makefile clean - rm -rf ../modules/*.so - rm tuxanci-ng - rm ../tuxanci-ng diff --git a/src/Makefile-nosound b/src/Makefile-nosound deleted file mode 100644 index e672fe1..0000000 --- a/src/Makefile-nosound +++ /dev/null @@ -1,28 +0,0 @@ - -CC = gcc -CFLAGS = -g -O0 -std=c99 -I.. -Wall `sdl-config --cflags` -DNO_SOUND -DSUPPORT_NET_UNIX_UDP -LIBS = `sdl-config --libs` -lSDL_image -lSDL_ttf - -all: - make -C ./net_unix -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./client -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./screen -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./widget -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./base -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./modules -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - $(CC) $(CFLAGS) $(LIBS) -o tuxanci-ng base/*.o client/*.o widget/*.o screen/*.o net_unix/*.o - cp modules/*.so ../modules/ - cp tuxanci-ng ../ - -clean: - make -C ./base -f Makefile clean - make -C ./client -f Makefile clean - make -C ./screen -f Makefile clean - make -C ./widget -f Makefile clean - make -C ./net_unix -f Makefile clean - make -C ./net_sdl -f Makefile clean - make -C ./audio -f Makefile clean - make -C ./modules -f Makefile clean - rm -rf ../modules/*.so - rm tuxanci-ng - rm ../tuxanci-ng diff --git a/src/Makefile-sdlnet b/src/Makefile-sdlnet deleted file mode 100644 index d278d52..0000000 --- a/src/Makefile-sdlnet +++ /dev/null @@ -1,29 +0,0 @@ - -CC = gcc -CFLAGS = -g -O0 -std=c99 -I.. -Wall `sdl-config --cflags` -DSUPPORT_NET_SDL_UDP -LIBS = `sdl-config --libs` -lSDL_image -lSDL_ttf -lSDL_mixer -lSDL_net - -all: - make -C ./audio -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./net_sdl -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./client -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./screen -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./widget -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./base -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./modules -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - $(CC) $(CFLAGS) $(LIBS) -o tuxanci-ng base/*.o client/*.o widget/*.o screen/*.o net_sdl/*.o audio/*.o - cp modules/*.so ../modules/ - cp tuxanci-ng ../ - -clean: - make -C ./base -f Makefile clean - make -C ./client -f Makefile clean - make -C ./screen -f Makefile clean - make -C ./widget -f Makefile clean - make -C ./net_unix -f Makefile clean - make -C ./net_sdl -f Makefile clean - make -C ./audio -f Makefile clean - make -C ./modules -f Makefile clean - rm -rf ../modules/*.so - rm tuxanci-ng - rm ../tuxanci-ng diff --git a/src/Makefile-server b/src/Makefile-server deleted file mode 100644 index 23ec740..0000000 --- a/src/Makefile-server +++ /dev/null @@ -1,26 +0,0 @@ - -CC = gcc -CFLAGS = -g -O0 -std=c99 -I.. -Wall -D_GNU_SOURCE=1 -DSUPPORT_NET_UNIX_UDP -DPUBLIC_SERVER -DNO_SOUND -LIBS = -ldl - -all: - make -C ./base -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./server -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./net_unix -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - make -C ./modules -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)" - $(CC) $(CFLAGS) $(LIBS) -o publicserver base/*.o server/*.o net_unix/*.o - cp modules/*.so ../modules/ - cp publicserver ../ - -clean: - make -C ./base -f Makefile clean - make -C ./client -f Makefile clean - make -C ./screen -f Makefile clean - make -C ./widget -f Makefile clean - make -C ./net_unix -f Makefile clean - make -C ./net_sdl -f Makefile clean - make -C ./audio -f Makefile clean - make -C ./modules -f Makefile clean - rm -rf ../modules/*.so - rm publicserver - rm ../publicserver diff --git a/src/audio/Makefile b/src/audio/Makefile deleted file mode 100644 index a5dff01..0000000 --- a/src/audio/Makefile +++ /dev/null @@ -1,17 +0,0 @@ - - -all: audio.o music.o sound.o - -audio.o: audio.c audio.h - $(CC) $(CFLAGS) -o audio.o -c audio.c - -music.o: music.c music.h - $(CC) $(CFLAGS) -o music.o -c music.c - -sound.o: sound.c sound.h - $(CC) $(CFLAGS) -o sound.o -c sound.c - - - -clean: - rm -rf *.o diff --git a/src/audio/audio.c b/src/audio/audio.c index d7f4a9b..8397788 100644 --- a/src/audio/audio.c +++ b/src/audio/audio.c @@ -3,9 +3,9 @@ #include #include -#include "base/main.h" -#include "audio/audio.h" -#include "client/interface.h" +#include "main.h" +#include "audio.h" +#include "interface.h" static bool_t isAudioInit = FALSE; diff --git a/src/audio/audio.h b/src/audio/audio.h index 04c58e7..242bb9a 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -3,7 +3,7 @@ #define AUDIO_H -#include "base/main.h" +#include "main.h" extern bool_t isAudioInicialized(); extern void initAudio(); diff --git a/src/audio/music.c b/src/audio/music.c index b449950..cf3db24 100644 --- a/src/audio/music.c +++ b/src/audio/music.c @@ -3,14 +3,14 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/storage.h" +#include "main.h" +#include "list.h" +#include "storage.h" -#include "client/interface.h" +#include "interface.h" -#include "audio/audio.h" -#include "audio/music.h" +#include "audio.h" +#include "music.h" static list_t *listStorage; diff --git a/src/audio/music.h b/src/audio/music.h index d87f382..0ae83c4 100644 --- a/src/audio/music.h +++ b/src/audio/music.h @@ -6,7 +6,7 @@ #ifndef NO_SOUND #include -#include "base/main.h" +#include "main.h" #define MUSIC_GROUP_BASE "base" #define MUSIC_GROUP_USER "user" diff --git a/src/audio/sound.c b/src/audio/sound.c index 37803c4..652de67 100644 --- a/src/audio/sound.c +++ b/src/audio/sound.c @@ -3,14 +3,14 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/storage.h" +#include "main.h" +#include "list.h" +#include "storage.h" -#include "client/interface.h" +#include "interface.h" -#include "audio/audio.h" -#include "audio/sound.h" +#include "audio.h" +#include "sound.h" static list_t *listStorage; diff --git a/src/audio/sound.h b/src/audio/sound.h index ec1beb1..337ef3b 100644 --- a/src/audio/sound.h +++ b/src/audio/sound.h @@ -6,7 +6,7 @@ #ifndef NO_SOUND #include -#include "base/main.h" +#include "main.h" #define SOUND_GROUP_BASE "base" #define SOUND_GROUP_USER "user" diff --git a/src/base/Makefile b/src/base/Makefile deleted file mode 100644 index d9998a6..0000000 --- a/src/base/Makefile +++ /dev/null @@ -1,70 +0,0 @@ - -all: arena.o arenaFile.o director.o gun.o homeDirector.o checkFront.o idManager.o item.o index.o list.o main.o modules.o myTimer.o net_multiplayer.o protect.o proto.o server.o shot.o space.o storage.o textFile.o tux.o - -arena.o: arena.c arena.h - $(CC) $(CFLAGS) -o arena.o -c arena.c - -arenaFile.o: arenaFile.c arenaFile.h - $(CC) $(CFLAGS) -o arenaFile.o -c arenaFile.c - -director.o: director.c director.h - $(CC) $(CFLAGS) -o director.o -c director.c - -gun.o: gun.c gun.h - $(CC) $(CFLAGS) -o gun.o -c gun.c - -homeDirector.o: homeDirector.c homeDirector.h - $(CC) $(CFLAGS) -o homeDirector.o -c homeDirector.c - -checkFront.o: checkFront.c checkFront.h - $(CC) $(CFLAGS) -o checkFront.o -c checkFront.c - -idManager.o: idManager.c idManager.h - $(CC) $(CFLAGS) -o idManager.o -c idManager.c - -item.o: item.c item.h - $(CC) $(CFLAGS) -o item.o -c item.c - -index.o: index.c index.h - $(CC) $(CFLAGS) -o index.o -c index.c - -list.o: list.c list.h - $(CC) $(CFLAGS) -o list.o -c list.c - -main.o: main.c main.h - $(CC) $(CFLAGS) -o main.o -c main.c - -modules.o: modules.c modules.h - $(CC) $(CFLAGS) -o modules.o -c modules.c - -myTimer.o: myTimer.c myTimer.h - $(CC) $(CFLAGS) -o myTimer.o -c myTimer.c - -net_multiplayer.o: net_multiplayer.c net_multiplayer.h - $(CC) $(CFLAGS) -o net_multiplayer.o -c net_multiplayer.c - -protect.o: protect.c protect.h - $(CC) $(CFLAGS) -o protect.o -c protect.c - -server.o: server.c server.h - $(CC) $(CFLAGS) -o server.o -c server.c - -shot.o: shot.c shot.h - $(CC) $(CFLAGS) -o shot.o -c shot.c - -space.o: space.c space.h - $(CC) $(CFLAGS) -o space.o -c space.c - -storage.o: storage.c storage.h - $(CC) $(CFLAGS) -o storage.o -c storage.c - -textFile.o: textFile.c textFile.h - $(CC) $(CFLAGS) -o textFile.o -c textFile.c - -tux.o: tux.c tux.h - $(CC) $(CFLAGS) -o tux.o -c tux.c - -clean: - rm -rf *.o - - diff --git a/src/base/arena.c b/src/base/arena.c index 9de1dce..7358e41 100644 --- a/src/base/arena.c +++ b/src/base/arena.c @@ -3,18 +3,18 @@ #include #include -#include "base/main.h" -#include "base/arena.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/shot.h" -#include "base/item.h" -#include "base/myTimer.h" -#include "base/modules.h" +#include "main.h" +#include "arena.h" +#include "list.h" +#include "tux.h" +#include "shot.h" +#include "item.h" +#include "myTimer.h" +#include "modules.h" #ifndef PUBLIC_SERVER -#include "screen/screen_world.h" -#include "client/layer.h" +#include "screen_world.h" +#include "layer.h" #endif static arena_t *currentArena; diff --git a/src/base/arena.h b/src/base/arena.h index 57792c5..837fade 100644 --- a/src/base/arena.h +++ b/src/base/arena.h @@ -3,14 +3,14 @@ #define ARENA_H -#include "base/main.h" +#include "main.h" #ifndef PUBLIC_SERVER -#include "client/interface.h" +#include "interface.h" #endif -#include "base/list.h" -#include "base/space.h" +#include "list.h" +#include "space.h" typedef struct arena_struct { diff --git a/src/base/arenaFile.c b/src/base/arenaFile.c index 9fe683e..f0de21f 100644 --- a/src/base/arenaFile.c +++ b/src/base/arenaFile.c @@ -4,21 +4,21 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/textFile.h" -#include "base/arenaFile.h" -#include "base/arena.h" -#include "base/tux.h" -#include "base/shot.h" -#include "base/item.h" -#include "base/director.h" -#include "base/modules.h" +#include "main.h" +#include "list.h" +#include "textFile.h" +#include "arenaFile.h" +#include "arena.h" +#include "tux.h" +#include "shot.h" +#include "item.h" +#include "director.h" +#include "modules.h" #ifndef PUBLIC_SERVER -#include "client/configFile.h" -#include "client/image.h" -#include "audio/music.h" +#include "configFile.h" +#include "image.h" +#include "music.h" #endif static list_t *listArenaFile; diff --git a/src/base/arenaFile.h b/src/base/arenaFile.h index e2e8108..5f71f5b 100644 --- a/src/base/arenaFile.h +++ b/src/base/arenaFile.h @@ -3,8 +3,8 @@ #define ARENA_FILE_H -#include "base/main.h" -#include "base/arena.h" +#include "main.h" +#include "arena.h" #define PUBLIC_SERVER_PATH_ARENA "./arena/" diff --git a/src/base/checkFront.c b/src/base/checkFront.c index 37b0ace..f6164f3 100644 --- a/src/base/checkFront.c +++ b/src/base/checkFront.c @@ -4,12 +4,12 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/myTimer.h" -#include "base/checkFront.h" -#include "base/idManager.h" -#include "base/server.h" +#include "main.h" +#include "list.h" +#include "myTimer.h" +#include "checkFront.h" +#include "idManager.h" +#include "server.h" typedef struct struct_checkfront_t { diff --git a/src/base/checkFront.h b/src/base/checkFront.h index 3beb370..dde30f0 100644 --- a/src/base/checkFront.h +++ b/src/base/checkFront.h @@ -3,8 +3,8 @@ #define CHECK_FRONT_H -#include "base/list.h" -#include "base/server.h" +#include "list.h" +#include "server.h" #define CHECK_FRONT_SEND_TIME_INTERVAL 100 #define CHECK_FRONT_MAX_COUNT_SEND 30 diff --git a/src/base/director.c b/src/base/director.c index fede2c3..0cece6b 100755 --- a/src/base/director.c +++ b/src/base/director.c @@ -7,8 +7,8 @@ #include #include -#include "base/main.h" -#include "base/list.h" +#include "main.h" +#include "list.h" typedef struct director_struct { diff --git a/src/base/director.h b/src/base/director.h index 20e577c..8a07ed0 100644 --- a/src/base/director.h +++ b/src/base/director.h @@ -3,8 +3,8 @@ #define DIRECTOR_H -#include "base/main.h" -#include "base/list.h" +#include "main.h" +#include "list.h" typedef struct director_struct { diff --git a/src/base/gun.c b/src/base/gun.c index c59bd98..f905efd 100644 --- a/src/base/gun.c +++ b/src/base/gun.c @@ -3,29 +3,29 @@ #include #include -#include "base/main.h" -#include "base/arena.h" -#include "base/tux.h" -#include "base/shot.h" -#include "base/myTimer.h" -#include "base/item.h" -#include "base/gun.h" -#include "base/proto.h" -#include "base/net_multiplayer.h" +#include "main.h" +#include "arena.h" +#include "tux.h" +#include "shot.h" +#include "myTimer.h" +#include "item.h" +#include "gun.h" +#include "proto.h" +#include "net_multiplayer.h" #ifndef NO_SOUND -#include "audio/sound.h" +#include "sound.h" #endif #ifndef PUBLIC_SERVER -#include "client/interface.h" -#include "client/term.h" +#include "interface.h" +#include "term.h" -#include "screen/screen_world.h" +#include "screen_world.h" #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" +#include "publicServer.h" #endif static void modificiationCopuse(int courser, int right_x, int right_y, int *dest_x, int *dest_y) diff --git a/src/base/homeDirector.c b/src/base/homeDirector.c index 0533d2e..e78ffa4 100755 --- a/src/base/homeDirector.c +++ b/src/base/homeDirector.c @@ -5,8 +5,8 @@ #include #include -#include "base/main.h" -#include "base/homeDirector.h" +#include "main.h" +#include "homeDirector.h" static char homeDirector[STR_PATH_SIZE]; diff --git a/src/base/homeDirector.h b/src/base/homeDirector.h index a5c5e0c..85f8172 100755 --- a/src/base/homeDirector.h +++ b/src/base/homeDirector.h @@ -3,7 +3,7 @@ #define HOMEDIRECTOR_H -#include "base/main.h" +#include "main.h" #define HOMEDIRECTOR_NAME ".tuxanci-ng" diff --git a/src/base/idManager.c b/src/base/idManager.c index fb4a928..ea7e679 100644 --- a/src/base/idManager.c +++ b/src/base/idManager.c @@ -3,9 +3,9 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/idManager.h" +#include "main.h" +#include "list.h" +#include "idManager.h" static list_t *listID; static int lastID; diff --git a/src/base/idManager.h b/src/base/idManager.h index 2b33ac5..62e2651 100644 --- a/src/base/idManager.h +++ b/src/base/idManager.h @@ -7,7 +7,7 @@ #define MAX_ID 1000 #define ID_UNKNOWN -1 -#include "base/list.h" +#include "list.h" extern void initListID(); extern int getNewID(); diff --git a/src/base/item.c b/src/base/item.c index 73bfeaa..7f12ce7 100644 --- a/src/base/item.c +++ b/src/base/item.c @@ -2,33 +2,33 @@ #include #include -#include "base/main.h" -#include "base/arena.h" -#include "base/tux.h" -#include "base/item.h" -#include "base/shot.h" -#include "base/proto.h" -#include "base/idManager.h" -#include "base/net_multiplayer.h" +#include "main.h" +#include "arena.h" +#include "tux.h" +#include "item.h" +#include "shot.h" +#include "proto.h" +#include "idManager.h" +#include "net_multiplayer.h" #ifndef PUBLIC_SERVER -#include "client/interface.h" -#include "client/image.h" -#include "client/layer.h" -#include "client/term.h" +#include "interface.h" +#include "image.h" +#include "layer.h" +#include "term.h" -#include "screen/screen_world.h" -#include "screen/screen_setting.h" +#include "screen_world.h" +#include "screen_setting.h" #ifndef NO_SOUND -#include "audio/sound.h" +#include "sound.h" #endif #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" +#include "publicServer.h" #endif #ifndef PUBLIC_SERVER diff --git a/src/base/item.h b/src/base/item.h index ec11654..c23e7d7 100644 --- a/src/base/item.h +++ b/src/base/item.h @@ -3,17 +3,17 @@ #define ITEM_H -#include "base/main.h" +#include "main.h" #define ITEM_SYNC_TIMEOUT 5000 #ifndef PUBLIC_SERVER -#include "client/interface.h" +#include "interface.h" #endif -#include "base/list.h" -#include "base/tux.h" -#include "base/myTimer.h" +#include "list.h" +#include "tux.h" +#include "myTimer.h" typedef struct item_struct { diff --git a/src/base/list.c b/src/base/list.c index d182210..27b0ed8 100755 --- a/src/base/list.c +++ b/src/base/list.c @@ -1,6 +1,6 @@ -#include "base/main.h" -#include "base/list.h" +#include "main.h" +#include "list.h" #include #include diff --git a/src/base/list.h b/src/base/list.h index 17a8e2d..5a15786 100755 --- a/src/base/list.h +++ b/src/base/list.h @@ -3,7 +3,7 @@ #define LIST_H -#include "base/main.h" +#include "main.h" #define LIST_ALLOC_LIMIT 16 diff --git a/src/base/main.c b/src/base/main.c index ffebbe0..5fb3d4e 100644 --- a/src/base/main.c +++ b/src/base/main.c @@ -8,15 +8,15 @@ #include #include -#include "base/main.h" -#include "base/tux.h" +#include "main.h" +#include "tux.h" #ifndef PUBLIC_SERVER -#include "client/game.h" +#include "game.h" #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" +#include "publicServer.h" #endif static int my_argc; diff --git a/src/base/main.h b/src/base/main.h index b38a1d7..fcf1f4d 100644 --- a/src/base/main.h +++ b/src/base/main.h @@ -11,15 +11,15 @@ #endif -#include "base/bool.h" -#include "base/string_length.h" -#include "base/path.h" +#include "bool.h" +#include "string_length.h" +#include "path.h" //rozlisenie obrazovky #define WINDOW_SIZE_X 800 #define WINDOW_SIZE_Y 600 -#include "base/list.h" +#include "list.h" extern list_t *listHelp; diff --git a/src/base/modules.c b/src/base/modules.c index aa881d5..108990f 100755 --- a/src/base/modules.c +++ b/src/base/modules.c @@ -5,20 +5,20 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/shot.h" -#include "base/modules.h" -#include "base/arena.h" -#include "base/arenaFile.h" -#include "base/proto.h" +#include "main.h" +#include "list.h" +#include "tux.h" +#include "shot.h" +#include "modules.h" +#include "arena.h" +#include "arenaFile.h" +#include "proto.h" #ifndef PUBLIC_SERVER -#include "client/interface.h" -#include "client/image.h" -#include "client/layer.h" -#include "client/configFile.h" +#include "interface.h" +#include "image.h" +#include "layer.h" +#include "configFile.h" #endif int pokus(char *s) diff --git a/src/base/modules.h b/src/base/modules.h index 3b50ade..0b31292 100644 --- a/src/base/modules.h +++ b/src/base/modules.h @@ -3,14 +3,14 @@ #define MODULE_H -#include "base/tux.h" -#include "base/shot.h" -#include "base/arena.h" -#include "base/proto.h" -#include "base/myTimer.h" +#include "tux.h" +#include "shot.h" +#include "arena.h" +#include "proto.h" +#include "myTimer.h" #ifndef PUBLIC_SERVER -#include "client/image.h" +#include "image.h" #endif typedef struct export_fce_s diff --git a/src/base/myTimer.c b/src/base/myTimer.c index 7913f8b..5e74207 100644 --- a/src/base/myTimer.c +++ b/src/base/myTimer.c @@ -6,12 +6,12 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/myTimer.h" +#include "main.h" +#include "list.h" +#include "myTimer.h" #ifndef PUBLIC_SERVER -#include "client/interface.h" +#include "interface.h" #endif static struct timeval start = { .tv_sec = 0, .tv_usec = 0 }; diff --git a/src/base/myTimer.h b/src/base/myTimer.h index 2f038da..97c2f65 100644 --- a/src/base/myTimer.h +++ b/src/base/myTimer.h @@ -3,8 +3,8 @@ #define MY_TIME_H -#include "base/main.h" -#include "base/list.h" +#include "main.h" +#include "list.h" #define my_time_t unsigned int diff --git a/src/base/net_multiplayer.c b/src/base/net_multiplayer.c index bc8ecab..b028e0f 100644 --- a/src/base/net_multiplayer.c +++ b/src/base/net_multiplayer.c @@ -4,28 +4,28 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/item.h" -#include "base/arenaFile.h" -#include "base/net_multiplayer.h" -#include "base/server.h" +#include "main.h" +#include "list.h" +#include "tux.h" +#include "item.h" +#include "arenaFile.h" +#include "net_multiplayer.h" +#include "server.h" #ifdef SUPPORT_NET_UNIX_UDP -#include "net_unix/udp.h" +#include "udp.h" #endif #ifdef SUPPORT_NET_SDL_UDP -#include "net_sdl/sdl_udp.h" +#include "sdl_udp.h" #endif #ifndef PUBLIC_SERVER -#include "screen/screen_setting.h" -#include "screen/screen_choiceArena.h" +#include "screen_setting.h" +#include "screen_choiceArena.h" -#include "client/screen.h" -#include "client/client.h" +#include "screen.h" +#include "client.h" #endif static int netGameType; diff --git a/src/base/net_multiplayer.h b/src/base/net_multiplayer.h index a37df6f..3137385 100644 --- a/src/base/net_multiplayer.h +++ b/src/base/net_multiplayer.h @@ -3,10 +3,10 @@ #define NET_MULTIPLAYER_H -#include "base/main.h" -#include "base/tux.h" -#include "base/item.h" -#include "base/arena.h" +#include "main.h" +#include "tux.h" +#include "item.h" +#include "arena.h" #define PROTO_UDPv4 0 #define PROTO_UDPv6 1 diff --git a/src/base/path.h b/src/base/path.h index 9c26ea4..a99bf83 100644 --- a/src/base/path.h +++ b/src/base/path.h @@ -3,7 +3,7 @@ #define PATH_H -#include "base/main.h" +#include "main.h" #ifdef DESTDIR @@ -27,7 +27,7 @@ #define PATH_MUSIC DESTDIR PATH_DIR "music/" #define PATH_CONFIG DESTDIR PATH_DIR "conf/" #define PATH_LANG DESTDIR PATH_DIR "lang/" -#define PATH_DATA DESTDIR PATH_DIR "data/" -#define PATH_MODULES DESTDIR PATH_DIR "modules/" +#define PATH_DATA DESTDIR PATH_DIR "doc/" +#define PATH_MODULES DESTDIR "lib/tuxanci-ng/" #endif diff --git a/src/base/protect.c b/src/base/protect.c index 7da70bb..cf567b8 100644 --- a/src/base/protect.c +++ b/src/base/protect.c @@ -4,9 +4,9 @@ #include #include -#include "base/main.h" -#include "base/myTimer.h" -#include "base/protect.h" +#include "main.h" +#include "myTimer.h" +#include "protect.h" protect_t* newProtect() { diff --git a/src/base/protect.h b/src/base/protect.h index b0db5a9..e0553dd 100644 --- a/src/base/protect.h +++ b/src/base/protect.h @@ -3,8 +3,8 @@ #define PROTECT_H -#include "base/main.h" -#include "base/myTimer.h" +#include "main.h" +#include "myTimer.h" #define PROTECT_PING_INTERVAL_TIMEOUT 5000 #define PROTECT_SPEED_INTERVAL_TIMEOUT 40 diff --git a/src/base/proto.c b/src/base/proto.c index cc33149..722d443 100644 --- a/src/base/proto.c +++ b/src/base/proto.c @@ -4,35 +4,35 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/item.h" -#include "base/shot.h" -#include "base/arenaFile.h" -#include "base/myTimer.h" -#include "base/server.h" -#include "base/proto.h" -#include "base/net_multiplayer.h" -#include "base/checkFront.h" -#include "base/idManager.h" -#include "base/protect.h" +#include "main.h" +#include "list.h" +#include "tux.h" +#include "item.h" +#include "shot.h" +#include "arenaFile.h" +#include "myTimer.h" +#include "server.h" +#include "proto.h" +#include "net_multiplayer.h" +#include "checkFront.h" +#include "idManager.h" +#include "protect.h" #ifndef PUBLIC_SERVER -#include "client/language.h" -#include "screen/screen_world.h" -#include "screen/screen_setting.h" -#include "screen/screen_choiceArena.h" -#include "screen/screen_analyze.h" -#include "client/client.h" -#include "client/term.h" -#include "client/radar.h" +#include "language.h" +#include "screen_world.h" +#include "screen_setting.h" +#include "screen_choiceArena.h" +#include "screen_analyze.h" +#include "client.h" +#include "term.h" +#include "radar.h" #endif #ifdef PUBLIC_SERVER -#include "server/heightScore.h" -#include "server/publicServer.h" -#include "server/serverConfigFile.h" +#include "heightScore.h" +#include "publicServer.h" +#include "serverConfigFile.h" #endif void proto_send_error_server(int type, client_t *client, int errorcode) diff --git a/src/base/proto.h b/src/base/proto.h index 9fe9303..116562b 100644 --- a/src/base/proto.h +++ b/src/base/proto.h @@ -8,25 +8,25 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/item.h" -#include "base/shot.h" -#include "base/arenaFile.h" -#include "base/myTimer.h" -#include "base/server.h" -#include "base/proto.h" -#include "base/net_multiplayer.h" +#include "main.h" +#include "list.h" +#include "item.h" +#include "shot.h" +#include "arenaFile.h" +#include "myTimer.h" +#include "server.h" +#include "proto.h" +#include "net_multiplayer.h" #ifndef PUBLIC_SERVER -#include "screen/screen_world.h" -#include "screen/screen_setting.h" -#include "screen/screen_choiceArena.h" -#include "client/client.h" +#include "screen_world.h" +#include "screen_setting.h" +#include "screen_choiceArena.h" +#include "client.h" #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" +#include "publicServer.h" #endif #define PROTO_SEND_ONE 0 diff --git a/src/base/server.c b/src/base/server.c index 941b62e..9132a46 100644 --- a/src/base/server.c +++ b/src/base/server.c @@ -12,28 +12,28 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/proto.h" -#include "base/server.h" -#include "base/myTimer.h" -#include "base/arena.h" -#include "base/net_multiplayer.h" -#include "base/checkFront.h" -#include "base/protect.h" -#include "base/index.h" +#include "main.h" +#include "list.h" +#include "tux.h" +#include "proto.h" +#include "server.h" +#include "myTimer.h" +#include "arena.h" +#include "net_multiplayer.h" +#include "checkFront.h" +#include "protect.h" +#include "index.h" #ifndef PUBLIC_SERVER -#include "screen/screen_world.h" +#include "screen_world.h" #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" -#include "server/heightScore.h" +#include "publicServer.h" +#include "heightScore.h" #endif -#include "net_unix/udp.h" +#include "udp.h" static sock_udp_t *sock_server_udp; static sock_udp_t *sock_server_udp_second; diff --git a/src/base/server.h b/src/base/server.h index 670258c..e6f0b93 100644 --- a/src/base/server.h +++ b/src/base/server.h @@ -5,25 +5,25 @@ #include -#include "base/list.h" -#include "base/tux.h" -#include "base/myTimer.h" -#include "base/protect.h" +#include "list.h" +#include "tux.h" +#include "myTimer.h" +#include "protect.h" #ifndef PUBLIC_SERVER -#include "client/interface.h" +#include "interface.h" #endif #ifdef SUPPORT_NET_SDL_UDP -#include "net_sdl/sdl_udp.h" +#include "sdl_udp.h" #endif #ifdef SUPPORT_NET_UNIX_UDP -#include "net_unix/udp.h" +#include "udp.h" #endif diff --git a/src/base/shot.c b/src/base/shot.c index 96f5692..826bad4 100644 --- a/src/base/shot.c +++ b/src/base/shot.c @@ -3,21 +3,21 @@ #include #include -#include "base/main.h" -#include "base/shot.h" -#include "base/gun.h" -#include "base/net_multiplayer.h" -#include "base/proto.h" -#include "base/idManager.h" +#include "main.h" +#include "shot.h" +#include "gun.h" +#include "net_multiplayer.h" +#include "proto.h" +#include "idManager.h" #ifndef PUBLIC_SERVER -#include "client/image.h" -#include "client/layer.h" -#include "screen/screen_world.h" +#include "image.h" +#include "layer.h" +#include "screen_world.h" #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" +#include "publicServer.h" #endif #ifndef PUBLIC_SERVER diff --git a/src/base/shot.h b/src/base/shot.h index db157cb..06e1bba 100644 --- a/src/base/shot.h +++ b/src/base/shot.h @@ -3,13 +3,13 @@ #define SHOT_H -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/arena.h" +#include "main.h" +#include "list.h" +#include "tux.h" +#include "arena.h" #ifndef PUBLIC_SERVER -#include "client/interface.h" +#include "interface.h" #endif typedef struct shot_struct diff --git a/src/base/storage.h b/src/base/storage.h index af72ba2..81e554e 100644 --- a/src/base/storage.h +++ b/src/base/storage.h @@ -3,8 +3,8 @@ #define STORAGE_H -#include "base/main.h" -#include "base/list.h" +#include "main.h" +#include "list.h" extern list_t* newStorage(); extern void addItemToStorage(list_t *list, char *group, char *name, void *data); diff --git a/src/base/string_length.h b/src/base/string_length.h index c453e60..b1712ee 100644 --- a/src/base/string_length.h +++ b/src/base/string_length.h @@ -3,7 +3,7 @@ #define STR_LENGTH_H -#include "base/main.h" +#include "main.h" #define STR_SIZE 128 #define STR_PROTO_SIZE 128 diff --git a/src/base/textFile.c b/src/base/textFile.c index 5c8c95d..d143601 100755 --- a/src/base/textFile.c +++ b/src/base/textFile.c @@ -6,8 +6,8 @@ #include #include -#include "base/main.h" -#include "base/textFile.h" +#include "main.h" +#include "textFile.h" textFile_t* newTextFile(char *s) { diff --git a/src/base/textFile.h b/src/base/textFile.h index ea15b4d..3917db7 100755 --- a/src/base/textFile.h +++ b/src/base/textFile.h @@ -3,7 +3,7 @@ #define TEXTFILE_H -#include "base/list.h" +#include "list.h" typedef struct str_textFile_t { diff --git a/src/base/tux.c b/src/base/tux.c index 7992bd9..84bc87d 100644 --- a/src/base/tux.c +++ b/src/base/tux.c @@ -4,32 +4,32 @@ #include #include -#include "base/main.h" -#include "base/tux.h" -#include "base/arena.h" -#include "base/shot.h" -#include "base/gun.h" -#include "base/item.h" -#include "base/arena.h" -#include "base/myTimer.h" -#include "base/net_multiplayer.h" -#include "base/proto.h" -#include "base/modules.h" -#include "base/idManager.h" +#include "main.h" +#include "tux.h" +#include "arena.h" +#include "shot.h" +#include "gun.h" +#include "item.h" +#include "arena.h" +#include "myTimer.h" +#include "net_multiplayer.h" +#include "proto.h" +#include "modules.h" +#include "idManager.h" #ifndef PUBLIC_SERVER -#include "client/image.h" -#include "client/layer.h" -#include "client/term.h" -#include "client/radar.h" +#include "image.h" +#include "layer.h" +#include "term.h" +#include "radar.h" -#include "audio/sound.h" +#include "sound.h" -#include "screen/screen_world.h" +#include "screen_world.h" #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" +#include "publicServer.h" #endif #ifndef PUBLIC_SERVER diff --git a/src/base/tux.h b/src/base/tux.h index c8f6e51..4908af7 100644 --- a/src/base/tux.h +++ b/src/base/tux.h @@ -3,9 +3,9 @@ #define TUX_H -#include "base/main.h" -#include "base/list.h" -#include "base/arena.h" +#include "main.h" +#include "list.h" +#include "arena.h" #define TUX_STEP 7 #define TUX_LAYER 0 diff --git a/src/client/Makefile b/src/client/Makefile deleted file mode 100644 index f8fee47..0000000 --- a/src/client/Makefile +++ /dev/null @@ -1,38 +0,0 @@ - - -all: client.o configFile.o font.o game.o image.o interface.o keytable.o language.o layer.o panel.o radar.o screen.o term.o - -client.o: client.c client.h - $(CC) $(CFLAGS) -o client.o -c client.c - -configFile.o: configFile.c configFile.h - $(CC) $(CFLAGS) -o configFile.o -c configFile.c - -font.o: font.c font.h - $(CC) $(CFLAGS) -o font.o -c font.c - -game.o: game.c game.h - $(CC) $(CFLAGS) -o game.o -c game.c - -image.o: image.c image.h - $(CC) $(CFLAGS) -o image.o -c image.c - -interface.o: interface.c interface.h - $(CC) $(CFLAGS) -o interface.o -c interface.c - -layer.o: layer.c layer.h - $(CC) $(CFLAGS) -o layer.o -c layer.c - -panel.o: panel.c panel.h - $(CC) $(CFLAGS) -o panel.o -c panel.c - -radar.o: radar.c radar.h - $(CC) $(CFLAGS) -o radar.o -c radar.c -screen.o: screen.c screen.h - $(CC) $(CFLAGS) -o screen.o -c screen.c - -term.o: term.c term.h - $(CC) $(CFLAGS) -o term.o -c term.c - -clean: - rm -rf *.o diff --git a/src/client/client.c b/src/client/client.c index 2ed5e0a..26df8dc 100644 --- a/src/client/client.c +++ b/src/client/client.c @@ -10,26 +10,26 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/proto.h" +#include "main.h" +#include "list.h" +#include "tux.h" +#include "proto.h" -#include "client/client.h" -#include "client/language.h" +#include "client.h" +#include "language.h" -#include "screen/screen_analyze.h" -#include "screen/screen_world.h" +#include "screen_analyze.h" +#include "screen_world.h" static int protocolType; #ifdef SUPPORT_NET_UNIX_UDP -#include "net_unix/udp.h" +#include "udp.h" static sock_udp_t *sock_server_udp; #endif #ifdef SUPPORT_NET_SDL_UDP -#include "net_sdl/sdl_udp.h" +#include "sdl_udp.h" static sock_sdl_udp_t *sock_server_sdl_udp; #endif diff --git a/src/client/client.h b/src/client/client.h index 639f924..cd8c4c4 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -3,7 +3,7 @@ #define MY_CLIENT -#include "base/main.h" +#include "main.h" #if defined SUPPORT_NET_UNIX_UDP || defined SUPPORT_NET_SDL_UDP diff --git a/src/client/configFile.c b/src/client/configFile.c index acf7a1f..1c19e3f 100644 --- a/src/client/configFile.c +++ b/src/client/configFile.c @@ -4,8 +4,8 @@ #include #include -#include "base/main.h" -#include "client/configFile.h" +#include "main.h" +#include "configFile.h" int isYesOrNO(char *s) { diff --git a/src/client/configFile.h b/src/client/configFile.h index 67898e9..f68a381 100644 --- a/src/client/configFile.h +++ b/src/client/configFile.h @@ -3,8 +3,8 @@ #define CONFIGFILE_H -#include "base/main.h" -#include "base/textFile.h" +#include "main.h" +#include "textFile.h" extern int isYesOrNO(char *s); extern char* getYesOrNo(int n); diff --git a/src/client/font.c b/src/client/font.c index 91d15bb..3b1267a 100755 --- a/src/client/font.c +++ b/src/client/font.c @@ -1,7 +1,7 @@ -#include "base/main.h" -#include "client/interface.h" -#include "client/font.h" +#include "main.h" +#include "interface.h" +#include "font.h" static TTF_Font *g_font; static int fontSize; diff --git a/src/client/font.h b/src/client/font.h index 50b1494..f938b3b 100755 --- a/src/client/font.h +++ b/src/client/font.h @@ -5,7 +5,7 @@ #include #include -#include "base/main.h" +#include "main.h" #define COLOR_WHITE 255, 255, 255 #define COLOR_BLACK 0, 0, 0 diff --git a/src/client/game.c b/src/client/game.c index 66da14e..e70fdae 100644 --- a/src/client/game.c +++ b/src/client/game.c @@ -8,36 +8,36 @@ #include #include -#include "base/main.h" -#include "base/tux.h" -#include "base/homeDirector.h" -#include "base/item.h" -#include "base/shot.h" -#include "base/arenaFile.h" - -#include "client/image.h" -#include "client/layer.h" -#include "client/interface.h" -#include "client/screen.h" -#include "client/font.h" -#include "client/keytable.h" -#include "client/language.h" -#include "client/panel.h" -#include "client/radar.h" - -#include "audio/audio.h" -#include "audio/sound.h" -#include "audio/music.h" - -#include "screen/screen_world.h" -#include "screen/screen_mainMenu.h" -#include "screen/screen_analyze.h" -#include "screen/screen_setting.h" -#include "screen/screen_gameType.h" -#include "screen/screen_choiceArena.h" -#include "screen/screen_table.h" -#include "screen/screen_credits.h" -#include "screen/screen_browser.h" +#include "main.h" +#include "tux.h" +#include "homeDirector.h" +#include "item.h" +#include "shot.h" +#include "arenaFile.h" + +#include "image.h" +#include "layer.h" +#include "interface.h" +#include "screen.h" +#include "font.h" +#include "keytable.h" +#include "language.h" +#include "panel.h" +#include "radar.h" + +#include "audio.h" +#include "sound.h" +#include "music.h" + +#include "screen_world.h" +#include "screen_mainMenu.h" +#include "screen_analyze.h" +#include "screen_setting.h" +#include "screen_gameType.h" +#include "screen_choiceArena.h" +#include "screen_table.h" +#include "screen_credits.h" +#include "screen_browser.h" static void initGame() { diff --git a/src/client/image.c b/src/client/image.c index 98b2b8b..d582193 100755 --- a/src/client/image.c +++ b/src/client/image.c @@ -3,12 +3,12 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/storage.h" +#include "main.h" +#include "list.h" +#include "storage.h" -#include "client/interface.h" -#include "client/image.h" +#include "interface.h" +#include "image.h" static list_t *listStorage; diff --git a/src/client/image.h b/src/client/image.h index 5de6345..be3826d 100755 --- a/src/client/image.h +++ b/src/client/image.h @@ -3,8 +3,8 @@ #define IMAGE_H -#include "client/image.h" -#include "client/interface.h" +#include "image.h" +#include "interface.h" #define IMAGE_NO_ALPHA 0 #define IMAGE_ALPHA 1 diff --git a/src/client/interface.c b/src/client/interface.c index 570e3fd..5b4b6b4 100755 --- a/src/client/interface.c +++ b/src/client/interface.c @@ -1,11 +1,11 @@ #include -#include "base/main.h" -#include "base/myTimer.h" +#include "main.h" +#include "myTimer.h" -#include "client/interface.h" -#include "client/screen.h" +#include "interface.h" +#include "screen.h" //povrch okna static SDL_Surface *screen; diff --git a/src/client/interface.h b/src/client/interface.h index 5804676..c0311ee 100755 --- a/src/client/interface.h +++ b/src/client/interface.h @@ -10,7 +10,7 @@ #include #include #include -#include "base/main.h" +#include "main.h" /* #include diff --git a/src/client/keytable.c b/src/client/keytable.c index 67811a7..8eaee59 100644 --- a/src/client/keytable.c +++ b/src/client/keytable.c @@ -4,13 +4,13 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/homeDirector.h" -#include "base/textFile.h" +#include "main.h" +#include "list.h" +#include "homeDirector.h" +#include "textFile.h" -#include "client/keytable.h" -#include "client/configFile.h" +#include "keytable.h" +#include "configFile.h" static textFile_t *keytableFile; static textFile_t *keycontrolFile; diff --git a/src/client/language.c b/src/client/language.c index 5444253..6200e92 100644 --- a/src/client/language.c +++ b/src/client/language.c @@ -4,13 +4,13 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/homeDirector.h" -#include "base/textFile.h" +#include "main.h" +#include "list.h" +#include "homeDirector.h" +#include "textFile.h" -#include "client/configFile.h" -#include "client/language.h" +#include "configFile.h" +#include "language.h" static textFile_t *languageFile; static char fontFile[STR_FILE_NAME_SIZE]; diff --git a/src/client/layer.c b/src/client/layer.c index 707184b..d4fcb7b 100755 --- a/src/client/layer.c +++ b/src/client/layer.c @@ -2,15 +2,15 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" +#include "main.h" +#include "list.h" +#include "tux.h" -#include "client/interface.h" -#include "client/layer.h" -#include "client/image.h" +#include "interface.h" +#include "layer.h" +#include "image.h" -#include "screen/screen_world.h" +#include "screen_world.h" static list_t *listLayer; diff --git a/src/client/layer.h b/src/client/layer.h index 3564ef8..04a4617 100755 --- a/src/client/layer.h +++ b/src/client/layer.h @@ -3,7 +3,7 @@ #define MY_LAYER_H -#include "base/main.h" +#include "main.h" typedef struct layer_str { diff --git a/src/client/panel.c b/src/client/panel.c index af9cccb..3338544 100644 --- a/src/client/panel.c +++ b/src/client/panel.c @@ -2,14 +2,14 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" - -#include "client/interface.h" -#include "client/image.h" -#include "client/panel.h" -#include "client/font.h" +#include "main.h" +#include "list.h" +#include "tux.h" + +#include "interface.h" +#include "image.h" +#include "panel.h" +#include "font.h" static SDL_Surface *g_panel; static SDL_Surface *g_shot; diff --git a/src/client/panel.h b/src/client/panel.h index 144ea02..4935c75 100644 --- a/src/client/panel.h +++ b/src/client/panel.h @@ -3,8 +3,8 @@ #define PANEL_H -#include "base/main.h" -#include "base/list.h" +#include "main.h" +#include "list.h" #define PANEL_SCORE_LOCATION_X ( WINDOW_SIZE_X / 2 - w / 2 ) #define PANEL_SCORE_LOCATION_Y ( WINDOW_SIZE_Y - 40 ) diff --git a/src/client/radar.c b/src/client/radar.c index 45f80a4..789fb45 100644 --- a/src/client/radar.c +++ b/src/client/radar.c @@ -2,14 +2,14 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/arena.h" - -#include "client/interface.h" -#include "client/image.h" -#include "client/radar.h" +#include "main.h" +#include "list.h" +#include "tux.h" +#include "arena.h" + +#include "interface.h" +#include "image.h" +#include "radar.h" static SDL_Surface *g_radar; static list_t *listRadar; diff --git a/src/client/radar.h b/src/client/radar.h index 989856a..8dd9d88 100644 --- a/src/client/radar.h +++ b/src/client/radar.h @@ -3,7 +3,7 @@ #define RADAR_H -#include "base/arena.h" +#include "arena.h" #define RADAR_LOCATION_X (WINDOW_SIZE_X-110) #define RADAR_LOCATION_Y (10) diff --git a/src/client/screen.c b/src/client/screen.c index 730476e..8a3c29c 100644 --- a/src/client/screen.c +++ b/src/client/screen.c @@ -2,12 +2,12 @@ #include #include -#include "base/main.h" -#include "base/list.h" +#include "main.h" +#include "list.h" -#include "client/interface.h" -#include "client/screen.h" -#include "client/layer.h" +#include "interface.h" +#include "screen.h" +#include "layer.h" static screen_t *currentScreen; static list_t *listScreen; diff --git a/src/client/screen.h b/src/client/screen.h index 8049147..b0d1593 100644 --- a/src/client/screen.h +++ b/src/client/screen.h @@ -3,7 +3,7 @@ #define SCREEN_H -#include "base/main.h" +#include "main.h" typedef struct screen_struct { diff --git a/src/client/term.c b/src/client/term.c index 3357f0b..fc1824d 100644 --- a/src/client/term.c +++ b/src/client/term.c @@ -2,13 +2,13 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/myTimer.h" +#include "main.h" +#include "list.h" +#include "myTimer.h" -#include "client/interface.h" -#include "client/term.h" -#include "client/font.h" +#include "interface.h" +#include "term.h" +#include "font.h" typedef struct struct_term_t { diff --git a/src/client/term.h b/src/client/term.h index 548fda6..b48a2b7 100644 --- a/src/client/term.h +++ b/src/client/term.h @@ -3,7 +3,7 @@ #define TERM_H -#include "base/main.h" +#include "main.h" #define TERM_MAX_LINES 10 #define TERM_DEL_TEXT_TIMEOUT 2000 diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt new file mode 100644 index 0000000..f24230e --- /dev/null +++ b/src/modules/CMakeLists.txt @@ -0,0 +1,52 @@ +#SET ( WORKDIR ${CMAKE_SOURCE_DIR}/src ) +INCLUDE_DIRECTORIES ( ${WORKDIR}/base ) +IF ( NO_Server ) + INCLUDE_DIRECTORIES ( ${WORKDIR}/client ) + INCLUDE_DIRECTORIES ( ${WORKDIR}/screen ) + INCLUDE_DIRECTORIES ( ${WORKDIR}/widget ) + FIND_PACKAGE ( SDL REQUIRED ) + FIND_PACKAGE ( SDL_image REQUIRED ) + FIND_PACKAGE ( SDL_ttf REQUIRED ) + INCLUDE_DIRECTORIES ( ${SDL_INCLUDE_DIR} ${SDLIMAGE_INCLUDE_DIR} ${SDLTTF_INCLUDE_DIR} ) + IF ( NOT NO_Audio ) + INCLUDE_DIRECTORIES ( ${WORKDIR}/audio ) + FIND_PACKAGE ( SDL_mixer REQUIRED ) + INCLUDE_DIRECTORIES ( ${SDLMIXER_INCLUDE_DIR} ) + LINK_LIBRARIES ( ${CMAKE_DL_LIBS} ${SDL_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLTTF_LIBRARY} SDLmain ) + ELSE (NOT NO_Audio) + ADD_DEFINITIONS ( -DNO_SOUND ) + LINK_LIBRARIES ( ${CMAKE_DL_LIBS} ${SDL_LIBRARY} SDLmain ) + ENDIF ( NOT NO_Audio ) +ELSE ( NO_Server ) + INCLUDE_DIRECTORIES ( ${WORKDIR}/server ) + ADD_DEFINITIONS ( -DPUBLIC_SERVER ) + ADD_DEFINITIONS ( -DNO_SOUND ) +ENDIF ( NO_Server ) +SET ( SRC_base_modules +${WORKDIR}/base/index.c ${WORKDIR}/base/space.c ${WORKDIR}/base/list.c +) +SET ( SRC_modWall +${SRC_base_modules} +modWall.c +) +SET ( SRC_modPipe +${SRC_base_modules} +modPipe.c +) +SET ( SRC_modTeleport +${SRC_base_modules} +modTeleport.c +) +SET ( SRC_modAI +${SRC_base_modules} +modAI.c +) + +ADD_LIBRARY ( modWall SHARED ${SRC_modWall} ) +ADD_LIBRARY ( modPipe SHARED ${SRC_modPipe} ) +ADD_LIBRARY ( modTeleport SHARED ${SRC_modTeleport} ) +ADD_LIBRARY ( modAI SHARED ${SRC_modAI} ) +INSTALL ( TARGETS modWall LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${APPNAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +INSTALL ( TARGETS modPipe LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${APPNAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +INSTALL ( TARGETS modTeleport LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${APPNAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +INSTALL ( TARGETS modAI LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/${APPNAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) \ No newline at end of file diff --git a/src/modules/Makefile b/src/modules/Makefile deleted file mode 100755 index 81f6c54..0000000 --- a/src/modules/Makefile +++ /dev/null @@ -1,31 +0,0 @@ - -all: modWall.so modPipe.so modTeleport.so modAI.so - -list.o: ../base/list.c ../base/list.h - $(CC) $(CFLAGS) -fPIC -o list.o -c ../base/list.c - -space.o: ../base/space.c ../base/space.h - $(CC) $(CFLAGS) -fPIC -o space.o -c ../base/space.c - -index.o: ../base/index.c ../base/index.h - $(CC) $(CFLAGS) -fPIC -o index.o -c ../base/index.c - -modWall.so: list.o space.o index.o - gcc $(CFLAGS) -fPIC -c modWall.c -o modWall.o - gcc $(CFLAGS) -I../include -shared -fPIC -o modWall.so modWall.o list.o space.o index.o - -modPipe.so: list.o space.o index.o - gcc $(CFLAGS) -fPIC -c modPipe.c -o modPipe.o - gcc $(CFLAGS) -I../include -shared -fPIC -o modPipe.so modPipe.o list.o space.o index.o - -modTeleport.so: list.o space.o index.o - gcc $(CFLAGS) -fPIC -c modTeleport.c -o modTeleport.o - gcc $(CFLAGS) -I../include -shared -fPIC -o modTeleport.so modTeleport.o list.o space.o index.o - -modAI.so: list.o space.o index.o - gcc $(CFLAGS) -fPIC -c modAI.c -o modAI.o - gcc $(CFLAGS) -I../include -shared -fPIC -o modAI.so modAI.o list.o space.o index.o - -clean: - rm -rf *.o - rm -rf *.so diff --git a/src/modules/modAI.c b/src/modules/modAI.c index d3a9f78..53f689e 100755 --- a/src/modules/modAI.c +++ b/src/modules/modAI.c @@ -4,21 +4,21 @@ #include #include -#include "base/main.h" -#include "base/modules.h" -#include "base/tux.h" -#include "base/shot.h" -#include "base/list.h" -#include "base/gun.h" -#include "base/space.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 "client/interface.h" -#include "client/image.h" +#include "interface.h" +#include "image.h" #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" +#include "publicServer.h" #endif static export_fce_t *export_fce; diff --git a/src/modules/modPipe.c b/src/modules/modPipe.c index 77f2c05..2c1a6e5 100755 --- a/src/modules/modPipe.c +++ b/src/modules/modPipe.c @@ -4,21 +4,21 @@ #include #include -#include "base/main.h" -#include "base/modules.h" -#include "base/tux.h" -#include "base/shot.h" -#include "base/list.h" -#include "base/gun.h" -#include "base/space.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 "client/interface.h" -#include "client/image.h" +#include "interface.h" +#include "image.h" #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" +#include "publicServer.h" #endif typedef struct pipe_struct diff --git a/src/modules/modTeleport.c b/src/modules/modTeleport.c index 724e371..2b94e2f 100755 --- a/src/modules/modTeleport.c +++ b/src/modules/modTeleport.c @@ -4,21 +4,21 @@ #include #include -#include "base/main.h" -#include "base/modules.h" -#include "base/tux.h" -#include "base/shot.h" -#include "base/list.h" -#include "base/gun.h" -#include "base/space.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 "client/interface.h" -#include "client/image.h" +#include "interface.h" +#include "image.h" #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" +#include "publicServer.h" #endif typedef struct teleport_struct diff --git a/src/modules/modWall.c b/src/modules/modWall.c index 35d84e6..7d36957 100755 --- a/src/modules/modWall.c +++ b/src/modules/modWall.c @@ -3,21 +3,21 @@ #include #include -#include "base/main.h" -#include "base/modules.h" -#include "base/tux.h" -#include "base/shot.h" -#include "base/list.h" -#include "base/gun.h" -#include "base/space.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 "client/interface.h" -#include "client/image.h" +#include "interface.h" +#include "image.h" #endif #ifdef PUBLIC_SERVER -#include "server/publicServer.h" +#include "publicServer.h" #endif typedef struct wall_struct diff --git a/src/net/dns.c b/src/net/dns.c new file mode 100644 index 0000000..a8e5030 --- /dev/null +++ b/src/net/dns.c @@ -0,0 +1,19 @@ + +#include +#include + +#include "main.h" + +char* getIPFormDNS(char *domain) +{ + struct hostent *host; + + host = gethostbyname(domain); + + if( host == NULL || host->h_addr_list[0] == NULL ) + { + return NULL; + } + + return strdup( inet_ntoa( * ( (struct in_addr *) host->h_addr_list[0] ) ) ); +} diff --git a/src/net/dns.h b/src/net/dns.h new file mode 100644 index 0000000..ae92c35 --- /dev/null +++ b/src/net/dns.h @@ -0,0 +1,8 @@ + +#ifndef DNS_H + +#define DNS_H + +extern char* getIPFormDNS(char *domain); + +#endif diff --git a/src/net/udp.c b/src/net/udp.c new file mode 100644 index 0000000..8a0623e --- /dev/null +++ b/src/net/udp.c @@ -0,0 +1,374 @@ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BUFSIZE 1000 + +#include "main.h" +#include "net_multiplayer.h" + +#include "udp.h" + +sock_udp_t* newSockUdp(int proto) +{ + sock_udp_t *new; + + new = malloc( sizeof(sock_udp_t) ); + memset(new, 0, sizeof(sock_udp_t)); + new->proto = proto; + + return new; +} + +void destroySockUdp(sock_udp_t *p) +{ + assert( p != NULL ); + free(p); +} + +sock_udp_t* bindUdpSocket(char *address, int port, int proto) +{ + sock_udp_t *new; + int res; + + assert( port > 0 && port < 65535 ); + + new = newSockUdp(proto); + + assert( new != NULL ); + + if( new->proto == PROTO_UDPv4 ) + { + new->sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + } + +#ifdef SUPPORT_IPv6 + if( new->proto == PROTO_UDPv6 ) + { + new->sock = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); + } +#endif + + if( new->sock < 0 ) + { + fprintf(stderr, "nemozem vytvorit socket !\n"); + destroySockUdp(new); + return NULL; + } + + memset(&(new->sockAddr), 0, sizeof(new->sockAddr)); + + if( new->proto == PROTO_UDPv4 ) + { + new->sockAddr.sin_family = AF_INET; + new->sockAddr.sin_port = htons(port); + new->sockAddr.sin_addr.s_addr = inet_addr(address); + + res = bind(new->sock, (struct sockaddr *)&(new->sockAddr), sizeof(new->sockAddr)); + } + +#ifdef SUPPORT_IPv6 + if( new->proto == PROTO_UDPv6 ) + { + new->sockAddr6.sin6_family = AF_INET6; + new->sockAddr6.sin6_port = htons(port); + inet_pton(AF_INET6, address, &(new->sockAddr6.sin6_addr)); + + res = bind(new->sock, (struct sockaddr *)&(new->sockAddr6), sizeof(new->sockAddr6)); + } +#endif + + if( res < 0 ) + { + fprintf(stderr, "nemozem nastavit sokcet %s %d !\n", address, port); + destroySockUdp(new); + return NULL; + } + + return new; +} + +sock_udp_t* connectUdpSocket(char *address, int port, int proto) +{ + sock_udp_t *new; + + assert( address != NULL ); + assert( port > 0 && port < 65536 ); + + new = newSockUdp(proto); + + assert( new != NULL ); + + if( new->proto == PROTO_UDPv4 ) + { + new->sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + } + +#ifdef SUPPORT_IPv6 + if( new->proto == PROTO_UDPv6 ) + { + new->sock = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); + } +#endif + + if( new->sock < 0 ) + { + fprintf(stderr, "nemozem vytvorit socket !\n"); + destroySockUdp(new); + return NULL; + } + + memset(&(new->sockAddr), 0, sizeof(new->sockAddr)); + + if( new->proto == PROTO_UDPv4 ) + { + new->sockAddr.sin_family = AF_INET; + new->sockAddr.sin_port = htons(port); + new->sockAddr.sin_addr.s_addr = inet_addr(address); + } + +#ifdef SUPPORT_IPv6 + if( new->proto == PROTO_UDPv6 ) + { + new->sockAddr6.sin6_family = AF_INET6; + new->sockAddr6.sin6_port = htons(port); + inet_pton(AF_INET6, address, &(new->sockAddr6.sin6_addr)); + } +#endif + return new; +} + +int setUdpSockNonBlock(sock_udp_t *p) +{ + int oldFlag; + + oldFlag = fcntl (p->sock, F_GETFL, 0); + + if( fcntl(p->sock, F_SETFL, oldFlag|O_NONBLOCK ) == -1 ) + { + return -1; + } + + return 0; +} + +int readUdpSocket(sock_udp_t *src, sock_udp_t *dst, void *address, int len) +{ + int addrlen; + int size; + + assert( src != NULL ); + assert( dst != NULL ); + assert( address != NULL ); + + if( dst->proto == PROTO_UDPv4 ) + { + addrlen = sizeof(src->sockAddr); + + size = recvfrom(src->sock, address, len, 0, + (struct sockaddr *)&dst->sockAddr, (socklen_t *)&addrlen); + } + +#ifdef SUPPORT_IPv6 + if( dst->proto == PROTO_UDPv6 ) + { + addrlen = sizeof(src->sockAddr6); + + size = recvfrom(src->sock, address, len, 0, + (struct sockaddr *)&dst->sockAddr6, (socklen_t *)&addrlen); + } +#endif + + if( size < 0 ) + { + char str_ip[STR_IP_SIZE]; + + getSockUdpIp(dst, str_ip, STR_IP_SIZE); + + fprintf(stderr, "nemozem zapisat zo socketu %d %s %d!\n", size, str_ip, getSockUdpPort(dst)); + return -1; + } + + return size; +} + +int writeUdpSocket(sock_udp_t *src, sock_udp_t *dst, void *address, int len) +{ + int addrlen; + int size; + + assert( src != NULL ); + assert( dst != NULL ); + assert( address != NULL ); + + if( dst->proto == PROTO_UDPv4 ) + { + addrlen = sizeof(src->sockAddr); + + size = sendto(src->sock, address, len, 0, + (struct sockaddr *)&dst->sockAddr, (socklen_t)addrlen); + } + +#ifdef SUPPORT_IPv6 + if( dst->proto == PROTO_UDPv6 ) + { + addrlen = sizeof(src->sockAddr6); + + size = sendto(src->sock, address, len, 0, + (struct sockaddr *)&dst->sockAddr6, (socklen_t)addrlen); + } +#endif + + if( size < 0 ) + { + char str_ip[STR_IP_SIZE]; + + getSockUdpIp(dst, str_ip, STR_IP_SIZE); + + fprintf(stderr, "nemozem zapisat na socket %d %s %d!\n", size, str_ip, getSockUdpPort(dst)); + return -1; + } + + return size; +} + +void getSockUdpIp(sock_udp_t *p, char *str_ip, int len) +{ + assert( p != NULL ); + assert( str_ip != NULL ); + + + if( p->proto == PROTO_UDPv4 ) + { + //strcpy(str_ip, inet_ntoa(p->sockAddr.sin_addr)); + //printf("strcpy(str_ip, inet_ntoa(p->sockAddr.sin_addr));\n"); + inet_ntop(AF_INET, &(p->sockAddr.sin_addr), str_ip, len); + } + +#ifdef SUPPORT_IPv6 + if( p->proto == PROTO_UDPv6 ) + { + inet_ntop(AF_INET6, &(p->sockAddr6.sin6_addr), str_ip, len); + } +#endif +} + +int getSockUdpPort(sock_udp_t *p) +{ + assert( p != NULL ); + + if( p->proto == PROTO_UDPv4 ) + { + return htons(p->sockAddr.sin_port); + } + +#ifdef SUPPORT_IPv6 + if( p->proto == PROTO_UDPv6 ) + { + return htons(p->sockAddr6.sin6_port); + } +#endif + + assert( ! "bad proto !" ); + + return -1; +} + + +void closeUdpSocket(sock_udp_t *p) +{ + assert( p != NULL ); + + close(p->sock); + destroySockUdp(p); +} + +#if 0 + +static int myWait(sock_udp_t *p) +{ + fd_set readfds; + fd_set errorfds; + struct timeval tv; + int max_fd; + + tv.tv_sec = 1; + tv.tv_usec = 0; + + FD_ZERO(&readfds); + FD_ZERO(&errorfds); + max_fd = p->sock; + + FD_SET(p->sock, &readfds); + FD_SET(p->sock, &errorfds); + + select(max_fd+1, &readfds, (fd_set *)0, &errorfds, &tv); + + if( FD_ISSET(p->sock, &readfds) ) + { + FD_CLR(p->sock, &readfds); + return 1; + } + + return 0; +} + +int main(int argc, char *argv[]) +{ + sock_udp_t *sock; + char buf[BUFSIZE]; + int ret; + + if( strcmp(argv[1], "s") == 0 ) + { + sock_udp_t *cli; + + //sock = bindUdpSocket("::1", atoi(argv[2]), PROTO_UDPv6 ); + sock = bindUdpSocket("127.0.0.1", atoi(argv[2]), PROTO_UDPv4 ); + + //cli = newSockUdp(PROTO_UDPv6); + cli = newSockUdp(PROTO_UDPv4); + + while(1) + { + while( myWait(sock) == 0 ) + ; + + memset(buf, 0, BUFSIZE); + ret = readUdpSocket(sock, cli, buf, BUFSIZE); + writeUdpSocket(sock, cli, buf, ret); + } + } + + if( strcmp(argv[1], "c") == 0 ) + { + //sock = connectUdpSocket("::1", atoi(argv[2]), PROTO_UDPv6); + sock = connectUdpSocket("127.0.0.1", atoi(argv[2]), PROTO_UDPv4); + + strcpy(buf, "Hello world !\n"); + writeUdpSocket(sock, sock, buf, strlen(buf)); + + memset(buf, 0, BUFSIZE); + readUdpSocket(sock, sock, buf, BUFSIZE); + + printf("buf = %s", buf); + //while(1)sleep(1); + closeUdpSocket(sock); + } + + return 0; +} +#endif + diff --git a/src/net/udp.h b/src/net/udp.h new file mode 100644 index 0000000..a9a38f6 --- /dev/null +++ b/src/net/udp.h @@ -0,0 +1,31 @@ + +#ifndef MY_UDP + +#include + +#define MY_UDP + +#define SUPPORT_IPv6 + +typedef struct struct_sock_udp_t +{ + int sock; + int proto; + +#ifdef SUPPORT_IPv6 + struct sockaddr_in6 sockAddr6; +#endif + struct sockaddr_in sockAddr; +} sock_udp_t; + +extern sock_udp_t* newSockUdp(int proto); +extern void destroySockUdp(sock_udp_t *p); +extern sock_udp_t* bindUdpSocket(char *address, int port, int proto); +extern sock_udp_t* connectUdpSocket(char *address, int port, int proto); +extern int setUdpSockNonBlock(sock_udp_t *p); +extern int readUdpSocket(sock_udp_t *src, sock_udp_t *dst, void *address, int len); +extern int writeUdpSocket(sock_udp_t *src, sock_udp_t *dst, void *address, int len); +extern void getSockUdpIp(sock_udp_t *p, char *str_ip, int len); +extern int getSockUdpPort(sock_udp_t *p); +extern void closeUdpSocket(sock_udp_t *p); +#endif diff --git a/src/net_sdl/Makefile b/src/net_sdl/Makefile deleted file mode 100644 index f0ffb5b..0000000 --- a/src/net_sdl/Makefile +++ /dev/null @@ -1,9 +0,0 @@ - - -all: sdl_udp.o - -sdl_udp.o: sdl_udp.c sdl_udp.h - $(CC) $(CFLAGS) -o sdl_udp.o -c sdl_udp.c - -clean: - rm -rf *.o diff --git a/src/net_sdl/sdl_udp.c b/src/net_sdl/sdl_udp.c deleted file mode 100644 index f30ba75..0000000 --- a/src/net_sdl/sdl_udp.c +++ /dev/null @@ -1,219 +0,0 @@ - - -#include -#include -#include -#include -#include - -#include "base/main.h" -#include "net_sdl/sdl_udp.h" - -#define BUFSIZE 1000 - - -sock_sdl_udp_t* newSdlSockUdp() -{ - sock_sdl_udp_t *new; - - new = malloc( sizeof(sock_sdl_udp_t) ); - memset(new, 0, sizeof(sock_sdl_udp_t)); - - if( !( new->packet = SDLNet_AllocPacket(512) ) ) - { - fprintf(stderr, "nemozem alokovat pamat pre packet !\n"); - destroySockSdlUdp(new); - } - - return new; -} - -void destroySockSdlUdp(sock_sdl_udp_t *p) -{ - assert( p != NULL ); - - SDLNet_FreePacket(p->packet); - free(p); -} - -sock_sdl_udp_t* bindSdlUdpSocket(int port) -{ - sock_sdl_udp_t *new; - - assert( port > 0 && port < 65535 ); - - new = newSdlSockUdp(); - - assert( new != NULL ); - - if( SDLNet_Init() < 0 ) - { - fprintf(stderr, "nemozem initcializovat SDLnet !\n"); - destroySockSdlUdp(new); - return NULL; - } - - if( !( new->sock = SDLNet_UDP_Open(port) ) ) - { - fprintf(stderr, "nemozem otovrit socket !\n"); - destroySockSdlUdp(new); - return NULL; - } - - new->type = SDL_UDP_SERVER; - - return new; -} - -sock_sdl_udp_t* connectSdlUdpSocket(char *address, int port) -{ - sock_sdl_udp_t *new; - - assert( address != NULL ); - assert( port > 0 && port < 65536 ); - - new = newSdlSockUdp(); - - assert( new != NULL ); - - /* Initialize SDL_net */ - if( SDLNet_Init() < 0 ) - { - fprintf(stderr, "nemozem initcializovat SDLnet !\n"); - destroySockSdlUdp(new); - return NULL; - } - - /* Open a socket on random port */ - if( !( new->sock = SDLNet_UDP_Open(0) ) ) - { - fprintf(stderr, "nemozem otovrit socket !\n"); - destroySockSdlUdp(new); - return NULL; - } - - /* Resolve server name */ - if( SDLNet_ResolveHost(&(new->srvadd), address, port) ) - { - fprintf(stderr, "nemozem sa pripojit na sokcet !\n"); - destroySockSdlUdp(new); - return NULL; - } - - new->type = SDL_UDP_CLIENT; - - return new; -} - -int readSdlUdpSocket(sock_sdl_udp_t *src, sock_sdl_udp_t *dst, void *address, int len) -{ - int x; - - if( SDLNet_UDP_Recv(src->sock, dst->packet) ) - { - x = (dst->packet->len > len ? len : dst->packet->len); - memcpy(address, dst->packet->data, x); - return x; - } - - return -1; -} - -int writeSdlUdpSocket(sock_sdl_udp_t *src, sock_sdl_udp_t *dst, void *address, int len) -{ - assert( src != NULL ); - assert( address != NULL ); - -#ifdef DEBUG_LOST_PACKET - if( rand() % DEBUG_LOST_PACKET == 0 ) - { - printf("debug lost packet %s\n", address); - return size; - } -#endif - - memcpy(dst->packet->data, address, len); - dst->packet->len = len; - - if( src->type == SDL_UDP_CLIENT ) - { - dst->packet->address.host = src->srvadd.host; - dst->packet->address.port = src->srvadd.port; - } - - SDLNet_UDP_Send(src->sock, -1, dst->packet); - - return len; -} - -int getSockSdlUdpPort(sock_sdl_udp_t *p) -{ - assert( p != NULL ); - - return p->packet->address.port; -} - - -void closeSdlUdpSocket(sock_sdl_udp_t *p) -{ - assert( p != NULL ); - - SDLNet_UDP_Close(p->sock); - - printf("close connect\n"); - - destroySockSdlUdp(p); -} - -#if 0 -int main(int argc, char *argv[]) -{ - sock_sdl_udp_t *sock; - char buf[BUFSIZE]; - int ret; - - if( strcmp(argv[1], "s") == 0 ) - { - sock_sdl_udp_t *cli; - - sock = bindSdlUdpSocket( atoi(argv[2]) ); - cli = newSdlSockUdp(); - - while(1) - { - memset(buf, 0, BUFSIZE); - - ret = readSdlUdpSocket(sock, cli, buf, BUFSIZE); - - if( ret > 0 ) - { - writeSdlUdpSocket(sock, cli, buf, ret); - } - } - } - - if( strcmp(argv[1], "c") == 0 ) - { - sock = connectSdlUdpSocket("127.0.0.1", atoi(argv[2])); - - strcpy(buf, "Hello world !\n"); - writeSdlUdpSocket(sock, sock, buf, strlen(buf)); - - while(1) - { - memset(buf, 0, BUFSIZE); - ret = readSdlUdpSocket(sock, sock, buf, BUFSIZE); - - if( ret > 0 ) - { - printf("buf = %s", buf); - } - } - - closeSdlUdpSocket(sock); - } - - return 0; -} - -#endif diff --git a/src/net_sdl/sdl_udp.h b/src/net_sdl/sdl_udp.h deleted file mode 100644 index 91a3c71..0000000 --- a/src/net_sdl/sdl_udp.h +++ /dev/null @@ -1,28 +0,0 @@ - -#ifndef MY_SDL_UDP - -#include - -#define MY_SDL_UDP - -#define SDL_UDP_SERVER 0 -#define SDL_UDP_CLIENT 1 - -typedef struct struct_sock_sdl_udp_t -{ - int type; - UDPsocket sock; - IPaddress srvadd; - UDPpacket *packet; -} sock_sdl_udp_t; - -sock_sdl_udp_t* newSdlSockUdp(); -void destroySockSdlUdp(sock_sdl_udp_t *p); -sock_sdl_udp_t* bindSdlUdpSocket(int port); -sock_sdl_udp_t* connectSdlUdpSocket(char *address, int port); -int readSdlUdpSocket(sock_sdl_udp_t *src, sock_sdl_udp_t *dst, void *address, int len); -int writeSdlUdpSocket(sock_sdl_udp_t *src, sock_sdl_udp_t *dst, void *address, int len); -int getSockSdlUdpPort(sock_sdl_udp_t *p); -void closeSdlUdpSocket(sock_sdl_udp_t *p); - -#endif diff --git a/src/net_unix/Makefile b/src/net_unix/Makefile deleted file mode 100644 index d13af8e..0000000 --- a/src/net_unix/Makefile +++ /dev/null @@ -1,12 +0,0 @@ - - -all: udp.o dns.o - -dns.o: dns.c dns.h - $(CC) $(CFLAGS) -o dns.o -c dns.c - -udp.o: udp.c udp.h - $(CC) $(CFLAGS) -o udp.o -c udp.c - -clean: - rm -rf *.o diff --git a/src/net_unix/dns.c b/src/net_unix/dns.c deleted file mode 100644 index f4036a2..0000000 --- a/src/net_unix/dns.c +++ /dev/null @@ -1,19 +0,0 @@ - -#include -#include - -#include "base/main.h" - -char* getIPFormDNS(char *domain) -{ - struct hostent *host; - - host = gethostbyname(domain); - - if( host == NULL || host->h_addr_list[0] == NULL ) - { - return NULL; - } - - return strdup( inet_ntoa( * ( (struct in_addr *) host->h_addr_list[0] ) ) ); -} diff --git a/src/net_unix/dns.h b/src/net_unix/dns.h deleted file mode 100644 index ae92c35..0000000 --- a/src/net_unix/dns.h +++ /dev/null @@ -1,8 +0,0 @@ - -#ifndef DNS_H - -#define DNS_H - -extern char* getIPFormDNS(char *domain); - -#endif diff --git a/src/net_unix/udp.c b/src/net_unix/udp.c deleted file mode 100644 index 13cb916..0000000 --- a/src/net_unix/udp.c +++ /dev/null @@ -1,374 +0,0 @@ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define BUFSIZE 1000 - -#include "base/main.h" -#include "base/net_multiplayer.h" - -#include "net_unix/udp.h" - -sock_udp_t* newSockUdp(int proto) -{ - sock_udp_t *new; - - new = malloc( sizeof(sock_udp_t) ); - memset(new, 0, sizeof(sock_udp_t)); - new->proto = proto; - - return new; -} - -void destroySockUdp(sock_udp_t *p) -{ - assert( p != NULL ); - free(p); -} - -sock_udp_t* bindUdpSocket(char *address, int port, int proto) -{ - sock_udp_t *new; - int res; - - assert( port > 0 && port < 65535 ); - - new = newSockUdp(proto); - - assert( new != NULL ); - - if( new->proto == PROTO_UDPv4 ) - { - new->sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - } - -#ifdef SUPPORT_IPv6 - if( new->proto == PROTO_UDPv6 ) - { - new->sock = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); - } -#endif - - if( new->sock < 0 ) - { - fprintf(stderr, "nemozem vytvorit socket !\n"); - destroySockUdp(new); - return NULL; - } - - memset(&(new->sockAddr), 0, sizeof(new->sockAddr)); - - if( new->proto == PROTO_UDPv4 ) - { - new->sockAddr.sin_family = AF_INET; - new->sockAddr.sin_port = htons(port); - new->sockAddr.sin_addr.s_addr = inet_addr(address); - - res = bind(new->sock, (struct sockaddr *)&(new->sockAddr), sizeof(new->sockAddr)); - } - -#ifdef SUPPORT_IPv6 - if( new->proto == PROTO_UDPv6 ) - { - new->sockAddr6.sin6_family = AF_INET6; - new->sockAddr6.sin6_port = htons(port); - inet_pton(AF_INET6, address, &(new->sockAddr6.sin6_addr)); - - res = bind(new->sock, (struct sockaddr *)&(new->sockAddr6), sizeof(new->sockAddr6)); - } -#endif - - if( res < 0 ) - { - fprintf(stderr, "nemozem nastavit sokcet %s %d !\n", address, port); - destroySockUdp(new); - return NULL; - } - - return new; -} - -sock_udp_t* connectUdpSocket(char *address, int port, int proto) -{ - sock_udp_t *new; - - assert( address != NULL ); - assert( port > 0 && port < 65536 ); - - new = newSockUdp(proto); - - assert( new != NULL ); - - if( new->proto == PROTO_UDPv4 ) - { - new->sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - } - -#ifdef SUPPORT_IPv6 - if( new->proto == PROTO_UDPv6 ) - { - new->sock = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); - } -#endif - - if( new->sock < 0 ) - { - fprintf(stderr, "nemozem vytvorit socket !\n"); - destroySockUdp(new); - return NULL; - } - - memset(&(new->sockAddr), 0, sizeof(new->sockAddr)); - - if( new->proto == PROTO_UDPv4 ) - { - new->sockAddr.sin_family = AF_INET; - new->sockAddr.sin_port = htons(port); - new->sockAddr.sin_addr.s_addr = inet_addr(address); - } - -#ifdef SUPPORT_IPv6 - if( new->proto == PROTO_UDPv6 ) - { - new->sockAddr6.sin6_family = AF_INET6; - new->sockAddr6.sin6_port = htons(port); - inet_pton(AF_INET6, address, &(new->sockAddr6.sin6_addr)); - } -#endif - return new; -} - -int setUdpSockNonBlock(sock_udp_t *p) -{ - int oldFlag; - - oldFlag = fcntl (p->sock, F_GETFL, 0); - - if( fcntl(p->sock, F_SETFL, oldFlag|O_NONBLOCK ) == -1 ) - { - return -1; - } - - return 0; -} - -int readUdpSocket(sock_udp_t *src, sock_udp_t *dst, void *address, int len) -{ - int addrlen; - int size; - - assert( src != NULL ); - assert( dst != NULL ); - assert( address != NULL ); - - if( dst->proto == PROTO_UDPv4 ) - { - addrlen = sizeof(src->sockAddr); - - size = recvfrom(src->sock, address, len, 0, - (struct sockaddr *)&dst->sockAddr, (socklen_t *)&addrlen); - } - -#ifdef SUPPORT_IPv6 - if( dst->proto == PROTO_UDPv6 ) - { - addrlen = sizeof(src->sockAddr6); - - size = recvfrom(src->sock, address, len, 0, - (struct sockaddr *)&dst->sockAddr6, (socklen_t *)&addrlen); - } -#endif - - if( size < 0 ) - { - char str_ip[STR_IP_SIZE]; - - getSockUdpIp(dst, str_ip, STR_IP_SIZE); - - fprintf(stderr, "nemozem zapisat zo socketu %d %s %d!\n", size, str_ip, getSockUdpPort(dst)); - return -1; - } - - return size; -} - -int writeUdpSocket(sock_udp_t *src, sock_udp_t *dst, void *address, int len) -{ - int addrlen; - int size; - - assert( src != NULL ); - assert( dst != NULL ); - assert( address != NULL ); - - if( dst->proto == PROTO_UDPv4 ) - { - addrlen = sizeof(src->sockAddr); - - size = sendto(src->sock, address, len, 0, - (struct sockaddr *)&dst->sockAddr, (socklen_t)addrlen); - } - -#ifdef SUPPORT_IPv6 - if( dst->proto == PROTO_UDPv6 ) - { - addrlen = sizeof(src->sockAddr6); - - size = sendto(src->sock, address, len, 0, - (struct sockaddr *)&dst->sockAddr6, (socklen_t)addrlen); - } -#endif - - if( size < 0 ) - { - char str_ip[STR_IP_SIZE]; - - getSockUdpIp(dst, str_ip, STR_IP_SIZE); - - fprintf(stderr, "nemozem zapisat na socket %d %s %d!\n", size, str_ip, getSockUdpPort(dst)); - return -1; - } - - return size; -} - -void getSockUdpIp(sock_udp_t *p, char *str_ip, int len) -{ - assert( p != NULL ); - assert( str_ip != NULL ); - - - if( p->proto == PROTO_UDPv4 ) - { - //strcpy(str_ip, inet_ntoa(p->sockAddr.sin_addr)); - //printf("strcpy(str_ip, inet_ntoa(p->sockAddr.sin_addr));\n"); - inet_ntop(AF_INET, &(p->sockAddr.sin_addr), str_ip, len); - } - -#ifdef SUPPORT_IPv6 - if( p->proto == PROTO_UDPv6 ) - { - inet_ntop(AF_INET6, &(p->sockAddr6.sin6_addr), str_ip, len); - } -#endif -} - -int getSockUdpPort(sock_udp_t *p) -{ - assert( p != NULL ); - - if( p->proto == PROTO_UDPv4 ) - { - return htons(p->sockAddr.sin_port); - } - -#ifdef SUPPORT_IPv6 - if( p->proto == PROTO_UDPv6 ) - { - return htons(p->sockAddr6.sin6_port); - } -#endif - - assert( ! "bad proto !" ); - - return -1; -} - - -void closeUdpSocket(sock_udp_t *p) -{ - assert( p != NULL ); - - close(p->sock); - destroySockUdp(p); -} - -#if 0 - -static int myWait(sock_udp_t *p) -{ - fd_set readfds; - fd_set errorfds; - struct timeval tv; - int max_fd; - - tv.tv_sec = 1; - tv.tv_usec = 0; - - FD_ZERO(&readfds); - FD_ZERO(&errorfds); - max_fd = p->sock; - - FD_SET(p->sock, &readfds); - FD_SET(p->sock, &errorfds); - - select(max_fd+1, &readfds, (fd_set *)0, &errorfds, &tv); - - if( FD_ISSET(p->sock, &readfds) ) - { - FD_CLR(p->sock, &readfds); - return 1; - } - - return 0; -} - -int main(int argc, char *argv[]) -{ - sock_udp_t *sock; - char buf[BUFSIZE]; - int ret; - - if( strcmp(argv[1], "s") == 0 ) - { - sock_udp_t *cli; - - //sock = bindUdpSocket("::1", atoi(argv[2]), PROTO_UDPv6 ); - sock = bindUdpSocket("127.0.0.1", atoi(argv[2]), PROTO_UDPv4 ); - - //cli = newSockUdp(PROTO_UDPv6); - cli = newSockUdp(PROTO_UDPv4); - - while(1) - { - while( myWait(sock) == 0 ) - ; - - memset(buf, 0, BUFSIZE); - ret = readUdpSocket(sock, cli, buf, BUFSIZE); - writeUdpSocket(sock, cli, buf, ret); - } - } - - if( strcmp(argv[1], "c") == 0 ) - { - //sock = connectUdpSocket("::1", atoi(argv[2]), PROTO_UDPv6); - sock = connectUdpSocket("127.0.0.1", atoi(argv[2]), PROTO_UDPv4); - - strcpy(buf, "Hello world !\n"); - writeUdpSocket(sock, sock, buf, strlen(buf)); - - memset(buf, 0, BUFSIZE); - readUdpSocket(sock, sock, buf, BUFSIZE); - - printf("buf = %s", buf); - //while(1)sleep(1); - closeUdpSocket(sock); - } - - return 0; -} -#endif - diff --git a/src/net_unix/udp.h b/src/net_unix/udp.h deleted file mode 100644 index a9a38f6..0000000 --- a/src/net_unix/udp.h +++ /dev/null @@ -1,31 +0,0 @@ - -#ifndef MY_UDP - -#include - -#define MY_UDP - -#define SUPPORT_IPv6 - -typedef struct struct_sock_udp_t -{ - int sock; - int proto; - -#ifdef SUPPORT_IPv6 - struct sockaddr_in6 sockAddr6; -#endif - struct sockaddr_in sockAddr; -} sock_udp_t; - -extern sock_udp_t* newSockUdp(int proto); -extern void destroySockUdp(sock_udp_t *p); -extern sock_udp_t* bindUdpSocket(char *address, int port, int proto); -extern sock_udp_t* connectUdpSocket(char *address, int port, int proto); -extern int setUdpSockNonBlock(sock_udp_t *p); -extern int readUdpSocket(sock_udp_t *src, sock_udp_t *dst, void *address, int len); -extern int writeUdpSocket(sock_udp_t *src, sock_udp_t *dst, void *address, int len); -extern void getSockUdpIp(sock_udp_t *p, char *str_ip, int len); -extern int getSockUdpPort(sock_udp_t *p); -extern void closeUdpSocket(sock_udp_t *p); -#endif diff --git a/src/screen/Makefile b/src/screen/Makefile deleted file mode 100644 index 32fb758..0000000 --- a/src/screen/Makefile +++ /dev/null @@ -1,31 +0,0 @@ - -all: screen_analyze.o screen_browser.o screen_credits.o screen_gameType.o screen_choiceArena.o screen_mainMenu.o screen_setting.o screen_table.o screen_world.o - -screen_analyze.o: screen_analyze.c screen_analyze.h - $(CC) $(CFLAGS) -o screen_analyze.o -c screen_analyze.c - -screen_browser.o: screen_browser.c screen_browser.h - $(CC) $(CFLAGS) -o screen_browser.o -c screen_browser.c - -screen_credits.o: screen_credits.c screen_credits.h - $(CC) $(CFLAGS) -o screen_credits.o -c screen_credits.c - -screen_gameType.o: screen_gameType.c screen_gameType.h - $(CC) $(CFLAGS) -o screen_gameType.o -c screen_gameType.c - -screen_mainMenu.o: screen_mainMenu.c screen_mainMenu.h - $(CC) $(CFLAGS) -o screen_mainMenu.o -c screen_mainMenu.c - -screen_setting.o: screen_setting.c screen_setting.h - $(CC) $(CFLAGS) -o screen_setting.o -c screen_setting.c - -screen_table.o: screen_table.c screen_table.h - $(CC) $(CFLAGS) -o screen_table.o -c screen_table.c - -screen_world.o: screen_world.c screen_world.h - $(CC) $(CFLAGS) -o screen_world.o -c screen_world.c - -clean: - rm -rf *.o - - diff --git a/src/screen/screen_analyze.c b/src/screen/screen_analyze.c index c1b8258..9299c7b 100644 --- a/src/screen/screen_analyze.c +++ b/src/screen/screen_analyze.c @@ -3,23 +3,23 @@ #include #include -#include "base/main.h" -#include "base/list.h" +#include "main.h" +#include "list.h" -#include "client/interface.h" -#include "client/screen.h" -#include "client/image.h" +#include "interface.h" +#include "screen.h" +#include "image.h" #ifndef NO_SOUND -#include "audio/music.h" +#include "music.h" #endif -#include "screen/screen_mainMenu.h" -#include "screen/screen_analyze.h" +#include "screen_mainMenu.h" +#include "screen_analyze.h" -#include "widget/widget_label.h" -#include "widget/widget_button.h" -#include "widget/widget_image.h" +#include "widget_label.h" +#include "widget_button.h" +#include "widget_image.h" static widget_image_t *image_backgorund; diff --git a/src/screen/screen_analyze.h b/src/screen/screen_analyze.h index b6a9875..7404da6 100644 --- a/src/screen/screen_analyze.h +++ b/src/screen/screen_analyze.h @@ -3,7 +3,7 @@ #define SCREEN_ANALYZE_H -#include "base/main.h" +#include "main.h" typedef struct analyze_struct { diff --git a/src/screen/screen_browser.c b/src/screen/screen_browser.c index 5d99cf7..531047c 100644 --- a/src/screen/screen_browser.c +++ b/src/screen/screen_browser.c @@ -3,16 +3,16 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/textFile.h" -#include "base/homeDirector.h" -#include "base/net_multiplayer.h" +#include "main.h" +#include "list.h" +#include "textFile.h" +#include "homeDirector.h" +#include "net_multiplayer.h" -#include "client/language.h" -#include "client/interface.h" -#include "client/screen.h" -#include "client/image.h" +#include "language.h" +#include "interface.h" +#include "screen.h" +#include "image.h" #ifdef SUPPORT_NET_UNIX_UDP #include @@ -25,23 +25,23 @@ #include #include -#include "net_unix/udp.h" -#include "net_unix/dns.h" +#include "udp.h" +#include "dns.h" extern int errno; #endif #ifndef NO_SOUND -#include "audio/music.h" +#include "music.h" #endif -#include "screen/screen_gameType.h" -#include "screen/screen_browser.h" +#include "screen_gameType.h" +#include "screen_browser.h" -#include "widget/widget_image.h" -#include "widget/widget_label.h" -#include "widget/widget_button.h" -#include "widget/widget_select.h" +#include "widget_image.h" +#include "widget_label.h" +#include "widget_button.h" +#include "widget_select.h" #define SERVER_TIMEOUT 200 diff --git a/src/screen/screen_choiceArena.c b/src/screen/screen_choiceArena.c index 629f1ba..cd61c9c 100644 --- a/src/screen/screen_choiceArena.c +++ b/src/screen/screen_choiceArena.c @@ -2,26 +2,26 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/arenaFile.h" +#include "main.h" +#include "list.h" +#include "arenaFile.h" -#include "client/language.h" -#include "client/interface.h" -#include "client/screen.h" -#include "client/image.h" +#include "language.h" +#include "interface.h" +#include "screen.h" +#include "image.h" #ifndef NO_SOUND -#include "audio/music.h" +#include "music.h" #endif -#include "screen/screen_mainMenu.h" -#include "screen/screen_choiceArena.h" +#include "screen_mainMenu.h" +#include "screen_choiceArena.h" -#include "widget/widget_label.h" -#include "widget/widget_button.h" -#include "widget/widget_image.h" -#include "widget/widget_buttonimage.h" +#include "widget_label.h" +#include "widget_button.h" +#include "widget_image.h" +#include "widget_buttonimage.h" static widget_image_t *image_backgorund; diff --git a/src/screen/screen_choiceArena.h b/src/screen/screen_choiceArena.h index 0437aa1..73a8197 100644 --- a/src/screen/screen_choiceArena.h +++ b/src/screen/screen_choiceArena.h @@ -3,7 +3,7 @@ #define SCREEN_CHOICE_ARENA -#include "base/main.h" +#include "main.h" #define SCREENSHOT_ARENA_WIDTH 160 #define SCREENSHOT_ARENA_HEIGHT 107 diff --git a/src/screen/screen_credits.c b/src/screen/screen_credits.c index 3f6cf84..6104efb 100644 --- a/src/screen/screen_credits.c +++ b/src/screen/screen_credits.c @@ -2,24 +2,24 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/textFile.h" +#include "main.h" +#include "list.h" +#include "textFile.h" -#include "client/language.h" -#include "client/interface.h" -#include "client/screen.h" -#include "client/image.h" +#include "language.h" +#include "interface.h" +#include "screen.h" +#include "image.h" #ifndef NO_SOUND -#include "audio/music.h" +#include "music.h" #endif -#include "screen/screen_credits.h" +#include "screen_credits.h" -#include "widget/widget_image.h" -#include "widget/widget_label.h" -#include "widget/widget_button.h" +#include "widget_image.h" +#include "widget_label.h" +#include "widget_button.h" static widget_image_t *image_backgorund; static widget_button_t *button_back; diff --git a/src/screen/screen_gameType.c b/src/screen/screen_gameType.c index d54d63a..e512b28 100644 --- a/src/screen/screen_gameType.c +++ b/src/screen/screen_gameType.c @@ -3,28 +3,28 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/net_multiplayer.h" -#include "base/tux.h" +#include "main.h" +#include "list.h" +#include "net_multiplayer.h" +#include "tux.h" -#include "client/language.h" -#include "client/interface.h" -#include "client/screen.h" -#include "client/image.h" +#include "language.h" +#include "interface.h" +#include "screen.h" +#include "image.h" #ifndef NO_SOUND -#include "audio/music.h" +#include "music.h" #endif -#include "screen/screen_gameType.h" -#include "screen/screen_setting.h" +#include "screen_gameType.h" +#include "screen_setting.h" -#include "widget/widget_label.h" -#include "widget/widget_button.h" -#include "widget/widget_image.h" -#include "widget/widget_textfield.h" -#include "widget/widget_check.h" +#include "widget_label.h" +#include "widget_button.h" +#include "widget_image.h" +#include "widget_textfield.h" +#include "widget_check.h" static widget_image_t *image_backgorund; diff --git a/src/screen/screen_gameType.h b/src/screen/screen_gameType.h index 02e2338..1d9b734 100644 --- a/src/screen/screen_gameType.h +++ b/src/screen/screen_gameType.h @@ -3,7 +3,7 @@ #define SCREEN_GAME_TYPE -#include "base/main.h" +#include "main.h" extern void drawScreenGameType(); extern void eventScreenGameType(); diff --git a/src/screen/screen_mainMenu.c b/src/screen/screen_mainMenu.c index bd3886f..024d3bd 100644 --- a/src/screen/screen_mainMenu.c +++ b/src/screen/screen_mainMenu.c @@ -2,26 +2,26 @@ #include #include -#include "base/main.h" +#include "main.h" -#include "client/game.h" -#include "client/interface.h" -#include "client/language.h" -#include "client/screen.h" -#include "client/image.h" +#include "game.h" +#include "interface.h" +#include "language.h" +#include "screen.h" +#include "image.h" #ifndef NO_SOUND -#include "audio/music.h" +#include "music.h" #endif -#include "screen/screen_mainMenu.h" -#include "screen/screen_setting.h" +#include "screen_mainMenu.h" +#include "screen_setting.h" -#include "widget/widget_label.h" -#include "widget/widget_button.h" -#include "widget/widget_textfield.h" -#include "widget/widget_check.h" -#include "widget/widget_image.h" +#include "widget_label.h" +#include "widget_button.h" +#include "widget_textfield.h" +#include "widget_check.h" +#include "widget_image.h" static widget_image_t *image_backgorund; diff --git a/src/screen/screen_mainMenu.h b/src/screen/screen_mainMenu.h index c04e65f..909e541 100644 --- a/src/screen/screen_mainMenu.h +++ b/src/screen/screen_mainMenu.h @@ -3,7 +3,7 @@ #define SCREEN_MIAN_MENU_H -#include "base/main.h" +#include "main.h" extern void startScreenMainMenu(); extern void drawScreenMainMenu(); diff --git a/src/screen/screen_setting.c b/src/screen/screen_setting.c index 5a7fb29..5dd7fc1 100644 --- a/src/screen/screen_setting.c +++ b/src/screen/screen_setting.c @@ -3,33 +3,33 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/textFile.h" -#include "base/director.h" -#include "base/homeDirector.h" - -#include "client/configFile.h" -#include "client/language.h" -#include "client/interface.h" -#include "client/screen.h" -#include "client/image.h" +#include "main.h" +#include "list.h" +#include "tux.h" +#include "textFile.h" +#include "director.h" +#include "homeDirector.h" + +#include "configFile.h" +#include "language.h" +#include "interface.h" +#include "screen.h" +#include "image.h" #ifndef NO_SOUND -#include "audio/music.h" -#include "audio/sound.h" +#include "music.h" +#include "sound.h" #endif -#include "screen/screen_mainMenu.h" -#include "screen/screen_setting.h" +#include "screen_mainMenu.h" +#include "screen_setting.h" -#include "widget/widget_label.h" -#include "widget/widget_button.h" -#include "widget/widget_image.h" -#include "widget/widget_textfield.h" -#include "widget/widget_check.h" -#include "widget/widget_select.h" +#include "widget_label.h" +#include "widget_button.h" +#include "widget_image.h" +#include "widget_textfield.h" +#include "widget_check.h" +#include "widget_select.h" static widget_image_t *image_backgorund; diff --git a/src/screen/screen_setting.h b/src/screen/screen_setting.h index b9631f8..744e768 100644 --- a/src/screen/screen_setting.h +++ b/src/screen/screen_setting.h @@ -3,7 +3,7 @@ #define SCREEN_SETTING -#include "base/main.h" +#include "main.h" extern void initScreenSetting(); extern void drawScreenSetting(); diff --git a/src/screen/screen_table.c b/src/screen/screen_table.c index df1b7d5..498dc7a 100644 --- a/src/screen/screen_table.c +++ b/src/screen/screen_table.c @@ -3,25 +3,25 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/textFile.h" -#include "base/homeDirector.h" +#include "main.h" +#include "list.h" +#include "textFile.h" +#include "homeDirector.h" -#include "client/language.h" -#include "client/interface.h" -#include "client/screen.h" -#include "client/image.h" +#include "language.h" +#include "interface.h" +#include "screen.h" +#include "image.h" #ifndef NO_SOUND -#include "audio/music.h" +#include "music.h" #endif -#include "screen/screen_table.h" +#include "screen_table.h" -#include "widget/widget_image.h" -#include "widget/widget_label.h" -#include "widget/widget_button.h" +#include "widget_image.h" +#include "widget_label.h" +#include "widget_button.h" static widget_image_t *image_backgorund; static widget_button_t *button_back; diff --git a/src/screen/screen_world.c b/src/screen/screen_world.c index 91820ff..10e9623 100644 --- a/src/screen/screen_world.c +++ b/src/screen/screen_world.c @@ -2,42 +2,42 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/item.h" -#include "base/shot.h" -#include "base/gun.h" -#include "base/myTimer.h" -#include "base/net_multiplayer.h" -#include "base/arena.h" -#include "base/arenaFile.h" -#include "base/proto.h" -#include "base/modules.h" -#include "base/idManager.h" - -#include "client/interface.h" -#include "client/keytable.h" -#include "client/layer.h" -#include "client/image.h" -//#include "client/heightScore.h" -#include "client/term.h" -#include "client/font.h" -#include "client/panel.h" -#include "client/radar.h" +#include "main.h" +#include "list.h" +#include "tux.h" +#include "item.h" +#include "shot.h" +#include "gun.h" +#include "myTimer.h" +#include "net_multiplayer.h" +#include "arena.h" +#include "arenaFile.h" +#include "proto.h" +#include "modules.h" +#include "idManager.h" + +#include "interface.h" +#include "keytable.h" +#include "layer.h" +#include "image.h" +//#include "heightScore.h" +#include "term.h" +#include "font.h" +#include "panel.h" +#include "radar.h" #ifndef NO_SOUND -#include "audio/music.h" -#include "audio/sound.h" +#include "music.h" +#include "sound.h" #endif -#include "client/screen.h" -#include "screen/screen_world.h" -#include "screen/screen_analyze.h" -#include "screen/screen_setting.h" -#include "screen/screen_gameType.h" -#include "screen/screen_choiceArena.h" -#include "screen/screen_table.h" +#include "screen.h" +#include "screen_world.h" +#include "screen_analyze.h" +#include "screen_setting.h" +#include "screen_gameType.h" +#include "screen_choiceArena.h" +#include "screen_table.h" static arena_t *arena; diff --git a/src/screen/screen_world.h b/src/screen/screen_world.h index 270d144..0ba4b41 100644 --- a/src/screen/screen_world.h +++ b/src/screen/screen_world.h @@ -3,10 +3,10 @@ #define SCREEN_WORLD_H -#include "base/main.h" -#include "base/myTimer.h" -#include "base/tux.h" -#include "base/arena.h" +#include "main.h" +#include "myTimer.h" +#include "tux.h" +#include "arena.h" #define TIMER_END_ARENA 5000 #define WORLD_COUNT_ROUND_UNLIMITED -1 diff --git a/src/server/Makefile b/src/server/Makefile deleted file mode 100644 index 41e140e..0000000 --- a/src/server/Makefile +++ /dev/null @@ -1,15 +0,0 @@ - - -all: heightScore.o publicServer.o serverConfigFile.o - -heightScore.o: heightScore.c heightScore.h - $(CC) $(CFLAGS) -o heightScore.o -c heightScore.c - -publicServer.o: publicServer.c publicServer.h - $(CC) $(CFLAGS) -o publicServer.o -c publicServer.c - -serverConfigFile.o: serverConfigFile.c serverConfigFile.h - $(CC) $(CFLAGS) -o serverConfigFile.o -c serverConfigFile.c - -clean: - rm -rf *.o diff --git a/src/server/heightScore.c b/src/server/heightScore.c index f36dcf7..fa7402e 100644 --- a/src/server/heightScore.c +++ b/src/server/heightScore.c @@ -4,10 +4,10 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/textFile.h" -#include "server/heightScore.h" +#include "main.h" +#include "list.h" +#include "textFile.h" +#include "heightScore.h" static textFile_t *textFile; diff --git a/src/server/publicServer.c b/src/server/publicServer.c index d7246a0..b92056c 100644 --- a/src/server/publicServer.c +++ b/src/server/publicServer.c @@ -15,24 +15,24 @@ #include #endif -#include "base/main.h" -#include "base/list.h" -#include "base/tux.h" -#include "base/idManager.h" -#include "base/myTimer.h" -#include "base/arena.h" -#include "base/item.h" -#include "base/shot.h" -#include "base/arenaFile.h" -#include "base/proto.h" -#include "base/modules.h" -#include "base/net_multiplayer.h" - -#include "server/publicServer.h" -#include "server/serverConfigFile.h" -#include "server/heightScore.h" - -#include "net_unix/dns.h" +#include "main.h" +#include "list.h" +#include "tux.h" +#include "idManager.h" +#include "myTimer.h" +#include "arena.h" +#include "item.h" +#include "shot.h" +#include "arenaFile.h" +#include "proto.h" +#include "modules.h" +#include "net_multiplayer.h" + +#include "publicServer.h" +#include "serverConfigFile.h" +#include "heightScore.h" + +#include "dns.h" static int arenaId; static arena_t *arena; diff --git a/src/server/publicServer.h b/src/server/publicServer.h index 111ff9c..7fb22da 100644 --- a/src/server/publicServer.h +++ b/src/server/publicServer.h @@ -3,7 +3,7 @@ #define PUBLIC_SERVER_H -#include "base/arena.h" +#include "arena.h" #define WORLD_COUNT_ROUND_UNLIMITED -1 diff --git a/src/server/serverConfigFile.c b/src/server/serverConfigFile.c index 48d57eb..749bb2d 100644 --- a/src/server/serverConfigFile.c +++ b/src/server/serverConfigFile.c @@ -4,10 +4,10 @@ #include #include -#include "base/main.h" -#include "base/list.h" -#include "base/textFile.h" -#include "server/serverConfigFile.h" +#include "main.h" +#include "list.h" +#include "textFile.h" +#include "serverConfigFile.h" static textFile_t *serverTextFile; diff --git a/src/widget/Makefile b/src/widget/Makefile deleted file mode 100644 index cdb504b..0000000 --- a/src/widget/Makefile +++ /dev/null @@ -1,28 +0,0 @@ - -all: widget_button.o widget_buttonimage.o widget_check.o widget_label.o widget_select.o widget_textfield.o widget_image.o - -widget_button.o: widget_button.c widget_button.h - $(CC) $(CFLAGS) -o widget_button.o -c widget_button.c - -widget_buttonimage.o: widget_buttonimage.c widget_buttonimage.h - $(CC) $(CFLAGS) -o widget_buttonimage.o -c widget_buttonimage.c - -widget_check.o: widget_check.c widget_check.h - $(CC) $(CFLAGS) -o widget_check.o -c widget_check.c - -widget_image.o: widget_image.c widget_image.h - $(CC) $(CFLAGS) -o widget_image.o -c widget_image.c - -widget_label.o: widget_label.c widget_label.h - $(CC) $(CFLAGS) -o widget_label.o -c widget_label.c - -widget_select.o: widget_select.c widget_select.h - $(CC) $(CFLAGS) -o widget_select.o -c widget_select.c - -widget_textfield.o: widget_textfield.c widget_textfield.h - $(CC) $(CFLAGS) -o widget_textfield.o -c widget_textfield.c - -clean: - rm -rf *.o - - diff --git a/src/widget/widget_button.c b/src/widget/widget_button.c index 7f0957b..0bdab86 100644 --- a/src/widget/widget_button.c +++ b/src/widget/widget_button.c @@ -1,11 +1,11 @@ #include -#include "base/main.h" +#include "main.h" -#include "client/interface.h" -#include "client/image.h" -#include "client/font.h" +#include "interface.h" +#include "image.h" +#include "font.h" #include "widget_button.h" diff --git a/src/widget/widget_button.h b/src/widget/widget_button.h index 1662407..5090e55 100644 --- a/src/widget/widget_button.h +++ b/src/widget/widget_button.h @@ -3,7 +3,7 @@ #define WIDGET_BUTTON_H -#include "base/main.h" +#include "main.h" #define WIDGET_BUTTON_TIME 10 diff --git a/src/widget/widget_buttonimage.c b/src/widget/widget_buttonimage.c index 7c59f3b..0b6e961 100644 --- a/src/widget/widget_buttonimage.c +++ b/src/widget/widget_buttonimage.c @@ -1,9 +1,9 @@ #include -#include "base/main.h" -#include "client/interface.h" -#include "client/font.h" -#include "client/image.h" +#include "main.h" +#include "interface.h" +#include "font.h" +#include "image.h" #include "widget_buttonimage.h" widget_buttonimage_t* newWidgetButtonimage(SDL_Surface *image, int x, int y, void (*fce_event)(void *)) diff --git a/src/widget/widget_buttonimage.h b/src/widget/widget_buttonimage.h index d30e5bf..d03423e 100644 --- a/src/widget/widget_buttonimage.h +++ b/src/widget/widget_buttonimage.h @@ -1,7 +1,7 @@ #ifndef WIDGET_BUTTONIMAGE_H -#include "base/main.h" +#include "main.h" #define WIDGET_BUTTONIMAGE_H diff --git a/src/widget/widget_check.c b/src/widget/widget_check.c index feb2414..192ae9b 100644 --- a/src/widget/widget_check.c +++ b/src/widget/widget_check.c @@ -1,8 +1,8 @@ #include -#include "base/main.h" -#include "client/interface.h" -#include "client/image.h" +#include "main.h" +#include "interface.h" +#include "image.h" #include "widget_check.h" widget_check_t* newWidgetCheck(int x, int y, bool_t status, void (*fce_event)(void *)) diff --git a/src/widget/widget_check.h b/src/widget/widget_check.h index 68aecd9..2e3a3a3 100644 --- a/src/widget/widget_check.h +++ b/src/widget/widget_check.h @@ -3,7 +3,7 @@ #define WIDGET_CHECK_H -#include "base/main.h" +#include "main.h" #define WIDGET_CHECK_TIME_SWITCH_STATUS 5 diff --git a/src/widget/widget_image.c b/src/widget/widget_image.c index 5e1b743..6437451 100644 --- a/src/widget/widget_image.c +++ b/src/widget/widget_image.c @@ -2,10 +2,10 @@ #include #include -#include "base/main.h" -#include "client/image.h" -#include "client/interface.h" -#include "client/font.h" +#include "main.h" +#include "image.h" +#include "interface.h" +#include "font.h" #include "widget_image.h" widget_image_t* newWidgetImage(int x, int y, SDL_Surface *image) diff --git a/src/widget/widget_image.h b/src/widget/widget_image.h index 85c98d7..6bb316c 100644 --- a/src/widget/widget_image.h +++ b/src/widget/widget_image.h @@ -3,8 +3,8 @@ #define WIDGET_IMAGE_H -#include "base/main.h" -#include "client/interface.h" +#include "main.h" +#include "interface.h" typedef struct widget_image { diff --git a/src/widget/widget_label.c b/src/widget/widget_label.c index a472784..15dea4d 100644 --- a/src/widget/widget_label.c +++ b/src/widget/widget_label.c @@ -1,9 +1,9 @@ #include -#include "base/main.h" -#include "client/interface.h" -#include "client/font.h" +#include "main.h" +#include "interface.h" +#include "font.h" #include "widget_label.h" widget_label_t* newWidgetLabel(char *text, int x, int y, int bind) diff --git a/src/widget/widget_label.h b/src/widget/widget_label.h index a3bb060..f976bbc 100644 --- a/src/widget/widget_label.h +++ b/src/widget/widget_label.h @@ -3,7 +3,7 @@ #define WIDGET_LABEL_H -#include "base/main.h" +#include "main.h" typedef struct widget_label { diff --git a/src/widget/widget_select.c b/src/widget/widget_select.c index 4d10bc4..35a462b 100644 --- a/src/widget/widget_select.c +++ b/src/widget/widget_select.c @@ -1,8 +1,8 @@ #include -#include "base/main.h" -#include "client/interface.h" -#include "client/font.h" +#include "main.h" +#include "interface.h" +#include "font.h" #include "widget_select.h" /* diff --git a/src/widget/widget_select.h b/src/widget/widget_select.h index 7bbe5c0..a0bb795 100644 --- a/src/widget/widget_select.h +++ b/src/widget/widget_select.h @@ -3,8 +3,8 @@ #define WIDGET_SELECT_H -#include "base/main.h" -#include "base/list.h" +#include "main.h" +#include "list.h" typedef struct widget_select diff --git a/src/widget/widget_textfield.c b/src/widget/widget_textfield.c index f93f298..6b9a6c0 100644 --- a/src/widget/widget_textfield.c +++ b/src/widget/widget_textfield.c @@ -1,9 +1,9 @@ #include -#include "base/main.h" -#include "client/interface.h" -#include "client/font.h" -#include "client/image.h" +#include "main.h" +#include "interface.h" +#include "font.h" +#include "image.h" #include "widget_textfield.h" widget_textfield_t* newWidgetTextfield(char *text, int x, int y) diff --git a/src/widget/widget_textfield.h b/src/widget/widget_textfield.h index 9300bce..1e9517e 100644 --- a/src/widget/widget_textfield.h +++ b/src/widget/widget_textfield.h @@ -3,7 +3,7 @@ #define WIDGET_TEXTFIELD_H -#include "base/main.h" +#include "main.h" #define WIDGET_TEXTFIELD_WIDTH 188 #define WIDGET_TEXTFIELD_HEIGHT 36 -- cgit v1.2.3