Different building process.

This commit is contained in:
Nicolás A. Ortega 2016-04-25 12:07:09 +02:00
parent 75e46bc0ab
commit 002071cef4
No known key found for this signature in database
GPG Key ID: 4825F773B8D44EFF
8 changed files with 12 additions and 10 deletions

4
.gitignore vendored
View File

@ -4,5 +4,5 @@ CMakeCache.txt
cmake_install.cmake cmake_install.cmake
Makefile Makefile
# Ignore binary files # Ignore the binary
bin/ CastleTour

View File

@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 2.6)
project(CastleTour) project(CastleTour)
set(CMAKE_CXX_FLAGS "-Wall -g") set(CMAKE_CXX_FLAGS "-Wall -g")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules)
find_package(Irrlicht) find_package(Irrlicht)
@ -15,7 +14,7 @@ include_directories(
) )
file(GLOB SRCS src/*.cpp) file(GLOB SRCS src/*.cpp)
file(GLOB HDRS src/*.h) file(GLOB HDRS src/*.hpp)
include_directories(${IRRLICHT_INCLUDE_DIR}) include_directories(${IRRLICHT_INCLUDE_DIR})

View File

@ -6,10 +6,11 @@ This repo is a combination of a few Irrlicht tutorials.
### Compiling ### 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: 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 ```bash
$ cmake . $ cd build/
$ cmake ..
$ make $ 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 ### 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. 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.

0
build/.keep Normal file
View File

2
castle-tour.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
./build/CastleTour

View File

@ -1,4 +1,4 @@
#include "eventReceiver.h" #include "EventReceiver.hpp"
// Initialize // Initialize
EventReceiver::EventReceiver() { EventReceiver::EventReceiver() {

View File

@ -1,7 +1,7 @@
#include <iostream> #include <iostream>
#include <irrlicht/irrlicht.h> #include <irrlicht/irrlicht.h>
#include <irrlicht/driverChoice.h> #include <irrlicht/driverChoice.h>
#include "eventReceiver.h" #include "EventReceiver.hpp"
using namespace irr; using namespace irr;
@ -14,7 +14,7 @@ int main() {
EventReceiver eventReceiver; EventReceiver eventReceiver;
// Create the device we'll be using // Create the device we'll be using
IrrlichtDevice *device = createDevice(driverType, core::dimension2d<u32>(1280, 720), 32, false, false, false, &eventReceiver); IrrlichtDevice *device = createDevice(driverType, core::dimension2d<u32>(800, 600), 32, false, false, false, &eventReceiver);
if(device == 0) return 1; if(device == 0) return 1;
// Create other variables we'll need // 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<s32>(30, 30, 120, 72), false, false, 0, -1, true); guienv->addStaticText(L"Use WASD to move\nUse SPACE to jump\nUse R to reset\nUse ESC or Q to exit", core::rect<s32>(30, 30, 120, 72), false, false, 0, -1, true);
// Load map // Load map
device->getFileSystem()->addFileArchive("../assets/map-20kdm2.pk3"); device->getFileSystem()->addFileArchive("assets/map-20kdm2.pk3");
scene::IAnimatedMesh *mapmesh = smgr->getMesh("20kdm2.bsp"); scene::IAnimatedMesh *mapmesh = smgr->getMesh("20kdm2.bsp");
scene::IMeshSceneNode *mapnode = 0; scene::IMeshSceneNode *mapnode = 0;