mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-20 12:09:32 +01:00
(svn r3397) - NewGRF fix: Show nfo sprite number instead of current sprite id for warning messages -- this makes this output more useful...
This commit is contained in:
parent
90aff7a026
commit
2a746ffa2d
11
newgrf.c
11
newgrf.c
@ -37,6 +37,7 @@ static GRFFile *_cur_grffile;
|
|||||||
GRFFile *_first_grffile;
|
GRFFile *_first_grffile;
|
||||||
static int _cur_spriteid;
|
static int _cur_spriteid;
|
||||||
static int _cur_stage;
|
static int _cur_stage;
|
||||||
|
static int nfo_line;
|
||||||
|
|
||||||
/* 32 * 8 = 256 flags. Apparently TTDPatch uses this many.. */
|
/* 32 * 8 = 256 flags. Apparently TTDPatch uses this many.. */
|
||||||
static uint32 _ttdpatch_flags[8];
|
static uint32 _ttdpatch_flags[8];
|
||||||
@ -114,15 +115,15 @@ static void CDECL grfmsg(grfmsg_severity severity, const char *str, ...)
|
|||||||
va_end(va);
|
va_end(va);
|
||||||
|
|
||||||
export_severity = 2 - (severity == GMS_FATAL ? 2 : severity);
|
export_severity = 2 - (severity == GMS_FATAL ? 2 : severity);
|
||||||
DEBUG(grf, export_severity) ("[%s][%s] %s", _cur_grffile->filename, severitystr[severity], buf);
|
DEBUG(grf, export_severity) ("[%s:%d][%s] %s", _cur_grffile->filename, nfo_line, severitystr[severity], buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define check_length(real, wanted, where) \
|
#define check_length(real, wanted, where) \
|
||||||
do { \
|
do { \
|
||||||
if (real < wanted) { \
|
if (real < wanted) { \
|
||||||
grfmsg(GMS_ERROR, "%s/%d: Invalid special sprite length %d (expected %d)!", \
|
grfmsg(GMS_ERROR, "%s: Invalid special sprite length %d (expected %d)!", \
|
||||||
where, _cur_spriteid - _cur_grffile->sprite_offset, real, wanted); \
|
where, real, wanted); \
|
||||||
return; \
|
return; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
@ -1374,6 +1375,7 @@ static void NewSpriteSet(byte *buf, int len)
|
|||||||
|
|
||||||
for (i = 0; i < num_sets * num_ents; i++) {
|
for (i = 0; i < num_sets * num_ents; i++) {
|
||||||
LoadNextSprite(_cur_spriteid++, _file_index);
|
LoadNextSprite(_cur_spriteid++, _file_index);
|
||||||
|
nfo_line++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2099,6 +2101,7 @@ static void SpriteReplace(byte *buf, int len)
|
|||||||
|
|
||||||
for (j = 0; j < num_sprites; j++) {
|
for (j = 0; j < num_sprites; j++) {
|
||||||
LoadNextSprite(first_sprite + j, _file_index); // XXX
|
LoadNextSprite(first_sprite + j, _file_index); // XXX
|
||||||
|
nfo_line++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2647,9 +2650,11 @@ static void LoadNewGRFFile(const char* filename, uint file_index, uint stage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
_skip_sprites = 0; // XXX
|
_skip_sprites = 0; // XXX
|
||||||
|
nfo_line = 0;
|
||||||
|
|
||||||
while ((num = FioReadWord()) != 0) {
|
while ((num = FioReadWord()) != 0) {
|
||||||
byte type = FioReadByte();
|
byte type = FioReadByte();
|
||||||
|
nfo_line++;
|
||||||
|
|
||||||
if (type == 0xFF) {
|
if (type == 0xFF) {
|
||||||
if (_skip_sprites == 0) {
|
if (_skip_sprites == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user