MantisBT - VCMI
View Issue Details
0000303VCMIGUI - Otherpublic2009-12-11 10:322010-07-14 10:00
Ivan 
Ivan 
normalcrashalways
closedfixed 
0.75 
0.8 
0000303: Linux case-sensitivity cause problem with hi-res graphics
Recently installed Ubuntu 9.10 and found this problems when running VCMI natively:

1)folder "sprites" should be renamed to "Sprites"


2)All extra graphics (hi-res adventure map as well as new stack queue) works only when names are in upper-case. Modifying settings.txt doesn't solve the problem:

real filename is "AdvMap3.pcx" - mixed upper\lower case

config.txt has "background=AdvMap3.pcx" - mixed upper\lower case

Client log after crash says "Cannot open ADVMAP3.PCX" - only upper case now


I've renamed all problematic files but main problem is still here - VCMI on Linux can use graphics only in upper-case.
No tags attached.
diff filenames.diff (1,597) 2009-12-11 20:40
https://bugs.vcmi.eu/file_download.php?file_id=173&type=bug
Issue History
2009-12-11 10:32IvanNew Issue
2009-12-11 20:40IvanFile Added: filenames.diff
2009-12-11 20:40IvanNote Added: 0000390
2009-12-19 01:41TowNote Added: 0000394
2009-12-19 12:08IvanNote Added: 0000395
2009-12-19 12:09IvanNote Edited: 0000395bug_revision_view_page.php?bugnote_id=395#r448
2009-12-23 02:51TowNote Added: 0000477
2009-12-23 17:51IvanNote Added: 0000478
2009-12-29 15:56IvanNote Added: 0000523
2009-12-29 15:56IvanStatusnew => resolved
2009-12-29 15:56IvanFixed in Version => 0.89
2009-12-29 15:56IvanResolutionopen => fixed
2009-12-29 15:56IvanAssigned To => Ivan
2010-05-29 22:12ZamolxisProduct Version => 0.75
2010-07-14 10:00ZamolxisNote Added: 0001121
2010-07-14 10:00ZamolxisStatusresolved => closed

Notes
(0000390)
Ivan   
2009-12-11 20:40   
I think I 've fixed this one myself - now VCMI works with lower-case names as well.
I've uploaded .diff file. Everything works fine for me but check it before usage
(0000394)
Tow   
2009-12-19 01:41   
Is this a complete patch?
You introduce a filename variable which is twice assigned but never used.
You also cut code trying different (PCX/BMP) extensions. It is for a reason - files with .bmp extension in Data/ can overwrite .pcx from .lod archive (and vice-verse).
Standard H3 bitmaps in h3bitmap.lod use .pcx extension and VCMI normalises names of all found bitmaps by changing their extension to PCX to make name comparing possible (so that AAA.bmp and AAA.pcx are the same name). But after that we can't tell what original extension was and we must try them both.

The solution for case-sensitivity problem would be probably to keep original filenames in lodhandler Entry (along with normalised name for comparing).
(0000395)
Ivan   
2009-12-19 12:08   
(edited on: 2009-12-19 12:09)
that string variable used to backup filename before normalizing - so we still can restore it (otherwise we need to check presence of .bmp .BMP .pcx .PCX ... )

VCMI still can load bitmaps and pcx - as long as we received correct name.
>> You introduce a filename variable which is twice assigned but never used.
strange - there are two lines where it was one time assigned and one time used:
std::string filename=fname;//backuping original filename
(3 lines here)
fname=filename;//restoring it

And to make sure that I didn't messed up with .diff:
http://pastebin.com/m4ebd3dea [^]

(0000477)
Tow   
2009-12-23 02:51   
>>strange - there are two lines where it was one time assigned and one time used
You're right, I've misread. Sorry.

>>VCMI still can load bitmaps and pcx - as long as we received correct name.
We can't assume that function has received exact name. Given name may be sth.pcx and we may want to replace that file by putting sth.bmp to the Data folder.
In such scenario your patch brokes expected behaviour.

The only solution that fully fixes the issue and keeps original H3 behaviour is adding a new field "string originalName" to the Entry class and set it during the Data folder scanning.
(0000478)
Ivan   
2009-12-23 17:51   
>>The only solution that fully fixes the issue and keeps original H3 behaviour is adding a new field "string originalName" to the Entry class and set it during the Data folder scanning.

Ok. I've made patch in this way. Will apply when I'll have some more fixes as well.
(0000523)
Ivan   
2009-12-29 15:56   
Should be fixed in 1404
(0001121)
Zamolxis   
2010-07-14 10:00   
Closing. Pls reopen if it reoccurs.