Przeglądaj źródła

Added run target

Thomas Buck 10 lat temu
rodzic
commit
331d5edd97
3 zmienionych plików z 17 dodań i 13 usunięć
  1. 13
    12
      README.md
  2. 3
    0
      src/CMakeLists.txt
  3. 1
    1
      src/SDLSystem.cpp

+ 13
- 12
README.md Wyświetl plik

@@ -4,18 +4,14 @@
4 4
 
5 5
 This project aims to get OpenRaider in a more usable state, maybe one day even being able to play the old Tomb Raider games flawlessly...
6 6
 
7
-Currently, my focus is on building and running under Mac OS X.
8
-However, my changes should not break the Linux "buildability" :)
9
-
10
-If you just want to see OpenRaider doing something on your Mac, without installing any of the dependencies needed to build OpenRaider, install [XQuartz](http://xquartz.macosforge.org/trac) (if you don't have it already) and grab the Mac App Bundle from the [most recent release](https://github.com/xythobuz/OpenRaider/releases).
11
-If you don't install XQuartz, Mac OS X should prompt you to do so on the first launch of OpenRaider.
7
+If you just want to see OpenRaider doing something on your Mac, without installing any of the dependencies needed to build OpenRaider, grab the Mac App Bundle from the [most recent release](https://github.com/xythobuz/OpenRaider/releases).
12 8
 
13 9
 It seems as if OpenRaider will currently only work on Little-Endian platforms. This is not nice and will hopefully be fixed in the future!
14 10
 
15 11
 ## Configuration
16 12
 
17 13
 OpenRaider needs some configuration files, and level data and assets from custom levels or the Tomb Raider games.
18
-These are stored in `~/.OpenRaider`. Running the included `setup.sh` will create/copy the necessary files and directories. The Mac App Bundle will do this for you automatically.
14
+These are stored in `~/.OpenRaider`. Running the included `setup.sh` will create/copy the necessary files and directories.
19 15
 
20 16
 You still need to add level files in `~/.OpenRaider/paks/` and add them to `~/.OpenRaider/OpenRaider.init`.
21 17
 Dust off your old Tomb Raider CDs or grab some [custom levels](http://www.aspidetr.com/levels/yvel-woods-v1-5/) from the interwebs.
@@ -36,10 +32,11 @@ Basically, OpenRaider depends on the following:
36 32
 * OpenAL & ALUT
37 33
 * Posix Threads
38 34
 * zlib
35
+* cmake as build system
39 36
 
40 37
 On Mac OS X 10.9 with [XCode](https://developer.apple.com/xcode/) and [MacPorts](http://www.macports.org) installed, the following should be enough to get all dependencies that are available as port:
41 38
 
42
-    sudo port install zlib libsdl2 libsdl2_ttf cmake
39
+    sudo port install cmake zlib libsdl2 libsdl2_ttf
43 40
 
44 41
 A similar command for the package manager of your favorite Linux Distribution should do the trick.
45 42
 
@@ -57,7 +54,7 @@ Linux Distributions will probably provide an ALUT library ready to install with
57 54
 
58 55
 ## Building
59 56
 
60
-Do a standard cmake build and then run the resulting executable:
57
+Do a standard cmake out-of-source build and then run the resulting executable:
61 58
 
62 59
     mkdir build
63 60
     cd build
@@ -65,12 +62,16 @@ Do a standard cmake build and then run the resulting executable:
65 62
     make
66 63
     ./src/OpenRaider
67 64
 
68
-On Mac OS X, running `make install` will produce a distributable OpenRaider.app bundle.
65
+On Mac OS X, running `make install` will produce a (more or less) distributable OpenRaider.app bundle.
66
+
67
+To build all Unit Tests run `make tests`, to build and run most of them use `make testRun`.
68
+
69
+To run a TombRaider level loader regression test use `make testReg`. The results will be put into log files in your build folder.
69 70
 
70
-To build all Unit Tests, run `make tests`, to run most of them use `make testRun`.
71
-To run a TombRaider level loader regression test, use `make testReg`. The results will be put into log files in your build folder.
72 71
 You can run a static analysis with cppcheck using `make check`, `make checkFull` or `make checkConfig`.
73
-A Doxygen API documentation can be created with `make doc`. `make docLocal` will not create additional graphs for the documentation and tries to copy the result into a directory called apache on the parent level of the OpenRaider project directory.
72
+
73
+A Doxygen API documentation can be created with `make doc`.
74
+
74 75
 `make clean` should remove all intermediary files.
75 76
 
76 77
 ## Usage

+ 3
- 0
src/CMakeLists.txt Wyświetl plik

@@ -114,3 +114,6 @@ set (LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
114 114
 
115 115
 # Link to all found libs
116 116
 target_link_libraries (OpenRaider ${LIBS})
117
+
118
+# Add target to run executable
119
+add_custom_target(run COMMAND OpenRaider DEPENDS OpenRaider WORKING_DIRECTORY ${CMAKE_PROJECT_DIR})

+ 1
- 1
src/SDLSystem.cpp Wyświetl plik

@@ -84,7 +84,7 @@ void SDLSystem::initVideo(unsigned int width, unsigned int height, bool fullscre
84 84
     if (mFullscreen)
85 85
         flags |= SDL_WINDOW_FULLSCREEN;
86 86
 
87
-    //setGrabMouse(true); // Always grab mouse!
87
+    setGrabMouse(true); // Always grab mouse!
88 88
 
89 89
     SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
90 90
     SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);

Ładowanie…
Anuluj
Zapisz