Changeset - r8113:7815c26d7612
src/airport.cpp
Show inline comments
 
@@ -7,11 +7,10 @@
 
#include "debug.h"
 
#include "map.h"
 
#include "airport.h"
 
#include "macros.h"
 
#include "variables.h"
 
#include "airport_movement.h"
 
#include "date.h"
 
#include "helpers.hpp"
 
#include "core/bitmath_func.hpp"
 

	
 
/* Uncomment this to print out a full report of the airport-structure
 
 * You should either use
src/blitter/32bpp_base.hpp
Show inline comments
 
@@ -6,6 +6,7 @@
 
#define BLITTER_32BPP_BASE_HPP
 

	
 
#include "base.hpp"
 
#include "../core/bitmath_func.hpp"
 

	
 
class Blitter_32bppBase : public Blitter {
 
public:
src/bmp.cpp
Show inline comments
 
@@ -6,8 +6,7 @@
 
#include "openttd.h"
 
#include "gfx.h"
 
#include "bmp.h"
 
#include "macros.h"
 
#include "helpers.hpp"
 
#include "core/bitmath_func.hpp"
 

	
 
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
 
{
src/bridge_map.h
Show inline comments
 
@@ -6,7 +6,6 @@
 
#define BRIDGE_MAP_H
 

	
 
#include "direction_func.h"
 
#include "macros.h"
 
#include "map.h"
 
#include "rail_type.h"
 
#include "road_map.h"
src/cargotype.cpp
Show inline comments
 
@@ -4,11 +4,11 @@
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "macros.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "newgrf_cargo.h"
 
#include "cargotype.h"
 
#include "core/bitmath_func.hpp"
 

	
 
#include "table/cargo_const.h"
 

	
src/clear_map.h
Show inline comments
 
@@ -5,7 +5,6 @@
 
#ifndef CLEAR_MAP_H
 
#define CLEAR_MAP_H
 

	
 
#include "macros.h"
 
#include "bridge_map.h"
 

	
 
/**
src/cmd_helper.h
Show inline comments
 
@@ -4,7 +4,6 @@
 
#define CMD_HELPER_H
 

	
 
#include "direction_type.h"
 
#include "macros.h"
 
#include "road_type.h"
 

	
 

	
src/core/bitmath_func.hpp
Show inline comments
 
@@ -276,4 +276,19 @@ template<typename T> static inline T ROR
 
	return (T)(x >> n | x << (sizeof(x) * 8 - n));
 
}
 

	
 
/**
 
 * Do an operation for each set set bit in a value.
 
 *
 
 * This macros is used to do an operation for each set
 
 * bit in a variable. The first variable can be reused
 
 * in the operation due to it's the bit position counter.
 
 * The second variable will be cleared during the usage
 
 *
 
 * @param i The position counter
 
 * @param b The value which we check for set bits
 
 */
 
#define FOR_EACH_SET_BIT(i, b)      \
 
	for (i = 0; b != 0; i++, b >>= 1) \
 
		if (b & 1)
 

	
 
#endif /* BITMATH_FUNC_HPP */
src/core/endian_func.hpp
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/** @file endian_func.hpp */
 

	
 
#ifndef ENDIAN_FUNC_H
 
#define ENDIAN_FUNC_H
 

	
 
static inline uint16 ReadLE16Aligned(const void *x)
 
{
 
	return FROM_LE16(*(const uint16*)x);
 
}
 

	
 
static inline uint16 ReadLE16Unaligned(const void *x)
 
{
 
#ifdef OTTD_ALIGNMENT
 
	return ((const byte*)x)[0] | ((const byte*)x)[1] << 8;
 
#else
 
	return FROM_LE16(*(const uint16*)x);
 
#endif
 
}
 

	
 
#endif /* ENDIAN_FUNC_H */
src/core/math_func.hpp
Show inline comments
 
@@ -18,6 +18,12 @@
 
#endif
 

	
 
/**
 
 * The largest value that can be entered in a variable
 
 * @param type the type of the variable
 
 */
 
