diff --git a/gameenv/data/menus/test2.wnd b/gameenv/data/menus/test2.wnd new file mode 100644 index 0000000..7802584 --- /dev/null +++ b/gameenv/data/menus/test2.wnd @@ -0,0 +1,24 @@ + + + Test Window 2 + + + File + + Load Test Map + map "data/maps/testmpfw.bsp" + + + Quit game + quit + + + + E1M2 + + Play + map "data/maps/fullquake/e1m2.bsp" + + + + \ No newline at end of file diff --git a/gmtk2025/data/cfg/startup.cfg b/gmtk2025/data/cfg/startup.cfg new file mode 100644 index 0000000..ed4d1db --- /dev/null +++ b/gmtk2025/data/cfg/startup.cfg @@ -0,0 +1,5 @@ +echo "GMTK 2025" +echo "Made with MPFW" +echo "" +show_cursor +ui_create_window "data/menus/mainmenu.wnd" \ No newline at end of file diff --git a/gmtk2025/data/fonts/RobotoMono/LICENSE.txt b/gmtk2025/data/fonts/RobotoMono/LICENSE.txt new file mode 100644 index 0000000..38d9750 --- /dev/null +++ b/gmtk2025/data/fonts/RobotoMono/LICENSE.txt @@ -0,0 +1,91 @@ +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-Bold.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Bold.ttf new file mode 100644 index 0000000..bef439f Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Bold.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-BoldItalic.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-BoldItalic.ttf new file mode 100644 index 0000000..642dd05 Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-BoldItalic.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-ExtraLight.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-ExtraLight.ttf new file mode 100644 index 0000000..8cc41ca Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-ExtraLight.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-ExtraLightItalic.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-ExtraLightItalic.ttf new file mode 100644 index 0000000..47e4a4f Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-ExtraLightItalic.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-Italic.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Italic.ttf new file mode 100644 index 0000000..781eff8 Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Italic.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-Light.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Light.ttf new file mode 100644 index 0000000..b6fb475 Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Light.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-LightItalic.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-LightItalic.ttf new file mode 100644 index 0000000..48fec00 Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-LightItalic.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-Medium.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Medium.ttf new file mode 100644 index 0000000..53fdd40 Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Medium.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-MediumItalic.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-MediumItalic.ttf new file mode 100644 index 0000000..6916e76 Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-MediumItalic.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-Regular.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Regular.ttf new file mode 100644 index 0000000..3806bfb Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Regular.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-SemiBold.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-SemiBold.ttf new file mode 100644 index 0000000..b828c3a Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-SemiBold.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-SemiBoldItalic.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-SemiBoldItalic.ttf new file mode 100644 index 0000000..06032b5 Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-SemiBoldItalic.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-Thin.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Thin.ttf new file mode 100644 index 0000000..71f1a46 Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-Thin.ttf differ diff --git a/gmtk2025/data/fonts/RobotoMono/RobotoMono-ThinItalic.ttf b/gmtk2025/data/fonts/RobotoMono/RobotoMono-ThinItalic.ttf new file mode 100644 index 0000000..a1b2e5a Binary files /dev/null and b/gmtk2025/data/fonts/RobotoMono/RobotoMono-ThinItalic.ttf differ diff --git a/gmtk2025/data/menus/mainmenu.wnd b/gmtk2025/data/menus/mainmenu.wnd new file mode 100644 index 0000000..3eb6cfe --- /dev/null +++ b/gmtk2025/data/menus/mainmenu.wnd @@ -0,0 +1,22 @@ + + + GMTK 2025 + + + + File + + New game + echo "this should be a new game" + + + + Quit + quit + + + + + + + \ No newline at end of file diff --git a/gmtk2025/data/palette.lmp b/gmtk2025/data/palette.lmp new file mode 100644 index 0000000..7eefda1 Binary files /dev/null and b/gmtk2025/data/palette.lmp differ diff --git a/mpfw/MPFW_Console.cpp b/mpfw/MPFW_Console.cpp index a1f5094..5e45d6b 100644 --- a/mpfw/MPFW_Console.cpp +++ b/mpfw/MPFW_Console.cpp @@ -11,6 +11,32 @@ MPFW_ConsoleCommand(echo) { *logStr += "\n"; } +MPFW_ConsoleCommand(ui_create_window) { + if(cmd.size() != 1){ + *logStr += "'ui_create_window' command usage:\n ui_create_window \n"; + return; + } + try{ + MPFW::UI::Window wnd(cmd[0]); + ctx->ui->windows.push_back(wnd); + } + catch (std::exception& e) { + *logStr += "Error on window creation: "; + *logStr += e.what(); + *logStr += "\n"; + + } + catch (...) { + *logStr += "Unknown error on window creation\n"; + } +} + +MPFW_ConsoleCommand(ui_delete_window) { + if (cmd.size() != 1) { + + } +} + MPFW_ConsoleCommand(quit) { exit(0); // some day there'll be proper unloading :3 } @@ -96,6 +122,11 @@ MPFW::Console::CommandHandler::CommandHandler(CommandHandlerResources* c) CommandID quakeMap = { QUAKE, "map" }; functionMap[quakeMap] = map_quake; + CommandID uiCreateWindow = { MPFW, "ui_create_window" }; + functionMap[uiCreateWindow] = ui_create_window; + + + #pragma endregion System Commands } diff --git a/mpfw/MPFW_Net.cpp b/mpfw/MPFW_Net.cpp new file mode 100644 index 0000000..8c21186 --- /dev/null +++ b/mpfw/MPFW_Net.cpp @@ -0,0 +1,9 @@ +#include "MPFW_Net.h" + +void MPFW::Net::AppLevel::Auth::AuthServer::ConnectToAuthServer(::MPFW::Net::System::Address address, UserInfo user) +{ +} + +void MPFW::Net::System::Socket::Connect(SocketInfo __info) +{ +} diff --git a/mpfw/MPFW_Net.h b/mpfw/MPFW_Net.h new file mode 100644 index 0000000..4d9498a --- /dev/null +++ b/mpfw/MPFW_Net.h @@ -0,0 +1,75 @@ +#pragma once +// net module for MPFW +#include +#include +#include +#include + + +#define MPFW_NetCallback(x) void x(std::string packet, Socket* socket) + +namespace MPFW { + namespace Net { + + + // low-level operations for addresses, protocols, sockets, etc., + // basically a raylib-compatible asio wrapper for windows compiling purposes. + // mpfw works on a system of relay servers and auth'd apps through an external + // auth server. these functions aren't going to be used very often outside of + // predefined engine declarations. + namespace System { + + + + struct Address { + std::string ip; // human-readable internet address(domain name or internet protocol address(v4)) + int port; + }; + + using NetCallback = std::function; + enum SocketType { + TCP, UDP + }; + + struct SocketInfo { + SocketType type; + Address address; + }; + + class Socket { + SocketInfo info; + public: + Socket() {} + Socket(SocketInfo __info) { Connect(__info); } + + void Connect(SocketInfo __info); + + std::function connectCallback; + std::function receiveCallback; + std::function disconnectCallback; + ~Socket() {} + }; + } + + namespace AppLevel { + namespace Auth { + struct UserInfo { + std::string username, password; + }; + class AuthServer { + public: + AuthServer() {} + AuthServer(::MPFW::Net::System::Address address, UserInfo user) { ConnectToAuthServer(address, user); } + + void ConnectToAuthServer(::MPFW::Net::System::Address address, UserInfo user); + + }; + } + class AppInterface { + public: + void Connect(::MPFW::Net::System::Address address, ::MPFW::Net::AppLevel::Auth::AuthServer auth); + + }; + } + } +} \ No newline at end of file diff --git a/mpfw/main.cpp b/mpfw/main.cpp index 70a91c5..f622da8 100644 --- a/mpfw/main.cpp +++ b/mpfw/main.cpp @@ -202,9 +202,9 @@ int main() { uiRenderer.cmh = &cmdH; - MPFW::UI::Window wndw("data/menus/test.wnd"); + // MPFW::UI::Window wndw("data/menus/test.wnd"); - uiRenderer.windows.push_back(wndw); + // uiRenderer.windows.push_back(wndw); // rlSetClipPlanes(1, INFINITY); camera.position = { 0,5,0 }; @@ -256,9 +256,10 @@ int main() { camera.position.y = 5; velocity.y = 0; if(IsKeyPressed(KEY_SPACE)){ - velocity.y += 320*GetFrameTime(); + velocity.y += wishSpeed*0.5*GetFrameTime(); } Accelerate(); + } else { AirAccelerate(wishVel); @@ -269,6 +270,7 @@ int main() { if (IsKeyPressed(KEY_F)) indivFaceMode = !indivFaceMode; + velocity *= {GetFrameTime(), 1, GetFrameTime()}; } if (IsKeyPressed(KEY_ESCAPE)) { @@ -282,7 +284,6 @@ int main() { } } - velocity *= {GetFrameTime(), 1, GetFrameTime()}; camera.position += velocity; camera.target = camera.position + rotation; BeginDrawing(); diff --git a/mpfw/mpfw.vcxproj b/mpfw/mpfw.vcxproj index da33f84..0fa15bd 100644 --- a/mpfw/mpfw.vcxproj +++ b/mpfw/mpfw.vcxproj @@ -148,6 +148,7 @@ + @@ -157,6 +158,7 @@ + diff --git a/mpfw/mpfw.vcxproj.filters b/mpfw/mpfw.vcxproj.filters index 26d3348..75a1879 100644 --- a/mpfw/mpfw.vcxproj.filters +++ b/mpfw/mpfw.vcxproj.filters @@ -60,6 +60,9 @@ ext. + + Source Files + @@ -83,5 +86,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/mpfw/mpfw.vcxproj.user b/mpfw/mpfw.vcxproj.user index d011c1f..6acfa8d 100644 --- a/mpfw/mpfw.vcxproj.user +++ b/mpfw/mpfw.vcxproj.user @@ -1,11 +1,11 @@  - $(SolutionDir)/gameenv + $(SolutionDir)/gmtk2025 WindowsLocalDebugger - $(SolutionDir)/gameenv + $(SolutionDir)/gmtk2025 WindowsLocalDebugger \ No newline at end of file