diff --git a/Airport.vcxproj b/Airport.vcxproj index c9a4598..d0a5119 100644 --- a/Airport.vcxproj +++ b/Airport.vcxproj @@ -126,10 +126,10 @@ SDL2main.lib;SDL2.lib;SDL2_image.lib;Toy.lib;Box.lib;%(AdditionalDependencies) - $(SDL2Dir)\lib\x64;$(SDL2ImageDir)\lib\x64;$(SolutionDir)out\$(Configuration);%(AdditionalLibraryDirectories) + $(SDL2Dir)\lib\x64;$(SDL2ImageDir)\lib\x64;$(SDL2TTFDir)\lib\x64;$(SolutionDir)out\$(Configuration);%(AdditionalLibraryDirectories) - $(SDL2Dir)\include;$(SDL2ImageDir)\include;%(SolutionDir)Toy\source;$(SolutionDir)box;%(AdditionalIncludeDirectories) + $(SDL2Dir)\include;$(SDL2ImageDir)\include;$(SDL2TTFDir)\include;%(SolutionDir)Toy\source;$(SolutionDir)box;%(AdditionalIncludeDirectories) stdc17 @@ -144,10 +144,10 @@ stdc17 - $(SDL2Dir)\include;$(SDL2ImageDir)\include;%(SolutionDir)Toy\source;$(SolutionDir)box;%(AdditionalIncludeDirectories) + $(SDL2Dir)\include;$(SDL2ImageDir)\include;$(SDL2TTFDir)\include;%(SolutionDir)Toy\source;$(SolutionDir)box;%(AdditionalIncludeDirectories) - $(SDL2Dir)\lib\x64;$(SDL2ImageDir)\lib\x64;$(SolutionDir)out\$(Configuration);%(AdditionalLibraryDirectories) + $(SDL2Dir)\lib\x64;$(SDL2ImageDir)\lib\x64;$(SDL2TTFDir)\lib\x64;$(SolutionDir)out\$(Configuration);%(AdditionalLibraryDirectories) SDL2main.lib;SDL2.lib;SDL2_image.lib;Toy.lib;Box.lib;%(AdditionalDependencies) diff --git a/Box.vcxproj b/Box.vcxproj index ecd740c..5d353f9 100644 --- a/Box.vcxproj +++ b/Box.vcxproj @@ -110,11 +110,11 @@ stdc17 BOX_EXPORT;LIB_RUNNER_EXPORT;%(PreprocessorDefinitions) - $(SDL2Dir)\include;$(SDL2ImageDir)\include;%(SolutionDir)Toy\source;%(AdditionalIncludeDirectories) + $(SDL2Dir)\include;$(SDL2ImageDir)\include;$(SDL2TTFDir)\include;%(SolutionDir)Toy\source;%(AdditionalIncludeDirectories) - $(SDL2Dir)\lib\x64;$(SDL2ImageDir)\lib\x64;$(SolutionDir)out\$(Configuration)\;%(AdditionalLibraryDirectories) - SDL2.lib;SDL2_image.lib;Toy.lib;%(AdditionalDependencies) + $(SDL2Dir)\lib\x64;$(SDL2ImageDir)\lib\x64;$(SDL2TTFDir)\lib\x64;$(SolutionDir)out\$(Configuration)\;%(AdditionalLibraryDirectories) + SDL2.lib;SDL2_image.lib;SDL2_ttf.lib;Toy.lib;%(AdditionalDependencies) xcopy "$(SolutionDir)Toy\repl\lib*.*" "$(SolutionDir)box" /Y /I /E @@ -125,11 +125,11 @@ xcopy "$(SolutionDir)Toy\repl\repl_tools.*" "$(SolutionDir)box" /Y /I /E stdc17 BOX_EXPORT;LIB_RUNNER_EXPORT;%(PreprocessorDefinitions) - $(SDL2Dir)\include;$(SDL2ImageDir)\include;%(SolutionDir)Toy\source;%(AdditionalIncludeDirectories) + $(SDL2Dir)\include;$(SDL2ImageDir)\include;$(SDL2TTFDir)\include;%(SolutionDir)Toy\source;%(AdditionalIncludeDirectories) - $(SDL2Dir)\lib\x64;$(SDL2ImageDir)\lib\x64;$(SolutionDir)out\$(Configuration)\;%(AdditionalLibraryDirectories) - SDL2.lib;SDL2_image.lib;Toy.lib;%(AdditionalDependencies) + $(SDL2Dir)\lib\x64;$(SDL2ImageDir)\lib\x64;$(SDL2TTFDir)\lib\x64;$(SolutionDir)out\$(Configuration)\;%(AdditionalLibraryDirectories) + SDL2.lib;SDL2_image.lib;SDL2_ttf.lib;Toy.lib;%(AdditionalDependencies) xcopy "$(SolutionDir)Toy\repl\lib*.*" "$(SolutionDir)box" /Y /I /E diff --git a/README.md b/README.md index 091709b..b38ba00 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ The best way to build a game engine, is to build a game first. -This game utilizes the [Toy programming langauge](https://toylang.com). +This project has now been adapted into a roguelike for the 7 day roguelike jam. + +This game/engine utilizes the [Toy programming langauge](https://toylang.com). ## Cloning @@ -10,13 +12,25 @@ Either clone recursively, or run `git submodule update --init` after cloning. ## Building -Simply run `make` in the root directory. +We're now using Visual Studio - define the following environment variables to point to the root of each SDL2 lib: + +* `SDL2Dir` +* `SDL2ImageDir` +* `SDL2TTFDir` ## Running -Make sure the program can see the `assets` folder (symbolic links can help). +Make sure the program can see the `assets` folder (symbolic links can help), and all of the required DLLs are present. ## Dependencies * SDL2 * SDL2_image +* SDL2_ttf + +## Credits + +* Art - Evan Hartshorn +* Coding - Kayne Ruse +* Font - Ancient God (Koczman Bálint) + diff --git a/assets/fonts/Ancient God.ttf b/assets/fonts/Ancient God.ttf new file mode 100644 index 0000000..41467b4 Binary files /dev/null and b/assets/fonts/Ancient God.ttf differ diff --git a/box/box_common.h b/box/box_common.h index 39a1e9e..363c004 100644 --- a/box/box_common.h +++ b/box/box_common.h @@ -14,6 +14,7 @@ #include #include +#include #include #define BOX_API extern @@ -22,6 +23,7 @@ #include #include +#include #include #include diff --git a/box/box_engine.c b/box/box_engine.c index b50d961..d12a200 100644 --- a/box/box_engine.c +++ b/box/box_engine.c @@ -51,6 +51,11 @@ void Box_initEngine() { fatalError("Failed to initialize SDL2_image"); } + //init SDL_ttf + if (TTF_Init() == -1) { + fatalError("Failed to initialize SDL2_ttf"); + } + //init events Toy_initLiteralDictionary(&engine.symKeyDownEvents); Toy_initLiteralDictionary(&engine.symKeyUpEvents); diff --git a/source/main.c b/source/main.c index b4c4b2c..cbd7f7b 100644 --- a/source/main.c +++ b/source/main.c @@ -42,6 +42,19 @@ int main(int argc, char* argv[]) { Toy_freeLiteral(pathLiteral); } + { + //create a pair of literals, the first for the drive name, the second for the path + Toy_Literal driveLiteral = TOY_TO_STRING_LITERAL(Toy_createRefString("fonts")); + Toy_Literal pathLiteral = TOY_TO_STRING_LITERAL(Toy_createRefString("assets/fonts")); + + //set these within the drive dictionary + Toy_setLiteralDictionary(Toy_getDriveDictionary(), driveLiteral, pathLiteral); + + //these literals are no longer needed + Toy_freeLiteral(driveLiteral); + Toy_freeLiteral(pathLiteral); + } + //run the rest of your program Box_initEngine(); Box_execEngine();