#define MAX_UVALUE(type) ((type)~(type)0)
 

	
 
/**
 
 * Returns the maximum of two values.
 
 *
 
 * This function returns the greater value of two given values.
src/core/overflowsafe_type.hpp
Show inline comments
 
@@ -5,6 +5,8 @@
 
#ifndef OVERFLOWSAFE_TYPE_HPP
 
#define OVERFLOWSAFE_TYPE_HPP
 

	
 
#include "math_func.hpp"
 

	
 
/**
 
 * Overflow safe template for integers, i.e. integers that will never overflow
 
 * you multiply the maximum value with 2, or add 2, or substract somethng from
src/core/random_func.cpp
Show inline comments
 
@@ -3,9 +3,9 @@
 
/** @file random_func.cpp */
 

	
 
#include "../stdafx.h"
 
#include "../macros.h"
 
#include "../variables.h"
 
#include "random_func.hpp"
 
#include "bitmath_func.hpp"
 

	
 
uint32 InteractiveRandom()
 
{
src/date.cpp
Show inline comments
 
@@ -6,7 +6,6 @@
 
#include "openttd.h"
 
#include "date.h"
 
#include "variables.h"
 
#include "macros.h"
 
#include "vehicle.h"
 
#include "network/network.h"
 
#include "network/network_data.h"
src/fileio.cpp
Show inline comments
 
@@ -7,7 +7,6 @@
 
#include "fileio.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "macros.h"
 
#include "variables.h"
 
#include "debug.h"
 
#include "fios.h"
src/fontcache.cpp
Show inline comments
 
@@ -5,7 +5,6 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "macros.h"
 
#include "debug.h"
 
#include "table/sprites.h"
 
#include "table/control_codes.h"
src/gfx.cpp
Show inline comments
 
@@ -5,7 +5,6 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "macros.h"
 
#include "spritecache.h"
 
#include "strings.h"
 
#include "string.h"
src/gfx.h
Show inline comments
 
@@ -36,6 +36,7 @@
 
#define GFX_H
 

	
 
#include "openttd.h"
 
#include "core/math_func.hpp"
 
#include "zoom.hpp"
 

	
 
enum WindowKeyCodes {
src/industry_map.h
Show inline comments
 
@@ -6,7 +6,6 @@
 
#define INDUSTRY_MAP_H
 

	
 
#include "industry.h"
 
#include "macros.h"
 
#include "tile_map.h"
 

	
 

	
src/macros.h
Show inline comments
 
deleted file
src/map.cpp
Show inline comments
 
@@ -6,10 +6,10 @@
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "macros.h"
 
#include "map.h"
 
#include "helpers.hpp"
 
#include "direction_func.h"
 
#include "helpers.hpp"
 
#include "core/bitmath_func.hpp"
 

	
 
#if defined(_MSC_VER) && _MSC_VER >= 1400 /* VStudio 2005 is stupid! */
 
/* Why the hell is that not in all MSVC headers?? */
src/music_gui.cpp
Show inline comments
 
@@ -11,7 +11,6 @@
 
#include "fileio.h"
 
#include "gfx.h"
 
#include "sound.h"
 
#include "macros.h"
 
#include "variables.h"
 
#include "music.h"
 
#include "music/music_driver.hpp"
src/namegen.cpp
Show inline comments
 
@@ -5,7 +5,6 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "macros.h"
 
#include "namegen.h"
 
#include "table/namegen.h"
 
#include "string.h"
src/network/core/packet.cpp
Show inline comments
 
@@ -7,7 +7,6 @@
 
#ifdef ENABLE_NETWORK
 

	
 
#include "../../stdafx.h"
 
#include "../../macros.h"
 
#include "../../string.h"
 
#include "../../helpers.hpp"
 

	
src/network/core/udp.cpp
Show inline comments
 
@@ -8,8 +8,8 @@
 

	
 
#include "../../stdafx.h"
 
#include "../../debug.h"
 
#include "../../macros.h"
 
#include "../../helpers.hpp"
 
#include "../../core/bitmath_func.hpp"
 
#include "../../core/math_func.hpp"
 
#include "packet.h"
 
#include "udp.h"
 

	
src/newgrf_config.cpp
Show inline comments
 
@@ -5,7 +5,6 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "macros.h"
 
#include "debug.h"
 
#include "variables.h"
 
#include "string.h"
src/newgrf_industries.cpp
Show inline comments
 
@@ -6,7 +6,6 @@
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "macros.h"
 
#include "variables.h"
 
#include "landscape.h"
 
#include "table/strings.h"
src/newgrf_spritegroup.cpp
Show inline comments
 
@@ -5,7 +5,6 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "variables.h"
 
#include "macros.h"
 
#include "landscape.h"
 
#include "oldpool.h"
 
#include "newgrf_callbacks.h"
src/newgrf_text.cpp
Show inline comments
 
@@ -15,7 +15,6 @@
 
#include "string.h"
 
#include "strings.h"
 
#include "variables.h"
 
#include "macros.h"
 
#include "table/strings.h"
 
#include "newgrf.h"
 
#include "newgrf_text.h"
src/npf.cpp
Show inline comments
 
@@ -10,7 +10,6 @@
 
#include "landscape.h"
 
#include "npf.h"
 
#include "aystar.h"
 
#include "macros.h"
 
#include "pathfind.h"
 
#include "station.h"
 
#include "station_map.h"
src/oldpool.h
Show inline comments
 
@@ -5,6 +5,8 @@
 
#ifndef OLDPOOL_H
 
#define OLDPOOL_H
 

	
 
#include "core/math_func.hpp"
 

	
 
/* The function that is called after a new block is added
 
     start_item is the first item of the new made block */
 
typedef void OldMemoryPoolNewBlock(uint start_item);
src/openttd.h
Show inline comments
 
@@ -8,7 +8,6 @@
 
#define VARDEF extern
 
#endif
 

	
 
#include "macros.h"
 
#include "helpers.hpp"
 

	
 
struct Oblong {
src/order.h
Show inline comments
 
@@ -5,8 +5,8 @@
 
#ifndef ORDER_H
 
#define ORDER_H
 

	
 
#include "macros.h"
 
#include "oldpool.h"
 
#include "core/bitmath_func.hpp"
 

	
 
enum {
 
	INVALID_VEH_ORDER_ID = 0xFF,
src/rail.h
Show inline comments
 
@@ -8,6 +8,7 @@
 
#include "gfx.h"
 
#include "rail_type.h"
 
#include "track_type.h"
 
#include "core/bitmath_func.hpp"
 
#include "variables.h"
 

	
 
/** This struct contains all the info that is needed to draw and construct tracks.
src/road.cpp
Show inline comments
 
@@ -7,7 +7,6 @@
 
#include "road_map.h"
 
#include "road_internal.h"
 
#include "water_map.h"
 
#include "macros.h"
 

	
 
bool IsPossibleCrossing(const TileIndex tile, Axis ax)
 
{
src/road_func.h
Show inline comments
 
@@ -5,6 +5,7 @@
 
#ifndef ROAD_FUNC_H
 
#define ROAD_FUNC_H
 

	
 
#include "core/bitmath_func.hpp"
 
#include "road_type.h"
 

	
 
/**
src/road_map.h
Show inline comments
 
@@ -5,7 +5,6 @@
 
#ifndef ROAD_MAP_H
 
#define ROAD_MAP_H
 

	
 
#include "macros.h"
 
#include "track_func.h"
 
#include "rail_type.h"
 
#include "road_func.h"
src/settings.cpp
Show inline comments
 
@@ -23,7 +23,6 @@
 
#include "openttd.h"
 
#include "currency.h"
 
#include "functions.h"
 
#include "macros.h"
 
#include "screenshot.h"
 
#include "sound.h"
 
#include "string.h"
src/slope_func.h
Show inline comments
 
@@ -5,6 +5,7 @@
 
#ifndef SLOPE_FUNC_H
 
#define SLOPE_FUNC_H
 

	
 
#include "core/math_func.hpp"
 
#include "slope_type.h"
 
#include "direction_type.h"
 

	
src/sprite.h
Show inline comments
 
@@ -5,6 +5,17 @@
 
#ifndef SPRITE_H
 
#define SPRITE_H
 

	
 
#define GENERAL_SPRITE_COLOR(color) ((color) + PALETTE_RECOLOR_START)
 
#define PLAYER_SPRITE_COLOR(owner) (GENERAL_SPRITE_COLOR(_player_colors[owner]))
 

	
 
/**
 
 * Whether a sprite comes from the original graphics files or a new grf file
 
 * (either supplied by OpenTTD or supplied by the user).
 
 *
 
 * @param sprite The sprite to check
 
 * @return True if it is a new sprite, or false if it is original.
 
 */
 
#define IS_CUSTOM_SPRITE(sprite) ((sprite) >= SPR_SIGNALS_BASE)
 

	
 
/* The following describes bunch of sprites to be drawn together in a single 3D
 
 * bounding box. Used especially for various multi-sprite buildings (like
src/spritecache.cpp
Show inline comments
 
@@ -8,7 +8,6 @@
 
#include "string.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "macros.h"
 
#include "spritecache.h"
 
#include "table/sprites.h"
 
#include "fileio.h"
src/string.cpp
Show inline comments
 
@@ -6,7 +6,6 @@
 
#include "openttd.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "macros.h"
 
#include "table/control_codes.h"
 
#include "helpers.hpp"
 
#include "debug.h"
src/string.h
Show inline comments
 
@@ -5,7 +5,7 @@
 
#ifndef STRING_H
 
#define STRING_H
 

	
 
#include "macros.h"
 
#include "core/bitmath_func.hpp"
 

	
 
/**
 
 * usage ttd_strlcpy(dst, src, lengthof(dst));
src/texteff.cpp
Show inline comments
 
@@ -5,7 +5,6 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "macros.h"
 
#include "strings.h"
 
#include "gfx.h"
 
#include "landscape.h"
src/tile_map.cpp
Show inline comments
 
@@ -5,6 +5,7 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "tile_map.h"
 
#include "core/math_func.hpp"
 

	
 
Slope GetTileSlope(TileIndex tile, uint *h)
 
{
src/tile_map.h
Show inline comments
 
@@ -8,6 +8,7 @@
 
#include "tile_type.h"
 
#include "slope_type.h"
 
#include "map.h"
 
#include "core/bitmath_func.hpp"
 

	
 
/**
 
 * Returns the height of a tile
src/track_func.h
Show inline comments
 
@@ -5,6 +5,7 @@
 
#ifndef TRACK_FUNC_H
 
#define TRACK_FUNC_H
 

	
 
#include "core/bitmath_func.hpp"
 
#include "track_type.h"
 
#include "direction_type.h"
 
#include "slope_func.h"
src/tree_map.h
Show inline comments
 
@@ -5,8 +5,6 @@
 
#ifndef TREE_MAP_H
 
#define TREE_MAP_H
 

	
 
#include "macros.h"
 

	
 
/**
 
 * List of tree types along all landscape types.
 
 *
src/tunnel_map.h
Show inline comments
 
@@ -6,7 +6,6 @@
 
#define TUNNEL_MAP_H
 

	
 
#include "direction_func.h"
 
#include "macros.h"
 
#include "map.h"
 
#include "rail_type.h"
 
#include "road_type.h"
src/video/sdl_v.cpp
Show inline comments
 
@@ -8,7 +8,6 @@
 
#include "../debug.h"
 
#include "../functions.h"
 
#include "../gfx.h"
 
#include "../macros.h"
 
#include "../sdl.h"
 
#include "../variables.h"
 
#include "../blitter/factory.hpp"
src/window_gui.h
Show inline comments
 
@@ -5,7 +5,6 @@
 
#ifndef WINDOW_GUI_H
 
#define WINDOW_GUI_H
 

	
 
#include "macros.h"
 
#include "string.h"
 
#include "order.h"
 
#include "rail_type.h"
0 comments (0 inline, 0 general)