[Scummvm-devel] Redraw problems

Sam Kenny SamKenny at cit.com.au
Mon Dec 3 18:45:04 CET 2001


Hi all,

While playing around with the Sam N Max demo, and looking at some of the
redraw wierdness at the intro (in the SDL version), I think I've found a
couple of the solutions, but I'm not sure of any side effects they might
have. Sam N Max at least appears to look really nice now.

The first one is that drawBox doesn't seem to handle a color of -1 at all
(which I think should be transparent), so I added some code to draw the
current background instead (I think this is what happens in Sam N Max at
least).

The second appears to be a problem with where strings are drawn, around line
726 of string.cpp
	_bg_ptr2 = _backbuff_ptr = _vm->getResourceAddress(rtBuffer,
vs->number+1) 
		+ vs->xstart + _drawTop * 320 + _left;

#if !defined(OLD)
	if (_blitAlso) {
#else
	if (1) {
#endif
		_bg_ptr2 = _bgbak_ptr = _vm->getResourceAddress(rtBuffer,
vs->number+5)
			+ vs->xstart + _drawTop * 320 + _left;

I think the second bg_ptr2 means that text will be copied to the background
instead of the backbuffer. Printing to the backBuffer and changing the order
of some operations seems to clear this up.

Anyway, attached is the diff (there is also a fix for a uninitialized
variable in resource.cpp that I think just slipped through).

Cheers,

Sam
(sam_k at users.sourceforge.net)


 
 <<diffs.txt>>  

begin 600 diffs.txt
M9&EF9B`M=2!D.EQ#5E-0<F]J96-T<UQS8W5M;79M7')E<V]U<F-E+F-P<"!D
M.EQ#5E-0<F]J96-T<UQS8W5M;79M6%QR97-O=7)C92YC<'`-"BTM+2!D.EQ#
M5E-0<F]J96-T<UQS8W5M;79M7')E<V]U<F-E+F-P<`E-;VX at 1&5C(#`S(#(R
M.C0R.C0P(#(P,#$-"BLK*R!D.EQ#5E-0<F]J96-T<UQS8W5M;79M6%QR97-O
M=7)C92YC<'`)5'5E($1E8R`P-"`Q,SHQ,3HR,R`R,#`Q#0I`0"`M-#<R+#<@
M*S0W,BPW($!`#0H@(VEF(&1E9FEN960H4T%-3DU!6"D@?'P at 9&5F:6YE9"A&
M54Q,7U1(4D]45$Q%*0T*(`EI9B`H8F%S971A9R`]/2!-2TE$*"=-241))RDI
M('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O=7)C94%D9')E<W,H<G1"=69F97(L
M('9S+3YN=6UB97(K-2D-"BL)"5]B9V)A:U]P='(@/2!?=FTM/F=E=%)E<V]U
M<F-E061D<F5S<RAR=$)U9F9E<BP@=G,M/FYU;6)E<BLU*0T*(`D)"2L@=G,M
M/GAS=&%R="`K(%]D<F%W5&]P("H@,S(P("L at 7VQE9G0[#0H@"7T-"B`-"D!`
M("TW-#0L,3(@*S<T-"PQ,B!`0`T*(`E?=FER=%-C<F5E;DAE:6=H="`]('9S
M+3YH96EG:'0[#0H@"5]C:&%R4'1R("L](#0[#0H@#0HM"61R87=":71S*"D[
M#0HM#0H@(VEF("%D969I;F5D*$],1"D-"B`):68@*%]B;&ET06QS;RD-"B`)
M"6)L:70H7V)A8VMB=69F7W!T<BP at 7V)G8F%K7W!T<BP at 7W=I9'1H+"!?:&5I
M9VAT*3L-"B`C96YD:68-"BL-"BL)9')A=T)I=',H*3L-"B`-"B`)7VQE9G0@
G*ST at 7W=I9'1H.PT*(`EI9B`H7VQE9G0@(#X at 7W-T<E)I9VAT*0T*
`
end




More information about the Scummvm-devel mailing list