#3455 closed defect (fixed)
WINCE: Save games have incorrect time & date
Reported by: | spookypeanut | Owned by: | SF/knakos |
---|---|---|---|
Priority: | blocker | Component: | Port: WinCE |
Version: | Keywords: | ||
Cc: | Game: |
Description
When saving and reloading games, the saved date and time are very wrong. For example, the saved game attached below (written with svn) from COMI claims it was written in the year 3888. Which it wasn't. This doesn't only happen in COMI: I've also noticed it in MI2 (tho i haven't tested that with svn, and usually with MI2 it claims they were written in 1900). If needed, I can test other games (if I have them).
Ticket imported from: #1834822. Ticket imported from: bugs/3455.
Attachments (1)
Change History (12)
by , 17 years ago
comment:1 by , 17 years ago
Owner: | set to |
---|
comment:2 by , 17 years ago
"claims it was written in the year 3888. Which it wasn't."
Now how can you be sure it wasn't? :-P
Well, I'll take a look at it. :-)
comment:3 by , 17 years ago
Component: | → --Unset-- |
---|---|
Priority: | normal → blocker |
comment:5 by , 17 years ago
Could it be that the localtime / time implementations in missing.cpp are flawed?
I really think missing.cpp should be cleared up. I recommend removing everything in it, then only re-adding what is actually needed. And then fixing those (e.g. strichr there is very bad, slow and can cause stack overwrites; so is strrchr, and I already talked about bsearch and strpbrk in another bug report...)
comment:6 by , 17 years ago
Yes, that's my guess too.
About missing.cpp: It is a graveyard of semi-dead and certainly inefficient/kludged code, which is still used actively. This has evolved from all the different compilers we have used. Not much of it can go away (we still need to include some functions to help compiling on microsoft tools, so that non-ARM cpu builds can potentially be done, such as this http://forums.scummvm.org/viewtopic.php?t=4459 ). I will put some effort to optimize and clear away that mess, sure.
comment:7 by , 17 years ago
The bug is clearly in time(), which should do this, but doesn't:
"The time() function returns the value of time in seconds since 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal Time, without including leap seconds. "
However, in the "newer" SCUMM saveformat (header version 2, see engines/scumm/saveload.cpp), this shouldn't really matter, as long as "time+localtime" together return the correct results...
comment:8 by , 17 years ago
See also patch #1859448, which adds OSystem::getTimeAndDate. Knakos, that might be interesting to you in this context.
comment:9 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:11 by , 6 years ago
Component: | --Unset-- → Port: WinCE |
---|
save game with date way in the future