SRL Archive - Help and Support

Debug window help


Sumilion

2006-08-14 08:34:52

Heya,
I'm busy with learning, so that means experimenting… Im now trying to do something ( its a secret ;) ) with a debug window… Only i got myself into trouble again :rolleyes: . Here is the thing, i use SafeDrawBitmap to draw a bitmap around 3000 times in the debug window (its 1,1) that goes just fine and then i stop the script, meaning it doesnt do anything anymore :cool:. But when i try to do it again, with other places for the bmp, it will still work, but the old ones are still there aswell. So the two debug windows are merged :confused: . (in case you want to know, i did closed the debug window between resetting). It only really works when i close the scrip and open it again. But i really would like it to work normal… I'm kinda hoping there was a function like FreeDebugWindow or something… cause something like redo the entire thing but then with a black bmp, doesnt sound like a good solution to me.

Dankness

2006-08-15 19:51:56

I dont belive theres a free debug window canvas but you could do a simple



procedure FreeDebug;
var BMP1 : Integer;
begin
BMP1 := bitmapfromstring ( 1,1, '');
Wait(1);
GetBitMapCanvas ( BMP1 );
FreeBMP ( BMP1 );
end;


or somehting like that to do it…

Sumilion

2006-08-16 05:20:03

erm, thnx, but i don't know if i was meant to change the BMP1, but the procedure doesnt work when i dont…. And i think you mean FreeBitmap instead of FreeBMP. But thnx anyway:cool:

inferno

2006-08-16 05:37:33

I'm not sure I understand what you're saying but this seems to work fine for me:

Program New;

Var
Buffer, I : Integer;

Begin
DisplayDebugImgWindow(100, 100);
Buffer := BitmapFromString(100, 100, '');
FastDrawClear(Buffer, ClBtnFace);
For I := 0 To 3000 Do
Begin
FastDrawTransparent(50, 50, BitmapName, Buffer);
SafeDrawBitmap(Buffer, GetDebugCanvas, 0, 0);
End;
End.

Sumilion

2006-08-16 06:49:26

Thnx a lot inferno! That did it for me :D

Edit : @ Dankness, it might be handy to have some procedure like this in srl, im shocked it wasn't even in scar itself…

tarajunky

2006-08-16 12:29:42

We definitely need a debug window tutorial. :)