diff --git a/.gitignore b/.gitignore index 881913b..fa52b3e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,5 @@ CMakeCache.txt cmake_install.cmake Makefile -# Ignore binary files -bin/ +# Ignore the binary +CastleTour diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e012c1..593086d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(CastleTour) set(CMAKE_CXX_FLAGS "-Wall -g") -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules) find_package(Irrlicht) @@ -15,7 +14,7 @@ include_directories( ) file(GLOB SRCS src/*.cpp) -file(GLOB HDRS src/*.h) +file(GLOB HDRS src/*.hpp) include_directories(${IRRLICHT_INCLUDE_DIR}) diff --git a/README.md b/README.md index f22676a..b4cbe72 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,11 @@ This repo is a combination of a few Irrlicht tutorials. ### Compiling This project uses [CMake](http://www.cmake.org/) and has only been tested on a 32-bit Linux computer. To compile this code install Irrlicht (from the repos) and all other necessary libraries (such as OpenGL) and run the following commands: ```bash -$ cmake . +$ cd build/ +$ cmake .. $ make ``` -This should compile the code and you should find a binary in a directory called `bin`. You should be able to run this project from there. +Then, in order to run, use the script [castle-tour.sh](/castle-tour.sh) located in the root directory. ### License Since this really isn't my code but a combination of multiple Irrlicht tutorials, I have licensed this project under the [Unlicense](/LICENSE), because it's kind of like a tutorial. diff --git a/build/.keep b/build/.keep new file mode 100644 index 0000000..e69de29 diff --git a/castle-tour.sh b/castle-tour.sh new file mode 100755 index 0000000..456565f --- /dev/null +++ b/castle-tour.sh @@ -0,0 +1,2 @@ +#!/bin/bash +./build/CastleTour diff --git a/src/eventReceiver.cpp b/src/EventReceiver.cpp similarity index 95% rename from src/eventReceiver.cpp rename to src/EventReceiver.cpp index e20039c..453a0a6 100644 --- a/src/eventReceiver.cpp +++ b/src/EventReceiver.cpp @@ -1,4 +1,4 @@ -#include "eventReceiver.h" +#include "EventReceiver.hpp" // Initialize EventReceiver::EventReceiver() { diff --git a/src/eventReceiver.h b/src/EventReceiver.hpp similarity index 100% rename from src/eventReceiver.h rename to src/EventReceiver.hpp diff --git a/src/main.cpp b/src/Main.cpp similarity index 95% rename from src/main.cpp rename to src/Main.cpp index 5198587..a24540f 100644 --- a/src/main.cpp +++ b/src/Main.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "eventReceiver.h" +#include "EventReceiver.hpp" using namespace irr; @@ -14,7 +14,7 @@ int main() { EventReceiver eventReceiver; // Create the device we'll be using - IrrlichtDevice *device = createDevice(driverType, core::dimension2d(1280, 720), 32, false, false, false, &eventReceiver); + IrrlichtDevice *device = createDevice(driverType, core::dimension2d(800, 600), 32, false, false, false, &eventReceiver); if(device == 0) return 1; // Create other variables we'll need @@ -26,7 +26,7 @@ int main() { guienv->addStaticText(L"Use WASD to move\nUse SPACE to jump\nUse R to reset\nUse ESC or Q to exit", core::rect(30, 30, 120, 72), false, false, 0, -1, true); // Load map - device->getFileSystem()->addFileArchive("../assets/map-20kdm2.pk3"); + device->getFileSystem()->addFileArchive("assets/map-20kdm2.pk3"); scene::IAnimatedMesh *mapmesh = smgr->getMesh("20kdm2.bsp"); scene::IMeshSceneNode *mapnode = 0;