Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cgame: Prefix CHAR_{WIDTH|HEIGHT} with CGAME_
This definition conflicts with another definition in
toolchain.
  • Loading branch information
DolceTriade committed Jun 3, 2017
1 parent 55eed1f commit 65984fc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 49 deletions.
38 changes: 12 additions & 26 deletions CMakeLists.txt
Expand Up @@ -34,36 +34,22 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Building in the source directory is not supported, try building in a 'build' directory. You may have to delete the CMakeCache.txt file and CMakeFiles directory that are next to the CMakeLists.txt.")
endif()

set(SUBMODULE_LIST
"libs/libRocket"
"src/utils/cbse")

set(DAEMON_DIR_STRING "Path to the Daemon Engine source.")
if(NOT DAEMON_DIR)
set(DAEMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/daemon" CACHE STRING "${DAEMON_DIR_STRING}")
LIST(APPEND SUBMODULE_LIST "daemon")
else()
set(DAEMON_DIR "${DAEMON_DIR}" CACHE STRING "${DAEMON_DIR_STRING}")
endif()

foreach(SUBMODULE_PATH ${SUBMODULE_LIST})
# Check if we need to initialize submodule
file(GLOB DENG_RESULT "${CMAKE_CURRENT_SOURCE_DIR}/${SUBMODULE_PATH}")
list(LENGTH ${DENG_RESULT} DENG_RES_LEN)
if(DENG_RES_LEN EQUAL 0)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
find_package(Git REQUIRED)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- "${SUBMODULE_PATH}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
# Check if we need to initialize submodules
file(GLOB DENG_RESULT ${CMAKE_CURRENT_SOURCE_DIR}/daemon)
list(LENGTH ${DENG_RESULT} DENG_RES_LEN)
if(DENG_RES_LEN EQUAL 0)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
find_package(Git REQUIRED)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
endif()
endforeach()
endif()

set(Daemon_OUT ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory("${DAEMON_DIR}" daemon_build)
add_subdirectory(daemon daemon_build)
include(DaemonGame)

set(LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs)
Expand Down
38 changes: 19 additions & 19 deletions README.md
@@ -1,4 +1,4 @@
# Unvanquished
#Unvanquished

[![GitHub tag](https://img.shields.io/github/tag/Unvanquished/Unvanquished.svg)](https://github.com/Unvanquished/Unvanquished/tags)
[![GitHub release](https://img.shields.io/github/release/Unvanquished/Unvanquished.svg)](https://github.com/Unvanquished/Unvanquished/releases/latest)
Expand All @@ -14,7 +14,7 @@ This repository contains the gamelogic of the game Unvanquished.
You need to download the game's assets in addition to that to make it run.
See below for build and launch instructions.

## Dependencies
##Dependencies

`zlib`,
`libgmp`,
Expand All @@ -33,57 +33,57 @@ See below for build and launch instructions.
`libopus`,
`libopusfile`

### Buildtime
###Buildtime

`cmake`,
`python` ≥ 2,
`python-yaml`,
`python-jinja`

### Optional
###Optional

`ncurses`,
`libGeoIP`

### MSYS2
###MSYS2

`base-devel`

64-bit: `mingw-w64-x86_64-{toolchain,cmake,aria2}`
*or*
32-bit: `mingw-w64-i686-{toolchain,cmake,aria2}`

## Build Instructions
##Build Instructions

Instead of `make`, you can use `make -jN` where `N` is your number of CPU cores to speed up compilation.

### Visual Studio
###Visual Studio

1. Run CMake.
2. Choose your compiler.
3. Open `Unvanquished.sln` and compile.

### Linux, Mac OS X
###Linux, Mac OS X

mkdir build && cd build
cmake ..
make

### MSYS2
###MSYS2

mkdir build && cd build
cmake -G "MSYS Makefiles" ..
make

### Linux cross-compile to Windows
###Linux cross-compile to Windows

mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../daemon/cmake/cross-toolchain-mingw32.cmake .. # ¹
make

¹ *Use `cross-toolchain-mingw64.cmake` for a Win64 build.*

### Mac OS X universal app
###Mac OS X universal app

mkdir build32 && cd build32
cmake -DCMAKE_OSX_ARCHITECTURES=i386 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 ..
Expand All @@ -95,18 +95,18 @@ Instead of `make`, you can use `make -jN` where `N` is your number of CPU cores
cd ..
./make-macosx-app.sh build32 build64

## Launch Instructions
##Launch Instructions

### Linux, Mac OS X, MSYS2
###Linux, Mac OS X, MSYS2

#### If Unvanquished's assets are installed on your system
####If Unvanquished's assets are installed on your system

cd build
./daemon -pakpath PATH # ¹

¹ *`PATH` is the path to the `pkg` directory that contains the game's assets.*

#### If you don't have the assets
####If you don't have the assets

cd build
mkdir pkg
Expand All @@ -120,7 +120,7 @@ Instead of `make`, you can use `make -jN` where `N` is your number of CPU cores
¹ *Fast, requires `aria2c`.*
² *Unreliable speed, requires `curl`.*

#### If you're a developer
####If you're a developer

As a developer, you will want to load your own assets in addition to those shipped with the game. To do that:

Expand All @@ -138,13 +138,13 @@ You can now put loose assets into `assets_source.pk3dir` or you can put addition
¹ *Runs the game and loads the `assets` package and its dependencies. `PATH` is the path to Unvanquished's base packages and maps. Omit `-pakpath PATH` if `pkg` contains these assets.*
² *In addition, load a shared-object gamelogic you compiled and allow it to be debugged. Launch the map Platform 23 with cheats enabled after startup.*

### Windows
###Windows

#### If Unvanquished's assets are installed on your system
####If Unvanquished's assets are installed on your system

Run `daemon.exe -pakpath PATH`, where `PATH` is the path to the `pkg` directory that contains the game's assets.

#### If you don't have the assets
####If you don't have the assets

1. Copy the `pkg` directory from the release zip ([torrent](https://cdn.unvanquished.net/latest.php) | [web](https://github.com/Unvanquished/Unvanquished/releases)) into your build directory.
2. Run `daemon.exe`.
4 changes: 2 additions & 2 deletions src/cgame/cg_draw.cpp
Expand Up @@ -42,12 +42,12 @@ void CG_DrawField( float x, float y, int width, float cw, float ch, int value )

if ( !( charWidth = cw ) )
{
charWidth = CHAR_WIDTH;
charWidth = CGAME_CHAR_WIDTH;
}

if ( !( charHeight = ch ) )
{
charHeight = CHAR_HEIGHT;
charHeight = CGAME_CHAR_HEIGHT;
}

if ( width < 1 )
Expand Down
4 changes: 2 additions & 2 deletions src/cgame/cg_local.h
Expand Up @@ -58,8 +58,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#define STAT_MINUS 10 // num frame for '-' stats digit

#define CHAR_WIDTH 32
#define CHAR_HEIGHT 48
#define CGAME_CHAR_WIDTH 32
#define CGAME_CHAR_HEIGHT 48

#define MAX_LOADING_LABEL_LENGTH 32

Expand Down

0 comments on commit 65984fc

Please sign in to comment.