generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: check out my epic C++ coding btw uses awesome algorithms

Previous Thread :: Next Thread 
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 05:43 PM
void Draw_Top_Tri(int x1, int y1,
int x2, int y2,
int x3, int y3
int color,
UCHAR *dest_duffer, int mempitch)

{

float dx_right,
dx_left,
xs,xe,
height;

int temp_x,
temp_y,
right,
left;

UCHAR *dest_addr = NULL;

if (x2 < x1)
{
temp_x = x2;
x2 = x1;
x1 = temp_x;
}

height = y3-y1;

dx_left = (x3-x1)/height;
dx_right = (x3-x2)/height;

xs = (float)x1;
xe = (float)x2+(float)0.5;

if (y1 < min_clip_y)
{

xs = xs+dx_left*(float)(-y1+min_clip_y);
xe = xe+dx_right*(float)(-y1+min_clip_y);

y1 = min_clip_y;

if (x1>=min_clip_x && x1<=max_clip_x && x2>=min_clip_x && x2<=min_clip_x && x3>=min_clip_x && x3<=min_clip_x)
{
for(temp_y=y1; temp_y<=y3; temp_y++,dest_addr+=mempitch)
{
memset((UCHAR *)dest_addr+(unsigned int)xs, color, (unsigned int) (xe-xs+1));

xs+=dx_left;
xe+=dx_right;
}



// anyone liking this? shall i continue the long process?

Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
23 Aug 2011 05:48 PM
wtf does it do?
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 05:49 PM
its testing if it goes out of the screen area it returns it on the other side
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
23 Aug 2011 05:50 PM
wut
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 05:51 PM
e.o
Report Abuse
xHTMLx is not online. xHTMLx
Joined: 10 Feb 2011
Total Posts: 4242
23 Aug 2011 05:55 PM
Lol n0b not no C++.

I <3 you This. xP
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 05:56 PM
i luv u also :3
Report Abuse
broniesmasherII is not online. broniesmasherII
Joined: 28 Jul 2011
Total Posts: 538
23 Aug 2011 05:56 PM
da hell?
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 05:59 PM
please dont spam my thread?

y u here otter?
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 06:06 PM
would anyone like anymore?
Report Abuse
Danster5oo is not online. Danster5oo
Joined: 27 Aug 2010
Total Posts: 10003
23 Aug 2011 06:07 PM
Good, now make one that will make me cookies.

No more Emess and Arceus? http://www.roblox.com/Forum/ShowPost.aspx?PostID=53452798
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 06:10 PM
dan, plz just stawp i want educated answers
Report Abuse
Danster5oo is not online. Danster5oo
Joined: 27 Aug 2010
Total Posts: 10003
23 Aug 2011 06:10 PM
dat no edumacted enuf for u?

No more Emess and Arceus? http://www.roblox.com/Forum/ShowPost.aspx?PostID=53452798
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 06:11 PM
ya it mak me fel weerd
Report Abuse
Danster5oo is not online. Danster5oo
Joined: 27 Aug 2010
Total Posts: 10003
23 Aug 2011 06:11 PM
u r weerd

No more Emess and Arceus? http://www.roblox.com/Forum/ShowPost.aspx?PostID=53452798
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 06:13 PM
well would u like more? i wanna get back to coding ;)
Report Abuse
Danster5oo is not online. Danster5oo
Joined: 27 Aug 2010
Total Posts: 10003
23 Aug 2011 06:14 PM
yus, sumting dat maks cukis

No more Emess and Arceus? http://www.roblox.com/Forum/ShowPost.aspx?PostID=53452798
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 06:14 PM
no im continuing with the code i b workin on
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 06:18 PM
hello i need answers1111
Report Abuse
NecroBumpist is not online. NecroBumpist
Joined: 12 Sep 2010
Total Posts: 4198
23 Aug 2011 06:21 PM
Look at all 'dem arguments.
Anyway, pretty ugly :3

-NecroBumpist, Master of Lua, Writer of Wikis ◕ ‿‿ ◕
==MODS Update: v2.2.1 out! Check @LuaASM==
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 06:22 PM
lol yea im thinking of starting to comment on what stuff does, it gets pretty hard when you have 1,000 lines of code and you have to search to find glitches, etc
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 06:30 PM
bump i want pplz to ask if they want more code
Report Abuse
pwnedu46 is not online. pwnedu46
Joined: 23 May 2009
Total Posts: 7534
23 Aug 2011 06:38 PM
Sure. What gui lib are you using?


______________________________________
~pwnedu46~
-I lost the game.-
I love making dooly-bops. ~ArceusInator
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 06:40 PM
#include < windows.h >
#include < windowsx.h >
#include < stdio.h >
#include < math.h >
Report Abuse
ThisIsSPORE is not online. ThisIsSPORE
Joined: 24 Jun 2011
Total Posts: 2402
23 Aug 2011 06:56 PM
//im going to label what things do so you guys dont get confused :3

void Draw_Top_Tri(int x1, int y1,
int x2, int y2,
int x3, int y3
int color,
UCHAR *dest_duffer, int mempitch)

{

float dx_right,
dx_left,
xs,xe,
height;

int temp_x,
temp_y,
right,
left;

UCHAR *dest_addr = NULL;

if (x2 < x1)
{
temp_x = x2;
x2 = x1;
x1 = temp_x;
}

height = y3-y1;

dx_left = (x3-x1)/height;
dx_right = (x3-x2)/height;

xs = (float)x1;
xe = (float)x2+(float)0.5;

if (y1 < min_clip_y)
{

xs = xs+dx_left*(float)(-y1+min_clip_y);
xe = xe+dx_right*(float)(-y1+min_clip_y);

y1 = min_clip_y;

if (x1>=min_clip_x && x1<=max_clip_x && x2>=min_clip_x && x2<=min_clip_x && x3>=min_clip_x && x3<=min_clip_x)
{
for(temp_y=y1; temp_y<=y3; temp_y++,dest_addr+=mempitch)
{
memset((UCHAR *)dest_addr+(unsigned int)xs, color, (unsigned int) (xe-xs+1));

xs+=dx_left;
xe+=dx_right;
}
}
else {
for (temp_y=y1; temp_y<=y3; temp_y++, dest_addr+=mempitch)
{
// doing the x clip
left = (int)xs
right = (int)xe;

// adjusts the start point to the finish point

xs+=dx_left;
xe+=dx_right;
< s$I~graphics;triangles;drawing >
if (left < min_clip_x)
{
left = min_clip_x;

if (right < min_clip_x)
{
continue;
}

if(right > min_clip_x)
{
right = max_clip_x;

if(left > max_clip_x)
{
continue;
}

memset((UCHAR *)dest_addr+(unsigned int)left, color, (unsigned int) (right-left+1));

} // ending the for
} // ending the else
} // ending Draw_Top_Tri





this code is pretty much complete, even though you don't get to see all of it :(

Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image