(post written with respect to Rubidiums post)
Ok, this solves the problem with nforenum, i.e. I have no nforenum related errors left, and assume that make now does the right thing generating the openttd.grf automatically.
However, I still run into the problem that in spritecache.cpp, function GetRawSprite, I get a SpriteCache with id 4249, type ST_NORMAL, although one with type ST_RECOLOUR is expected. I read id 4249 in the generated file objs/extra_grf/sprites/openttd.nfo (files attached below), where my table lands with that id; and placed that id in sprites.h:
Code: Select all
static const PaletteID PALETTE_ALL_BLACK = 4249;
Is this correct, or do I need some other id, if the latter, where to I get it from?
The corresponding stracktrace to my problem is:
Code: Select all
#0 GetRawSprite (sprite=4249, type=ST_RECOLOUR, allocator=0x0) at /home/wol/openttd/trunk_mhl/src/spritecache.cpp:831
#1 0x083e5e5a in GetNonSprite (sprite=4249, type=ST_RECOLOUR) at /home/wol/openttd/trunk_mhl/src/spritecache.h:47
#2 0x083e7f0d in DrawSpriteViewport (img=4493, pal=4249, x=-128, y=-320, sub=0x0) at /home/wol/openttd/trunk_mhl/src/gfx.cpp:800
#3 0x086c52bb in ViewportDrawTileSprites (tstdv=0x900f2a8 <_vd+40>) at /home/wol/openttd/trunk_mhl/src/viewport.cpp:1638
#4 0x086c5c31 in ViewportDoDraw (vp=0x91035a8, left=0, top=0, right=1244, bottom=1896) at /home/wol/openttd/trunk_mhl/src/viewport.cpp:1833
#5 0x086c6028 in ViewportDrawChk (vp=0x91035a8, left=0, top=0, right=311, bottom=474) at /home/wol/openttd/trunk_mhl/src/viewport.cpp:1898
#6 0x086c5f44 in ViewportDrawChk (vp=0x91035a8, left=0, top=0, right=623, bottom=474) at /home/wol/openttd/trunk_mhl/src/viewport.cpp:1889
#7 0x086c5ee4 in ViewportDrawChk (vp=0x91035a8, left=0, top=0, right=623, bottom=948) at /home/wol/openttd/trunk_mhl/src/viewport.cpp:1885
#8 0x086c610f in ViewportDraw (vp=0x91035a8, left=0, top=0, right=623, bottom=948) at /home/wol/openttd/trunk_mhl/src/viewport.cpp:1916
i.e. it finds out correctly that it must paint the landscape tile with an altered palette (pal = 4249 above), and then tries to load it as sprite, but unfortunately finds a normal sprite. Do I have any chance to inspect at runtime which sprite I actually get? I suspect, anything interesting is located in the void *ptr of SpriteCache, or do I have any chance to locate the input file where the sprite was defined based on the other fields? But how to inspect that void *ptr...
Or is this due to the fact that I´m probably the first one that uses a recolour sprite outside Action 5 / Type 0A, i.e. do I need some extra logic to make it work with my new Type 18?
The problem described here occurs on starting a game, I furthermore still get the message
Code: Select all
dbg: [grf] Palette sprites are missing
on loading the intro game, but I´m not sure wether this is just due to the fact that the intro game doesn´t know anything about my new sprite, or due to the problem above, or due to another problem...