Updating a few things.

This commit is contained in:
Deathsbreed 2016-03-30 16:36:13 +02:00
parent 263b26c300
commit 75e46bc0ab
4 changed files with 8 additions and 26 deletions

View File

@ -3,22 +3,7 @@ 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_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules)
find_package(X11)
if(NOT X11_FOUND)
message(FATAL_ERROR "Package X11 is required, but not found!")
endif(NOT X11_FOUND)
find_package(GLUT)
if(NOT GLUT_FOUND)
message(FATAL_ERROR "Package OpenGL is required, but not found!")
endif(NOT GLUT_FOUND)
find_package(ZLIB)
if(NOT ZLIB_FOUND)
message(FATAL_ERROR "Package zlib is required, but not found!")
endif(NOT ZLIB_FOUND)
find_package(Irrlicht) find_package(Irrlicht)
if(NOT Irrlicht_FOUND) if(NOT Irrlicht_FOUND)
@ -27,22 +12,18 @@ endif(NOT Irrlicht_FOUND)
include_directories( include_directories(
${IRRLICHT_INCLUDE_DIR} ${IRRLICHT_INCLUDE_DIR}
${X11_INCLUDE_DIR}
${GLUT_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
) )
file(GLOB SRCS src/*.cpp) file(GLOB SRCS src/*.cpp)
file(GLOB HDRS src/*.h) file(GLOB HDRS src/*.h)
include_directories(${IRRLICHT_INCLUDE_DIR})
add_executable(${CMAKE_PROJECT_NAME} add_executable(${CMAKE_PROJECT_NAME}
${SRCS} ${SRCS}
${HDRS} ${HDRS}
) )
target_link_libraries(${CMAKE_PROJECT_NAME} target_link_libraries(${CMAKE_PROJECT_NAME}
${X11_LIBRARIES}
${GLUT_LIBRARIES}
${ZLIB_LIBRARIES}
${IRRLICHT_LIBRARY} ${IRRLICHT_LIBRARY}
) )

View File

@ -5,10 +5,11 @@ find_path(IRRLICHT_INCLUDE_DIR irrlicht/irrlicht.h
message(STATUS "IRRLICHT_INCLUDE_DIR = ${IRRLICHT_INCLUDE_DIR}") message(STATUS "IRRLICHT_INCLUDE_DIR = ${IRRLICHT_INCLUDE_DIR}")
find_library(IRRLICHT_LIBRARY NAMES Irrlicht find_library(IRRLICHT_LIBRARY NAMES libIrrlicht.so
PATHS $ENV{IRRDIR}/lib PATHS $ENV{IRRDIR}/lib
) )
message(STATUS "IRRLICHT_LIBRARY = ${IRRLICHT_LIBRARY}") message(STATUS "IRRLICHT_LIBRARY = ${IRRLICHT_LIBRARY}")
if(IRRLICHT_INCLUDE_DIR AND IRRLICHT_LIBRARY) if(IRRLICHT_INCLUDE_DIR AND IRRLICHT_LIBRARY)

View File

@ -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("../res/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;
@ -76,7 +76,7 @@ int main() {
while(device->run()) { while(device->run()) {
// Begin the scene // Begin the scene
driver->beginScene(true, true, video::SColor(0, 255, 101, 255)); driver->beginScene(true, true, video::SColor(50, 50, 255, 255));
// Draw // Draw
smgr->drawAll(); smgr->drawAll();
guienv->drawAll(); guienv->drawAll();