View Full Version : Show debugatpa bound within smart
In MSI, they show debugatpa/tpa bounds within smart instead of making a popup. How could I do that ?
Harry
10-10-2011, 04:03 AM
drawdotsmulti(true,atpa);
Look for that in https://github.com/SRL/MSI/blob/master/MSI/Core/Objects.simba .
damn, looks like hax:( I'll try to learn it.
bevardis
10-10-2011, 04:57 PM
Look through msi code, I guess that could help.
I think the file is something like smart paint or paintsmart
masterBB
10-10-2011, 07:51 PM
Srl/SRL/misc/paintsmart.scar
Coh3n
10-10-2011, 08:45 PM
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
10-10-2011, 09:39 PM
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
10-11-2011, 12:49 AM
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 ;).
all of yall thanks a ton!:P
Coh3n
10-11-2011, 12:58 AM
That test script is just supposed to show it working, it doesn't actually accomplish anything.
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
10-11-2011, 01:29 AM
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.
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
10-11-2011, 01:36 AM
Oh sorry, it's just DrawDotsMulti. There's no SMART prefix.
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
10-11-2011, 02:27 AM
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);
I just want something like DebugATPABounds:
http://img695.imageshack.us/img695/6941/exampleez.png
I'll try that the code you posted:P
Coh3n
10-11-2011, 02:35 AM
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.
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
10-11-2011, 05:07 AM
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[i]),clRed);
Coh3n
10-11-2011, 05:43 AM
for(var i := 0; i < High(YourATPA); inc(i)) do
SMART_DrawBoxEx(true,GetTPABounds(YourATPA[i]),clRed);Unless it's new, that's not valid syntax in PS.
masterBB
10-11-2011, 07:40 AM
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);
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.