src/ship.h
author Darkvater
Sun, 18 Feb 2007 22:50:51 +0000
changeset 6400 7b98825c5cb0
parent 6223 92d2073c3d7e
child 6298 c30fe89622df
permissions -rw-r--r--
(svn r8807) -Feature: Add support for loading (some of) the TTDP extra chunks mainly list of GRFIDs and TTDP version the game was saved with.
GRFID list is read and active GRFs are loaded with the game if present in the data/ directory.
TTDP versioning information only works for newer versions, old versions will only give rough information but it's not worth the effort to precisely figure out what bit means what where and when.
3962
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
     1
/* $Id$ */
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
     2
4666
850b5b6e4bac (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
850b5b6e4bac (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
850b5b6e4bac (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
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
     6
#include "vehicle.h"
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
     7
6034
89a7d10fa75b (svn r8335) -Feature: the build ship window is now also resizable horizontally and contains sorting options
bjarni
parents: 5726
diff changeset
     8
void CcBuildShip(bool success, TileIndex tile, uint32 p1, uint32 p2);
4638
8abe4f10b94b (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
f7284b86833f (svn r6637) -Codechange: merged all (vehicle type)EnterDepot into VehicleEnterDepot()
bjarni
parents: 4666
diff changeset
    10
void RecalcShipStuff(Vehicle *v);
6223
92d2073c3d7e (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: 6034
diff changeset
    11
void GetShipSpriteSize(EngineID engine, uint &width, uint &height);
3962
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    12
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    13
static inline bool IsShipInDepot(const Vehicle* v)
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    14
{
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    15
	assert(v->type == VEH_Ship);
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    16
	return v->u.ship.state == 0x80;
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    17
}
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    18
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    19
static inline bool IsShipInDepotStopped(const Vehicle* v)
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    20
{
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    21
	return IsShipInDepot(v) && v->vehstatus & VS_STOPPED;
c8e21d1c5a6c (svn r5121) Add forgotten file in r5120
tron
parents:
diff changeset
    22
}
4666
850b5b6e4bac (svn r6560) - Codechange: Minor fix; add missing #include guards and comments, and correct svn properties on bmp.[ch]
peter1138
parents: 4638
diff changeset
    23
850b5b6e4bac (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 */