Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000012 [DCSS] FR: Other minor N/A 2009-11-22 10:03 2009-11-23 02:10
Reporter Matthew Cline View Status public  
Assigned To Matthew Cline
Priority normal Resolution done  
Status closed   Product Branch
Summary 0000012: tiles: Don't assert in tildef-*.cc on missing tiles
Description Tiles is currently asserting in tile_gui_info() when trying to display the tiles for some of the new spells because the don't have tiles defined for them yet. I'm new to the tiles code, so maybe I'm missing something, but it seems like it'd be better to return an "error" or "todo" tile in cases like that, rather than have the game crash due to an assertion.
Additional Information
Tags tiles
Attached Files

- Relationships

-  Notes
(0000019)
jpeg (manager)
2009-11-22 12:38

Yes, what you want is TILEG_TODO. There should even be some examples in tileidx_spell().

Thanks for taking this up, Matthew!
(0000021)
jpeg (manager)
2009-11-22 13:13

Assigning to you as you're apparently already working on this. (And so I can test Mantis some more. :))

Just add the new spells into the switch block (makes it easier to see what's still missing than using default) and return TILEG_TODO.

Again, thanks!
(0000023)
Matthew Cline (developer)
2009-11-22 13:41

Wouldn't it be better to change rltiles/tool/tile_list_processor.cc so that that the various functions in tiledef-*.cc will return the appropriate TODO tile (instead of asserting), rather than changing the various tileidx_foo() functions? Then no one will have to remember to insert placeholders into tileidx_foo() to prevent assertions.
(0000024)
jpeg (manager)
2009-11-22 22:42

Do you mean that already during compilation the png files should be filled with TODO tiles for all spells/monsters/... not covered elsewhere? (Offhand, I've no idea how to do that, but I guess that the tiledef-unrand files go in the right direction. Unfortunately, those are created by a perl skript rather than the tiles tools, precisely because I couldn't work out how to make that work...)

As a quick solution, we could add the "default: return TODO" to all tileidx methods after all.

What I'd really like is if during Tiles compilation (or rather creation of the png files) there was a warning for all missing tiles. You are completely right that we should not use ASSERTs for this purpose.
(0000027)
Matthew Cline (developer)
2009-11-23 02:08

Turns out the assertions where caused by tileidx_spell() returning TILE_ERROR instead of TILEG_ERROR. I fixed that, and also added TODO placeholders for the new spells.

Hmmm, there doesn't seem to be any "resolution" field: fixed vs invalid vs duplicate, etc.
(0000028)
Matthew Cline (developer)
2009-11-23 02:10

Oh, here's how you close a bug.

- Issue History
Date Modified Username Field Change
2009-11-22 10:03 Matthew Cline New Issue
2009-11-22 10:03 Matthew Cline Test Custom Field => Foo
2009-11-22 12:38 jpeg Note Added: 0000019
2009-11-22 13:06 jpeg Tag Attached: tiles
2009-11-22 13:13 jpeg Note Added: 0000021
2009-11-22 13:13 jpeg Assigned To => Matthew Cline
2009-11-22 13:13 jpeg Status new => assigned
2009-11-22 13:41 Matthew Cline Note Added: 0000023
2009-11-22 22:42 jpeg Note Added: 0000024
2009-11-23 02:08 Matthew Cline Note Added: 0000027
2009-11-23 02:10 Matthew Cline Note Added: 0000028
2009-11-23 02:10 Matthew Cline Status assigned => closed
2009-11-23 02:10 Matthew Cline Resolution open => done
2009-11-23 02:10 Matthew Cline Fixed in Branch => 0.6 development branch


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker