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"> 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">
MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000303VCMIGUI - Otherpublic2009-12-11 10:322010-07-14 10:00
ReporterIvan 
Assigned ToIvan 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version0.75 
Target VersionFixed in Version0.8 
Summary0000303: Linux case-sensitivity cause problem with hi-res graphics
DescriptionRecently 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.
TagsNo tags attached.
Attached Filesdiff file icon filenames.diff [^] (1,597 bytes) 2009-12-11 20:40 [Show Content]

- Relationships

-  Notes
(0000390)
Ivan (developer)
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 (developer)
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 (developer)
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 (developer)
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 (developer)
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 (developer)
2009-12-29 15:56

Should be fixed in 1404
(0001121)
Zamolxis (viewer)
2010-07-14 10:00

Closing. Pls reopen if it reoccurs.

- Issue History
Date Modified Username Field Change
2009-12-11 10:32 Ivan New Issue
2009-12-11 20:40 Ivan File Added: filenames.diff
2009-12-11 20:40 Ivan Note Added: 0000390
2009-12-19 01:41 Tow Note Added: 0000394
2009-12-19 12:08 Ivan Note Added: 0000395
2009-12-19 12:09 Ivan Note Edited: 0000395 View Revisions
2009-12-23 02:51 Tow Note Added: 0000477
2009-12-23 17:51 Ivan Note Added: 0000478
2009-12-29 15:56 Ivan Note Added: 0000523
2009-12-29 15:56 Ivan Status new => resolved
2009-12-29 15:56 Ivan Fixed in Version => 0.89
2009-12-29 15:56 Ivan Resolution open => fixed
2009-12-29 15:56 Ivan Assigned To => Ivan
2010-05-29 22:12 Zamolxis Product Version => 0.75
2010-07-14 10:00 Zamolxis Note Added: 0001121
2010-07-14 10:00 Zamolxis Status resolved => closed

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean