SRL Archive - Help

Show debugatpa bound within smart


Main

2011-10-09 23:42:29

In MSI, they show debugatpa/tpa bounds within smart instead of making a popup. How could I do that ?

Harry

2011-10-10 00:03:48

drawdotsmulti(true,atpa);

Look for that in https://github.com/SRL/MSI/blob/master/MSI/Core/Objects.simba .

Main

2011-10-10 00:13:53

damn, looks like hax:( I'll try to learn it.

bevardis

2011-10-10 12:57:17

Look through msi code, I guess that could help.

Yago

2011-10-10 12:59:01

I think the file is something like smart paint or paintsmart

masterBB

2011-10-10 15:51:03

Srl/SRL/misc/paintsmart.scar

Coh3n

2011-10-10 16:45:17

It's actually pretty simple. :) Here's a test script that will help.

program new;
{$DEFINE SMART}
{$i srl/srl.scar}
{$i srl/srl/misc/paintsmart.scar}

var
tpa: TPointArray;
i, t: integer;
begin
smart_Server := 152;
smart_Members := False;
smart_Signed := True;
smart_SuperDetail := False;

setupSRL;
clearDebug;

SMART_SetupDebug();
clearRSCanvas(SMART_Canvas.canvas);

setLength(tpa, 50000);
for i := 0 to high(tpa) do
begin
tpa[i].x := randomRange(0, MIX2);
tpa[i].y := randomRange(0, MIY2);
end;

t := (getSystemTime + 10000);
while (getSystemTime < t) do
smart_DrawDots(tpa);
end.

masterBB

2011-10-10 17:39:20

From: Coh3n
blabla Will help!

setLength(tpa, 50000);
for i := 0 to high(tpa) do
begin
tpa[i].x := randomRange(0, MIX2);
tpa[i].y := randomRange(0, MIY2);
end;

t := (getSystemTime + 10000);
while (getSystemTime < t) do
smart_DrawDots(tpa);
end.


What the hell. You create a tpa with 50000 points. Draws them on stage and then removes them. Repeat that last step for 10 seconds.

Seems like a solid cpu toaster, but why?

Nava2

2011-10-10 20:49:21

The removal part is quick, 50K dots is excessive lol. you'd be better to draw shapes that you could see and have less dots.

But a TPA can be a massive number too, remember that ;).

Main

2011-10-10 20:54:00

all of yall thanks a ton!:P

Coh3n

2011-10-10 20:58:50

That test script is just supposed to show it working, it doesn't actually accomplish anything.

Main

2011-10-10 21:16:26

I could see it drawing some small red bits on my screen with my cwer ^^. So its working atleast:P

But could you post a sample script on how to make it should atpa bounds?

Coh3n

2011-10-10 21:29:09

From: Main
I could see it drawing some small red bits on my screen with my cwer ^^. So its working atleast:P

But could you post a sample script on how to make it should atpa bounds?
If you call SMART_DrawDots it only draws the TPA, the bounds should be easily seen, unless I'm missing something?

Instead of calling DebugATPA, call SMART_DrawDotsMulti.

Main

2011-10-10 21:34:34

What are the variables for SMART_DrawDotsMulti? I couldn't find it on paintsmart.scar

I also see SMART_DrawDotsEx ,but its still tpa:( I'll try to look for more:P

Coh3n

2011-10-10 21:36:59

Oh sorry, it's just DrawDotsMulti. There's no SMART prefix.

Main

2011-10-10 21:48:46

I see the colored regions now:P Is it suppose to show labeled bounds? Or I'd have to do that my self with tbox?

Coh3n

2011-10-10 22:27:56

From: Main
I see the colored regions now:P Is it suppose to show labeled bounds? Or I'd have to do that my self with tbox?
I'm nto sure what you mean. Do you want boxes around the TPA bounds? If so, you can do:

for i := 0 to high(ATPA) do
SMART_DrawBoxEx(false, getTPABounds(ATPA[i]), clGreen);

Main

2011-10-10 22:32:54

I just want something like DebugATPABounds:

I'll try that the code you posted:P

Coh3n

2011-10-10 22:35:24

Oh, yeah the actual labeled boxes like that is different. As far as I know there aren't any SMART methods for that; however, I'm sure DebugATPABounds could easily be converted to work on the SMART canvas.

Main

2011-10-10 22:38:29

That'd be great if we could have that for the future, for now.. thanks for showing me the box and draw dots!… and harry too:p

masterBB

2011-10-11 01:07:58

SMART_DrawBoxEx(true,GetTPABounds(YourTPA),clRed);

or

SMART_DrawBoxEx(true,GetATPABounds(YourATPA),clRed);

or

for(var i := 0; i < High(YourATPA); inc(i)) do
SMART_DrawBoxEx(true,GetTPABounds(YourATPA),clRed);

Coh3n

2011-10-11 01:43:29

From: masterBB
for(var i := 0; i < High(YourATPA); inc(i)) do
SMART_DrawBoxEx(true,GetTPABounds(YourATPA),clRed);
Unless it's new, that's not valid syntax in PS.

masterBB

2011-10-11 03:40:54

From: Coh3n
Unless it's new, that's not valid syntax in PS.


Your right, its pseudo code. Should be:

for i := 0 to high(YourATPA) do
SMART_DrawBoxEx(false,GetTPABounds(YourATPA[i]),clRed);