From 4612dcdb48a985779f418c35f01e2fb8f6931209 Mon Sep 17 00:00:00 2001 From: dominik Date: Wed, 17 Nov 2004 18:49:55 +0000 Subject: [PATCH] (svn r662) [newgrf] Moved grfspecial.c to newgrf.c/newgrf.h --- Jamfile.next | 2 +- Makefile | 2 +- grfspecial.c => newgrf.c | 32 ++------------------------------ spritecache.c | 2 +- station_cmd.c | 2 +- ttd.dsp | 2 +- ttd.vcproj | 2 +- 7 files changed, 8 insertions(+), 36 deletions(-) rename grfspecial.c => newgrf.c (98%) diff --git a/Jamfile.next b/Jamfile.next index 1ffd777a5c..166d7deeec 100644 --- a/Jamfile.next +++ b/Jamfile.next @@ -13,7 +13,7 @@ CFILES = ai.c aircraft_cmd.c aircraft_gui.c airport_gui.c train_cmd.c train_gui.c tree_cmd.c ttd.c tunnelbridge_cmd.c unmovable_cmd.c vehicle.c viewport.c water_cmd.c widget.c window.c screenshot.c - airport.c grfspecial.c terraform_gui.c sprite.c ; + airport.c newgrf.c terraform_gui.c sprite.c ; LANGFILES = english.txt swedish.txt french.txt german.txt italian.txt slovak.txt hungarian.txt norwegian.txt danish.txt czech.txt galician.txt polish.txt romanian.txt; diff --git a/Makefile b/Makefile index 5ba7a92704..64d09b0c13 100644 --- a/Makefile +++ b/Makefile @@ -516,7 +516,7 @@ C_SOURCES = \ ai.c ai_build.c ai_new.c ai_pathfinder.c ai_shared.c aircraft_cmd.c \ aircraft_gui.c airport.c airport_gui.c aystar.c bridge_gui.c \ clear_cmd.c command.c console.c console_cmds.c disaster_cmd.c dock_gui.c dummy_land.c economy.c \ - engine.c engine_gui.c fileio.c gfx.c graph_gui.c grfspecial.c \ + engine.c engine_gui.c fileio.c gfx.c graph_gui.c newgrf.c \ industry_cmd.c industry_gui.c intro_gui.c landscape.c main_gui.c \ minilzo.c misc.c misc_cmd.c misc_gui.c music_gui.c namegen.c network.c \ network_gui.c news_gui.c oldloader.c order_cmd.c order_gui.c \ diff --git a/grfspecial.c b/newgrf.c similarity index 98% rename from grfspecial.c rename to newgrf.c index c83d7d6055..5563f8d8ed 100644 --- a/grfspecial.c +++ b/newgrf.c @@ -8,6 +8,7 @@ #include "engine.h" #include "station.h" #include "sprite.h" +#include "newgrf.h" /* TTDPatch extended GRF format codec * (c) Petr Baudis 2004 (GPL'd) @@ -23,36 +24,7 @@ extern int _replace_sprites_count[16]; extern int _replace_sprites_offset[16]; extern int _traininfo_vehicle_pitch; -struct GRFFile { - char *filename; - uint32 grfid; - uint16 flags; - uint16 sprite_offset; - struct GRFFile *next; - - /* A sprite group contains all sprites of a given vehicle (or multiple - * vehicles) when carrying given cargo. It consists of several sprite - * sets. Group ids are refered as "cargo id"s by TTDPatch - * documentation, contributing to the global confusion. - * - * A sprite set contains all sprites of a given vehicle carrying given - * cargo at a given *stage* - that is usually its load stage. Ie. you - * can have a spriteset for an empty wagon, wagon full of coal, - * half-filled wagon etc. Each spriteset contains eight sprites (one - * per direction) or four sprites if the vehicle is symmetric. */ - - int spriteset_start; - int spriteset_numsets; - int spriteset_numents; - int spriteset_feature; - - int spritegroups_count; - struct SpriteGroup *spritegroups; - - struct StationSpec stations[256]; -}; - -static struct GRFFile *_cur_grffile, *_first_grffile; +static struct GRFFile *_cur_grffile; static int _cur_spriteid; static int _cur_stage; extern int _custom_sprites_base; diff --git a/spritecache.c b/spritecache.c index 179a8d8144..8fd42ab01b 100644 --- a/spritecache.c +++ b/spritecache.c @@ -13,7 +13,7 @@ //#define WANT_LOCKED -/* These are used in grfspecial.c: */ +/* These are used in newgrf.c: */ int _skip_sprites = 0; int _replace_sprites_count[16]; diff --git a/station_cmd.c b/station_cmd.c index 9e129defd6..020489ba20 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -1122,7 +1122,7 @@ uint32 GetCustomStationRelocation(struct StationSpec *spec, struct Station *stat error("Custom station 0x%08x::0x%02x has no sprites associated.", spec->grfid, spec->localidx); - /* This is what gets subscribed of dtss->image in grfspecial.c, + /* This is what gets subscribed of dtss->image in newgrf.c, * so it's probably kinda "default offset". Try to use it as * emergency measure. */ return 0x42D; diff --git a/ttd.dsp b/ttd.dsp index 10837c2155..c421db9ec1 100644 --- a/ttd.dsp +++ b/ttd.dsp @@ -212,7 +212,7 @@ SOURCE=.\gfx.c # End Source File # Begin Source File -SOURCE=.\grfspecial.c +SOURCE=.\newgrf.c # End Source File # Begin Source File diff --git a/ttd.vcproj b/ttd.vcproj index c19df81822..abd7d7732c 100644 --- a/ttd.vcproj +++ b/ttd.vcproj @@ -419,7 +419,7 @@ + RelativePath=".\newgrf.c">