Page 1 of 1

My PPC Mac build hangs at Texman.Init

Posted: Mon Jan 21, 2013 4:58 am
by texman_init
I built the Zandronum 1.1 alpha on a PPC Mac under Tiger but when I run it, it stays at "Texman.Init: Init texture manager." for eternity. Whee.

Can anything be done or is it hopeless?

RE: My PPC Mac build hangs at Texman.Init

Posted: Mon Jan 21, 2013 5:28 am
by Blzut3

RE: My PPC Mac build hangs at Texman.Init

Posted: Mon Jan 21, 2013 3:12 pm
by texman_init
Nope.

I did some poking around and found the problem.

Open up pngtexture.cpp and go to FPNGTexture::FPNGTexture. See where it says while(id != MAKE_ID('I','D','A','T') && id != MAKE_ID('I','E','N','D'))?

THAT'S SUPPOSED BE AN IF STATEMENT.

Now my Zandronum build doesn't get stuck in an endless loop at texman init. The framerate may suck at high res, the SFX don't play(wtf), and it keeps showing malloc errors in the terminal, but it's playable.

I'd kind of like the SFX to work, though. Any hints there?

RE: My PPC Mac build hangs at Texman.Init

Posted: Mon Jan 21, 2013 6:36 pm
by Torr Samaho
texman_init wrote: Open up pngtexture.cpp and go to FPNGTexture::FPNGTexture. See where it says while(id != MAKE_ID('I','D','A','T') && id != MAKE_ID('I','E','N','D'))?

THAT'S SUPPOSED BE AN IF STATEMENT.
What makes you think so? id is updated inside the while loop.

RE: My PPC Mac build hangs at Texman.Init

Posted: Mon Jan 21, 2013 6:42 pm
by Blzut3
texman_init wrote: THAT'S SUPPOSED BE AN IF STATEMENT.
Actually it's supposed to be loop. It's parsing all the chunks in the PNG until it hits the image data (or end of the PNG). Look at the end of the loop and you'll see that id changes. The latest version of ZDoom has this at the end:

Code: Select all

		lump.Seek(4, SEEK_CUR);		// Skip CRC
		lump.Read(&len, 4);
		id = MAKE_ID('I','E','N','D');
		lump.Read(&id, 4);
Which doesn't byte swap the id (since MAKE_ID handles endianness). You'll need to hunt down all of the big endian fixes in the latest ZDoom in order to get PPC builds to work properly.

Like I said in the post linked, there are a ton of Mac/Linux support improvements in ZDoom, so be sure to look at the differences there. To make things more difficult, there are some rewrites between 2.3.1 (which Zandronum is based off) and when Mac OS X was supported.