src/callback_table.cpp
author truelight
Wed, 20 Jun 2007 12:09:47 +0000
changeset 6979 c4abd9b85a7a
parent 6847 77facd267574
child 7478 893d987adeef
permissions -rw-r--r--
(svn r10235) -Fix: the 32bpp-anim blitter repainted pixel color 0, which is transparency and therefor should never be repainted (spotted by Rubidium)
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1891
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1891
diff changeset
     2
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
     3
/** @file callback_table.cpp */
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
     4
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     5
#include "stdafx.h"
1891
862800791170 (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents: 1568
diff changeset
     6
#include "openttd.h"
2762
1cecb8ffa947 (svn r3307) A file shall include its own header
tron
parents: 2557
diff changeset
     7
#include "callback_table.h"
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     8
#include "functions.h"
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
     9
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    10
/* If you add a callback for DoCommandP, also add the callback in here
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    11
 *   see below for the full list!
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    12
 * If you don't do it, it won't work across the network!! */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    13
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    14
/* aircraft_gui.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    15
CommandCallback CcBuildAircraft;
2244
417a472e7cb5 (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    16
CommandCallback CcCloneAircraft;
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    17
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    18
/* airport_gui.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    19
CommandCallback CcBuildAirport;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    20
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    21
/* bridge_gui.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    22
CommandCallback CcBuildBridge;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    23
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    24
/* dock_gui.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    25
CommandCallback CcBuildDocks;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    26
CommandCallback CcBuildCanal;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    27
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    28
/* depot_gui.cpp */
4689
9a478541aec8 (svn r6594) - Fix (r6513): When adding command callbacks, add the callback to the list...
peter1138
parents: 3946
diff changeset
    29
CommandCallback CcCloneVehicle;
9a478541aec8 (svn r6594) - Fix (r6513): When adding command callbacks, add the callback to the list...
peter1138
parents: 3946
diff changeset
    30
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    31
/* main_gui.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    32
CommandCallback CcPlaySound10;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    33
CommandCallback CcPlaceSign;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    34
CommandCallback CcTerraform;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    35
CommandCallback CcBuildTown;
6847
77facd267574 (svn r10087) -Fix [FS#834]: multiple subsequent "give money" actions could result in duplicate messages that money has been transfered when it only happened once.
rubidium
parents: 6123
diff changeset
    36
CommandCallback CcGiveMoney;
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    37
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    38
/* rail_gui.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    39
CommandCallback CcPlaySound1E;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    40
CommandCallback CcRailDepot;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    41
CommandCallback CcStation;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    42
CommandCallback CcBuildRailTunnel;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    43
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    44
/* road_gui.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    45
CommandCallback CcPlaySound1D;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    46
CommandCallback CcBuildRoadTunnel;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    47
CommandCallback CcRoadDepot;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    48
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    49
/* roadveh_gui.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    50
CommandCallback CcBuildRoadVeh;
2244
417a472e7cb5 (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    51
CommandCallback CcCloneRoadVeh;
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    52
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    53
/* ship_gui.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    54
CommandCallback CcBuildShip;
2244
417a472e7cb5 (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    55
CommandCallback CcCloneShip;
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    56
6123
04eb770ec17e (svn r8859) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 5584
diff changeset
    57
/* train_gui.cpp */
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    58
CommandCallback CcBuildWagon;
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    59
CommandCallback CcBuildLoco;
2244
417a472e7cb5 (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    60
CommandCallback CcCloneTrain;
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    61
3946
3c8c78208dbb (svn r5092) -Fix: There was a gross race condition in the AI code which made it pretty random if the AI could give a new vehicle its orders
tron
parents: 2762
diff changeset
    62
CommandCallback CcAI;
3c8c78208dbb (svn r5092) -Fix: There was a gross race condition in the AI code which made it pretty random if the AI could give a new vehicle its orders
tron
parents: 2762
diff changeset
    63
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    64
CommandCallback *_callback_table[] = {
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    65
	/* 0x00 */ NULL,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    66
	/* 0x01 */ CcBuildAircraft,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    67
	/* 0x02 */ CcBuildAirport,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    68
	/* 0x03 */ CcBuildBridge,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    69
	/* 0x04 */ CcBuildCanal,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    70
	/* 0x05 */ CcBuildDocks,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    71
	/* 0x06 */ CcBuildLoco,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    72
	/* 0x07 */ CcBuildRoadVeh,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    73
	/* 0x08 */ CcBuildShip,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    74
	/* 0x09 */ CcBuildTown,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    75
	/* 0x0A */ CcBuildRoadTunnel,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    76
	/* 0x0B */ CcBuildRailTunnel,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    77
	/* 0x0C */ CcBuildWagon,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    78
	/* 0x0D */ CcRoadDepot,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    79
	/* 0x0E */ CcRailDepot,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    80
	/* 0x0F */ CcPlaceSign,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    81
	/* 0x10 */ CcPlaySound10,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    82
	/* 0x11 */ CcPlaySound1D,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    83
	/* 0x12 */ CcPlaySound1E,
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    84
	/* 0x13 */ CcStation,
2244
417a472e7cb5 (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    85
	/* 0x14 */ CcTerraform,
417a472e7cb5 (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    86
	/* 0x15 */ CcCloneAircraft,
417a472e7cb5 (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    87
	/* 0x16 */ CcCloneRoadVeh,
417a472e7cb5 (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    88
	/* 0x17 */ CcCloneShip,
417a472e7cb5 (svn r2764) -Feature: Clone vehicles
bjarni
parents: 2186
diff changeset
    89
	/* 0x18 */ CcCloneTrain,
4689
9a478541aec8 (svn r6594) - Fix (r6513): When adding command callbacks, add the callback to the list...
peter1138
parents: 3946
diff changeset
    90
	/* 0x19 */ CcAI,
6847
77facd267574 (svn r10087) -Fix [FS#834]: multiple subsequent "give money" actions could result in duplicate messages that money has been transfered when it only happened once.
rubidium
parents: 6123
diff changeset
    91
	/* 0x1A */ CcCloneVehicle,
77facd267574 (svn r10087) -Fix [FS#834]: multiple subsequent "give money" actions could result in duplicate messages that money has been transfered when it only happened once.
rubidium
parents: 6123
diff changeset
    92
	/* 0x1B */ CcGiveMoney,
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    93
};
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents:
diff changeset
    94
1568
3bfd488306ba (svn r2072) Use lengthof() instead of a home brewed version
tron
parents: 543
diff changeset
    95
const int _callback_table_count = lengthof(_callback_table);