src/ship.h
author peter1138
Fri, 23 Mar 2007 20:55:45 +0000
changeset 6365 b52bd4ca10b6
parent 6259 471b91a4b1d8
child 6420 456c275f3313
permissions -rw-r--r--
(svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
3962
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
     1
/* $Id$ */
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
     2
4666
172a0cdf28a6 (svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents: 4638
diff changeset
     3
#ifndef SHIP_H
172a0cdf28a6 (svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents: 4638
diff changeset
     4
#define SHIP_H
172a0cdf28a6 (svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents: 4638
diff changeset
     5
3962
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
     6
#include "vehicle.h"
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
     7
5783
e207986ffe71 (svn r8335) -Feature: the build ship window is now also resizable horizontally and contains sorting options
bjarni
parents: 5475
diff changeset
     8
void CcBuildShip(bool success, TileIndex tile, uint32 p1, uint32 p2);
4638
05955c6cb536 (svn r6513) -Codechange: unified the code to draw depot windows
bjarni
parents: 3962
diff changeset
     9
void CcCloneShip(bool success, TileIndex tile, uint32 p1, uint32 p2);
4725
40cccaaa042c (svn r6637) -Codechange: merged all (vehicle type)EnterDepot into VehicleEnterDepot()
bjarni
parents: 4666
diff changeset
    10
void RecalcShipStuff(Vehicle *v);
5972
59953719a3ff (svn r8661) -Fix: [depot windows] Enlarge the blocks in the depot window if a sprite is too big to fit (ships and aircraft only)
bjarni
parents: 5783
diff changeset
    11
void GetShipSpriteSize(EngineID engine, uint &width, uint &height);
3962
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    12
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    13
static inline bool IsShipInDepot(const Vehicle* v)
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    14
{
6259
471b91a4b1d8 (svn r9068) -Codechange: capitalize the VEH_Train etc. enums to match the coding style (and rest of the code).
rubidium
parents: 5972
diff changeset
    15
	assert(v->type == VEH_SHIP);
3962
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    16
	return v->u.ship.state == 0x80;
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    17
}
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    18
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    19
static inline bool IsShipInDepotStopped(const Vehicle* v)
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    20
{
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    21
	return IsShipInDepot(v) && v->vehstatus & VS_STOPPED;
b53bf74fbcef (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    22
}
4666
172a0cdf28a6 (svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents: 4638
diff changeset
    23
172a0cdf28a6 (svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents: 4638
diff changeset
    24
#endif /* SHIP_H */