# HG changeset patch # User darkvater # Date 1100450528 0 # Node ID 415546028e8d8e1496fab1b2e656c444aac9cf88 # Parent 2ac785874b332127529bf103ae4dfc5a58675f1a (svn r602) -newgrf: Move DrawTileSeqStruct & co and struct SpriteGroup to sprite.h (pasky) diff -r 2ac785874b33 -r 415546028e8d engine.c --- a/engine.c Sun Nov 14 16:13:43 2004 +0000 +++ b/engine.c Sun Nov 14 16:42:08 2004 +0000 @@ -7,6 +7,7 @@ #include "vehicle.h" #include "news.h" #include "saveload.h" +#include "sprite.h" #define UPDATE_PLAYER_RAILTYPE(e,p) if ((byte)(e->railtype + 1) > p->max_railtype) p->max_railtype = e->railtype + 1; diff -r 2ac785874b33 -r 415546028e8d engine.h --- a/engine.h Sun Nov 14 16:13:43 2004 +0000 +++ b/engine.h Sun Nov 14 16:42:08 2004 +0000 @@ -1,6 +1,8 @@ #ifndef ENGINE_H #define ENGINE_H +#include "sprite.h" + typedef struct RailVehicleInfo { byte image_index; byte flags; /* 1=multihead engine, 2=wagon */ @@ -80,24 +82,6 @@ void StartupEngines(); -struct SpriteGroup { - // XXX: Would anyone ever need more than 16 spritesets? Maybe we should - // use even less, now we take whole 8kb for custom sprites table, oh my! - byte sprites_per_set; // means number of directions - 4 or 8 - - // Loaded = in motion, loading = not moving - // Each group contains several spritesets, for various loading stages - - // XXX: For stations the meaning is different - loaded is for stations - // with small amount of cargo whilst loading is for stations with a lot - // of da stuff. - - byte loaded_count; - uint16 loaded[16]; // sprite ids - byte loading_count; - uint16 loading[16]; // sprite ids -}; - extern byte _global_cargo_id[NUM_LANDSCAPE][NUM_CARGO]; enum { CID_DEFAULT = 29, @@ -173,4 +157,5 @@ #define ship_vehicle_info(e) _ship_vehicle_info[e - SHIP_ENGINES_INDEX] #define aircraft_vehinfo(e) _aircraft_vehicle_info[e - AIRCRAFT_ENGINES_INDEX] #define road_vehicle_info(e) (&_road_vehicle_info[e - ROAD_ENGINES_INDEX]) + #endif diff -r 2ac785874b33 -r 415546028e8d grfspecial.c --- a/grfspecial.c Sun Nov 14 16:13:43 2004 +0000 +++ b/grfspecial.c Sun Nov 14 16:42:08 2004 +0000 @@ -7,6 +7,7 @@ #include "fileio.h" #include "engine.h" #include "station.h" +#include "sprite.h" /* TTDPatch extended GRF format codec * (c) Petr Baudis 2004 (GPL'd) diff -r 2ac785874b33 -r 415546028e8d rail_cmd.c --- a/rail_cmd.c Sun Nov 14 16:13:43 2004 +0000 +++ b/rail_cmd.c Sun Nov 14 16:42:08 2004 +0000 @@ -7,6 +7,7 @@ #include "town.h" #include "sound.h" #include "station.h" +#include "sprite.h" void ShowTrainDepotWindow(uint tile); diff -r 2ac785874b33 -r 415546028e8d sprite.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sprite.h Sun Nov 14 16:42:08 2004 +0000 @@ -0,0 +1,46 @@ +#ifndef SPRITE_H +#define SPRITE_H + + +/* The following describes bunch of sprites to be drawn together in a single 3D + * bounding box. Used especially for various multi-sprite buildings (like + * depots or stations): */ + +typedef struct DrawTileSeqStruct { + int8 delta_x; + int8 delta_y; + int8 delta_z; + byte width,height; + byte unk; // 'depth', just z-size; TODO: rename + uint32 image; +} DrawTileSeqStruct; + +typedef struct DrawTileSprites { + SpriteID ground_sprite; + DrawTileSeqStruct const *seq; +} DrawTileSprites; + +#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) + + +/* This is for custom sprites: */ + +struct SpriteGroup { + // XXX: Would anyone ever need more than 16 spritesets? Maybe we should + // use even less, now we take whole 8kb for custom sprites table, oh my! + byte sprites_per_set; // means number of directions - 4 or 8 + + // Loaded = in motion, loading = not moving + // Each group contains several spritesets, for various loading stages + + // XXX: For stations the meaning is different - loaded is for stations + // with small amount of cargo whilst loading is for stations with a lot + // of da stuff. + + byte loaded_count; + uint16 loaded[16]; // sprite ids + byte loading_count; + uint16 loading[16]; // sprite ids +}; + +#endif diff -r 2ac785874b33 -r 415546028e8d station.h --- a/station.h Sun Nov 14 16:13:43 2004 +0000 +++ b/station.h Sun Nov 14 16:42:08 2004 +0000 @@ -1,7 +1,7 @@ #ifndef STATION_H #define STATION_H -#include "engine.h" +#include "sprite.h" #include "vehicle.h" typedef struct GoodsEntry { @@ -93,23 +93,6 @@ uint GetStationPlatforms(Station *st, uint tile); -typedef struct DrawTileSeqStruct { - int8 delta_x; - int8 delta_y; - int8 delta_z; - byte width,height; - byte unk; // 'depth', just z-size; TODO: rename - uint32 image; -} DrawTileSeqStruct; - -typedef struct DrawTileSprites { - SpriteID ground_sprite; - DrawTileSeqStruct const *seq; -} DrawTileSprites; - -#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) - - struct StationSpec { uint32 grfid; int localidx; // per-GRFFile station index + 1; SetCustomStation() takes care of this diff -r 2ac785874b33 -r 415546028e8d station_cmd.c --- a/station_cmd.c Sun Nov 14 16:13:43 2004 +0000 +++ b/station_cmd.c Sun Nov 14 16:42:08 2004 +0000 @@ -12,6 +12,7 @@ #include "economy.h" #include "player.h" #include "airport.h" +#include "sprite.h" #include "table/directions.h" // FIXME -- need to be embedded into Airport variable. Is dynamically diff -r 2ac785874b33 -r 415546028e8d ttd.vcproj --- a/ttd.vcproj Sun Nov 14 16:13:43 2004 +0000 +++ b/ttd.vcproj Sun Nov 14 16:42:08 2004 +0000 @@ -1160,6 +1160,9 @@ RelativePath="sound.h"> + +