|
| 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 |
|
|
| |
|
|
| 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 |
|
|
| |
|
| |
|
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 |
|
|
| |
|
| |
|
|
| 23 Aug 2011 05:59 PM |
please dont spam my thread?
y u here otter? |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:06 PM |
| would anyone like anymore? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 23 Aug 2011 06:10 PM |
| dan, plz just stawp i want educated answers |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 23 Aug 2011 06:13 PM |
| well would u like more? i wanna get back to coding ;) |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 23 Aug 2011 06:14 PM |
no im continuing with the code i b workin on
|
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 23 Aug 2011 06:30 PM |
| bump i want pplz to ask if they want more code |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 23 Aug 2011 06:40 PM |
#include < windows.h > #include < windowsx.h > #include < stdio.h > #include < math.h > |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|