src/elrail_func.h
author bjarni
Thu, 19 Jun 2008 17:54:23 +0000
changeset 9561 f236daaaf93a
parent 9413 7042a8ec3fa8
permissions -rw-r--r--
(svn r13584) -Fix: [OSX] Fixed issue where 10.5 failed to switch to fullscreen
This is done by selecting the 32bpp-anim blitter by default as it seems Apple removed some 8bpp support
Since this is done at runtime the same binary will still select 8bpp on 10.3 and 10.4
9154
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
     1
/* $Id$ */
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
     2
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
     3
/** @file elrail_func.h header file for electrified rail specific functions */
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
     4
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
     5
#ifndef ELRAIL_FUNC_H
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
     6
#define ELRAIL_FUNC_H
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
     7
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
     8
#include "rail.h"
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
     9
#include "transparency.h"
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    10
#include "tile_cmd.h"
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    11
#include "settings_type.h"
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    12
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    13
/**
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    14
 * Test if a rail type has catenary
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    15
 * @param rt Rail type to test
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    16
 */
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    17
static inline bool HasCatenary(RailType rt)
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    18
{
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    19
	return HasBit(GetRailTypeInfo(rt)->flags, RTF_CATENARY);
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    20
}
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    21
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    22
/**
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    23
 * Test if we should draw rail catenary
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    24
 * @param rt Rail type to test
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    25
 */
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    26
static inline bool HasCatenaryDrawn(RailType rt)
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    27
{
9413
7042a8ec3fa8 (svn r13325) -Codechange: split the client-side only settings from the settings stored in the savegame so there is no need to have a duplicate copy of it for new games.
rubidium
parents: 9354
diff changeset
    28
	return HasCatenary(rt) && !IsInvisibilitySet(TO_CATENARY) && !_settings_game.vehicle.disable_elrails;
9154
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    29
}
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    30
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    31
/**
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    32
 * Draws overhead wires and pylons for electric railways.
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    33
 * @param ti The TileInfo struct of the tile being drawn
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    34
 * @see DrawCatenaryRailway
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    35
 */
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    36
void DrawCatenary(const TileInfo *ti);
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    37
void DrawCatenaryOnTunnel(const TileInfo *ti);
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    38
void DrawCatenaryOnBridge(const TileInfo *ti);
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    39
9413
7042a8ec3fa8 (svn r13325) -Codechange: split the client-side only settings from the settings stored in the savegame so there is no need to have a duplicate copy of it for new games.
rubidium
parents: 9354
diff changeset
    40
int32 SettingsDisableElrail(int32 p1); ///< _settings_game.disable_elrail callback
9154
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    41
2c042b567165 (svn r13016) -Codechange: unify the detection if rail catenary should be drawn
smatz
parents:
diff changeset
    42
#endif /* ELRAIL_FUNC_H */