diff --git a/client/client.pro b/client/client.pro index d56b1dc..e99352a 100644 --- a/client/client.pro +++ b/client/client.pro @@ -36,8 +36,7 @@ DOS_SOURCES = \ src/dos/vesa.c LINUX_INCLUDES = \ - $$PWD/src/linux \ - $$SHARED/thirdparty/enet/include + $$PWD/src/linux LINUX_HEADERS = \ $$SHARED/thirdparty/enet/include/enet.h @@ -48,8 +47,6 @@ LINUX_SOURCES = \ INCLUDEPATH += \ $$LINUX_INCLUDES \ $$SHARED \ - $$SHARED/thirdparty \ - $$PWD/src/thirdparty \ $$PWD/src/system \ $$PWD/src/gui \ $$PWD/src @@ -63,19 +60,20 @@ HEADERS = \ $$SHARED/thirdparty/blowfish-api/blowfish.h \ $$SHARED/thirdparty/ini/src/ini.h \ src/config.h \ - src/system/util.h \ + src/connect.h \ + $$SHARED/util.h \ src/thirdparty/minicoro/minicoro.h \ src/system/comport.h \ src/settings.h \ src/system/color.h \ - src/system/memory.h \ + $$SHARED/memory.h \ src/system/surface.h \ src/system/taglist.h \ src/system/keyboard.h \ src/system/task.h \ src/system/timer.h \ - src/system/array.h \ - src/system/log.h \ + $$SHARED/array.h \ + $$SHARED/log.h \ src/system/mouse.h \ src/system/vesa.h \ src/system/os.h \ @@ -104,14 +102,15 @@ SOURCES = \ $$SHARED/thirdparty/blowfish-api/blowfish.c \ $$SHARED/thirdparty/ini/src/ini.c \ src/config.c \ - src/system/memory.c \ + src/connect.c \ + $$SHARED/memory.c \ src/settings.c \ src/system/surface.c \ src/system/taglist.c \ - src/system/util.c \ + $$SHARED/util.c \ src/test.c \ - src/system/array.c \ - src/system/log.c \ + $$SHARED/array.c \ + $$SHARED/log.c \ src/system/timer.c \ src/system/task.c \ src/gui/listbox.c \ diff --git a/client/src/connect.c b/client/src/connect.c new file mode 100644 index 0000000..97098e7 --- /dev/null +++ b/client/src/connect.c @@ -0,0 +1,28 @@ +/* + * Kangaroo Punch MultiPlayer Game Server Mark II + * Copyright (C) 2020-2021 Scott Duensing + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + + +#include "config.h" + +#include "connect.h" + + +void taskConnect(void *data) { + (void)data; +} diff --git a/client/src/connect.h b/client/src/connect.h new file mode 100644 index 0000000..edf3089 --- /dev/null +++ b/client/src/connect.h @@ -0,0 +1,31 @@ +/* + * Kangaroo Punch MultiPlayer Game Server Mark II + * Copyright (C) 2020-2021 Scott Duensing + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + + +#ifndef CONNECT_H +#define CONNECT_H + + +#include "os.h" + + +void taskConnect(void *data); + + +#endif // CONNECT_H diff --git a/client/src/dos/vesa.c b/client/src/dos/vesa.c index a748b1c..9b20378 100644 --- a/client/src/dos/vesa.c +++ b/client/src/dos/vesa.c @@ -22,7 +22,7 @@ #include "vesa.h" #include "surface.h" -#include "../system/log.h" +#include "log.h" // http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html diff --git a/client/src/gui/gui.c b/client/src/gui/gui.c index ab487aa..0226525 100644 --- a/client/src/gui/gui.c +++ b/client/src/gui/gui.c @@ -594,9 +594,9 @@ DesktopT *guiStartup(void) { _guiColor[COLOR_LISTBOX_ARROWS_INACTIVE] = vbeColorMake( 80, 84, 80); // Load all font sizes. - _guiFont8 = fontLoad("vga8x8.dat"); - _guiFont14 = fontLoad("vga8x14.dat"); - _guiFont16 = fontLoad("vga8x16.dat"); + _guiFont8 = fontLoad("data/vga8x8.dat"); + _guiFont14 = fontLoad("data/vga8x14.dat"); + _guiFont16 = fontLoad("data/vga8x16.dat"); _guiFont = _guiFont14; // Font to use for widgets. diff --git a/client/src/gui/image.h b/client/src/gui/image.h index a5143fd..57ee183 100644 --- a/client/src/gui/image.h +++ b/client/src/gui/image.h @@ -25,7 +25,7 @@ #include "os.h" #include "color.h" -#include "stb_image.h" +#include "thirdparty/stb_image.h" typedef struct ImageS { diff --git a/client/src/linux/linux.c b/client/src/linux/linux.c index 24c624f..5aaadc3 100644 --- a/client/src/linux/linux.c +++ b/client/src/linux/linux.c @@ -21,7 +21,7 @@ #include #define ENET_IMPLEMENTATION -#include "enet.h" +#include "thirdparty/enet/include/enet.h" #include "os.h" diff --git a/client/src/system/task.c b/client/src/system/task.c index 8d8fbf8..eb2c2bc 100644 --- a/client/src/system/task.c +++ b/client/src/system/task.c @@ -21,7 +21,7 @@ #define MINICORO_IMPL #define MCO_USE_ASM //#define MCO_DEFAULT_STACK_SIZE 114688 // Default is 57344 -#include "minicoro/minicoro.h" +#include "thirdparty/minicoro/minicoro.h" #include "array.h" diff --git a/client/src/welcome.c b/client/src/welcome.c index 407d4c8..e8edb04 100644 --- a/client/src/welcome.c +++ b/client/src/welcome.c @@ -20,9 +20,11 @@ #include "welcome.h" #include "settings.h" +#include "connect.h" #include "taglist.h" #include "task.h" +#include "config.h" #include "window.h" #include "picture.h" @@ -88,7 +90,7 @@ void taskWelcome(void *data) { T_TITLE, P("Connect"), T_X, 379, T_Y, 157, T_CLICK, P(btnConnectClick), - T_ENABLED, T_FALSE, + T_ENABLED, (_configData.serialCom > 0 && strlen(_configData.serverHost) > 2) ? T_TRUE : T_FALSE, T_BUTTON, T_DONE, T_WINDOW, T_DONE, T_END diff --git a/font/src/main.c b/font/src/main.c index 826b91e..2672065 100644 --- a/font/src/main.c +++ b/font/src/main.c @@ -82,9 +82,9 @@ int main(int argc, char *argv[]) { (void)argc; (void)argv; - makeFont("/home/scott/code/kpmpgsmkii/font/data/vga8x8.png", "/home/scott/code/kpmpgsmkii/client/bin/vga8x8.dat", 8, 8, 16, 255); - makeFont("/home/scott/code/kpmpgsmkii/font/data/vga8x14.png", "/home/scott/code/kpmpgsmkii/client/bin/vga8x14.dat", 8, 14, 16, 255); - makeFont("/home/scott/code/kpmpgsmkii/font/data/vga8x16.png", "/home/scott/code/kpmpgsmkii/client/bin/vga8x16.dat", 8, 16, 16, 255); + makeFont("/home/scott/code/kpmpgsmkii/font/data/vga8x8.png", "/home/scott/code/kpmpgsmkii/bin/data/vga8x8.dat", 8, 8, 16, 255); + makeFont("/home/scott/code/kpmpgsmkii/font/data/vga8x14.png", "/home/scott/code/kpmpgsmkii/bin/data/vga8x14.dat", 8, 14, 16, 255); + makeFont("/home/scott/code/kpmpgsmkii/font/data/vga8x16.png", "/home/scott/code/kpmpgsmkii/bin/data/vga8x16.dat", 8, 16, 16, 255); return 0; } diff --git a/kpmpgsmkii.pro b/kpmpgsmkii.pro index 1eabb8e..9b042d4 100644 --- a/kpmpgsmkii.pro +++ b/kpmpgsmkii.pro @@ -21,4 +21,5 @@ CONFIG *= ORDERED SUBDIRS = \ font \ - client + client \ + server diff --git a/server/os.h b/server/os.h new file mode 100644 index 0000000..6d42ae2 --- /dev/null +++ b/server/os.h @@ -0,0 +1,41 @@ +/* + * Kangaroo Punch MultiPlayer Game Server Mark II + * Copyright (C) 2020-2021 Scott Duensing + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + + + +#ifndef OS_H +#define OS_H + + +#include +#include +#include +#include +#include +#include + +// Should be after system headers in this file. +#define MEMORY_CHECK_ENABLED +#include "memory.h" + +// Now our headers. +#include "log.h" + + +#endif // OS_H diff --git a/server/server.pro b/server/server.pro new file mode 100644 index 0000000..d5d83a0 --- /dev/null +++ b/server/server.pro @@ -0,0 +1,52 @@ +# +# Kangaroo Punch MultiPlayer Game Server Mark II +# Copyright (C) 2020-2021 Scott Duensing +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + + +TEMPLATE = app +CONFIG -= qt + +DESTDIR = $$OUT_PWD/bin +SHARED = $$PWD/../shared + +INCLUDEPATH += \ + $$SHARED \ + $$PWD/src + +HEADERS = \ + $$SHARED/stddclmr.h \ + $$SHARED/thirdparty/stb_ds.h \ + $$SHARED/thirdparty/memwatch/memwatch.h \ + $$SHARED/thirdparty/blowfish-api/blowfish.h \ + $$SHARED/thirdparty/ini/src/ini.h \ + $$SHARED/array.h \ + $$SHARED/log.h \ + $$SHARED/memory.h \ + $$SHARED/util.h \ + os.h + +SOURCES = \ + $$SHARED/thirdparty/memwatch/memwatch.c \ + $$SHARED/thirdparty/blowfish-api/blowfish.c \ + $$SHARED/thirdparty/ini/src/ini.c \ + $$SHARED/array.c \ + $$SHARED/log.c \ + $$SHARED/memory.c \ + $$SHARED/util.c \ + src/main.c + +OTHER_FILES = diff --git a/server/src/main.c b/server/src/main.c new file mode 100644 index 0000000..7fef177 --- /dev/null +++ b/server/src/main.c @@ -0,0 +1,41 @@ +/* + * Kangaroo Punch MultiPlayer Game Server Mark II + * Copyright (C) 2020-2021 Scott Duensing + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + + +#include "os.h" +#include "util.h" + + +int main(int argc, char *argv[]) { + + (void)argc; + + memoryStartup(argv[0]); + logOpenByHandle(memoryLogHandleGet()); + + // 0 1 2 3 4 5 6 7 8 + // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 + logWrite("%s", "Kangaroo Punch MultiPlayer DOS Game Server Mark II\n"); + logWrite("%s", "Copyright (C) 2020-2021 Scott Duensing scott@kangaroopunch.com\n\n"); + + logClose(); + memoryShutdown(); + + return 0; +} diff --git a/client/src/system/array.c b/shared/array.c similarity index 96% rename from client/src/system/array.c rename to shared/array.c index c88938e..24ab51e 100644 --- a/client/src/system/array.c +++ b/shared/array.c @@ -21,4 +21,4 @@ #include "array.h" #define STB_DS_IMPLEMENTATION -#include "stb_ds.h" +#include "thirdparty/stb_ds.h" diff --git a/client/src/system/array.h b/shared/array.h similarity index 96% rename from client/src/system/array.h rename to shared/array.h index b155fc1..3d82865 100644 --- a/client/src/system/array.h +++ b/shared/array.h @@ -23,7 +23,7 @@ #include "os.h" -#include "stb_ds.h" +#include "thirdparty/stb_ds.h" #endif // ARRAY_H diff --git a/client/src/system/log.c b/shared/log.c similarity index 100% rename from client/src/system/log.c rename to shared/log.c diff --git a/client/src/system/log.h b/shared/log.h similarity index 100% rename from client/src/system/log.h rename to shared/log.h diff --git a/client/src/system/memory.c b/shared/memory.c similarity index 100% rename from client/src/system/memory.c rename to shared/memory.c diff --git a/client/src/system/memory.h b/shared/memory.h similarity index 95% rename from client/src/system/memory.h rename to shared/memory.h index 91c0cfd..6ab4be9 100644 --- a/client/src/system/memory.h +++ b/shared/memory.h @@ -26,7 +26,7 @@ #ifdef MEMORY_CHECK_ENABLED #define MEMWATCH -#include "memwatch/memwatch.h" +#include "thirdparty/memwatch/memwatch.h" #endif diff --git a/client/src/system/util.c b/shared/util.c similarity index 100% rename from client/src/system/util.c rename to shared/util.c diff --git a/client/src/system/util.h b/shared/util.h similarity index 100% rename from client/src/system/util.h rename to shared/util.h