Page 3 of 3

Re: FastImageOutput

Posted: Mon Jul 26, 2010 10:32 am
by Michael Vogel
Hm,
I just took an old code (Trax and tried to compile it under 4.50. When starting the exe, I get an invalid memory access (read error at address 48), which was not here with PB4.31. I will check my code if I can bring up a small snippet demonstrating the problem, but maybe there are some hints what could got wrong?!

Thanks,
Michael

Code: Select all

		CopyImage(#ClrBoard,#FixBoard)
		FixBoard=ImageID(#FixBoard)

		Debug FixBoard;				67439849
		Debug ImageWidth(#FixBoard);		440
		Debug ImageHeight(#FixBoard);		420
		Debug ImageDepth(#FixBoard);		24
		
		StartDrawing(FastImageOutput(#FixBoard))

Re: FastImageOutput

Posted: Mon Jul 26, 2010 11:22 am
by Fred
FastImageOutput() is broken with 4.50 as it relies on internal structure which is plain hacking and not supported. Just use the standard ImageOutput() and it should be fast as well.

Re: FastImageOutput

Posted: Mon Jul 26, 2010 4:03 pm
by Michael Vogel
Fred wrote:FastImageOutput() is broken with 4.50 as it relies on internal structure which is plain hacking and not supported. Just use the standard ImageOutput() and it should be fast as well.
Thanks for the information, changed the code...

Code: Select all

CompilerIf #PB_Compiler_Version>431

	Macro FastImageOutput(a)
		ImageOutput(a)
	EndMacro

CompilerElse

	Procedure ___ReleaseFastImageOutput()
	Procedure ___StopDirectAccess()
	Procedure ___StartDirectAccess()
	Procedure FastImageOutput(Image)

CompilerEndif