Post Reply 
RECT_P but without filling
11-30-2015, 03:33 PM (This post was last modified: 11-30-2015 06:29 PM by eried.)
Post: #6
RE: RECT_P but without filling
Both functions take almost the same time :O

Code:
RECT_P_NOFILL(x,y,x2,y2,col)
begin
 LINE_P(x,y,x2,y,col); //top
 LINE_P(x,y2,x2,y2,col); // bottom
 LINE_P(x,y,x,y2,col); //left
 LINE_P(x2,y,x2,y2,col); // right
end;

RECT_P_NO2FILL(x,y,x2,y2,col)
begin
 RECT_P(x,y,x+x2,y+y2,col,RGB(0,0,0,255));
end;

EXPORT test()
BEGIN
print();
local r,g,b,x,time1:=ticks;
FOR r FROM 1 TO 100 DO
FOR g FROM 1 TO 100 DO
FOR b FROM 1 TO 100 DO
FOR x FROM 1 TO 10 DO
RECT_P_NOFILL(x,x,10,50,RGB(r,g,b));
END;END;END;END;

print(ticks-time1);
time1:=ticks;
FOR r FROM 1 TO 100 DO
FOR g FROM 1 TO 100 DO
FOR b FROM 1 TO 100 DO
FOR x FROM 1 TO 10 DO
RECT_P_NO2FILL(x,x,10,50,RGB(r,g,b));
END;END;END;END;
print(ticks-time1);

END;

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RECT_P but without filling - hpfx - 11-27-2015, 01:35 PM
RE: RECT_P but without filling - DrD - 11-27-2015, 02:46 PM
RE: RECT_P but without filling - primer - 11-27-2015, 03:18 PM
RE: RECT_P but without filling - primer - 11-30-2015, 09:04 AM
RE: RECT_P but without filling - eried - 11-30-2015 03:33 PM
RE: RECT_P but without filling - eried - 11-30-2015, 06:28 PM
RE: RECT_P but without filling - primer - 11-30-2015, 08:42 PM
RE: RECT_P but without filling - Han - 11-30-2015, 09:55 PM



User(s) browsing this thread: 1 Guest(s)