Savegame Loading issues

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.
Post Reply
User avatar
DinkyDyeAussie
Posts: 260
Joined: Fri Feb 10, 2012 10:39 am
Location: Australia

Savegame Loading issues

Post by DinkyDyeAussie »

I've been testing the latest trunk release and save games won't load from the menu screen still, and even when running it in debug mode, it crashes on the 2nd orc expasion mission when I build a hall next to the gold mine in the upper left hand corner, I don't know what happens, but every time I go to select something in that spot it crashes.
User avatar
DinkyDyeAussie
Posts: 260
Joined: Fri Feb 10, 2012 10:39 am
Location: Australia

Re: Savegame Loading issues

Post by DinkyDyeAussie »

OK so I managed to get it to debug. Apparently there's an error in icons.cpp???

All that came up was this.

Code: Select all

void CIcon::DrawGrayscaleIcon(const PixelPos &pos) const
{
	SDL_LockSurface(this->G->Surface);
	SDL_Color colors[256], backup[256];
	SDL_Palette &pal = *this->G->Surface->format->palette;
   memcpy(backup, pal.colors, sizeof(SDL_Color) * 256);  <<<---
	for (int i = 0; i < 256; ++i) {
		int gray = 0.2 * pal.colors[i].r + 0.4 * pal.colors[i].g + 0.12 * pal.colors[i].b;
		colors[i].r = colors[i].g = colors[i].b = gray;
The line with the arrows is on line 147 of the icons.cpp file and was at the very top of the call stack if that helps.
User avatar
jarod42
Posts: 101
Joined: Fri Jan 20, 2012 7:43 pm

Re: Savegame Loading issues

Post by jarod42 »

I cannot reproduce bug (stratagus rev 8535, wargus rev 1677).

and normally, DrawGrayscaleIcon is not called for wargus.

Can you send the problematic saveGame ?
User avatar
DinkyDyeAussie
Posts: 260
Joined: Fri Feb 10, 2012 10:39 am
Location: Australia

Re: Savegame Loading issues

Post by DinkyDyeAussie »

Sure things Jarod :)
game.sav.gz
(67.55 KiB) Downloaded 439 times
User avatar
DinkyDyeAussie
Posts: 260
Joined: Fri Feb 10, 2012 10:39 am
Location: Australia

Re: Savegame Loading issues

Post by DinkyDyeAussie »

PLayed through again and I think it may have something to do with the selection of multiple units maybe, as everytime I go to select and click and drag the mouse it boots me out...

maybe thats it... I'd have to test it in other maps though.
User avatar
jarod42
Posts: 101
Joined: Fri Jan 20, 2012 7:43 pm

Re: Savegame Loading issues

Post by jarod42 »

I still can't reproduce any error :-/

Do you have a replay (.log) which exhibit the problem ?

Do you have some customization (in code or lua) ?
As I said, DrawGrayscaleIcon is not called for wargus (without lua modifications).
Post Reply