Changeset 49
- Timestamp:
- 05/03/08 07:40:36 (7 months ago)
- Files:
-
- trunk/pihlaja/src/shiraz/canvas/Draw.d (modified) (3 diffs)
- trunk/pihlaja/src/shiraz/canvas/PlainRectangle.d (modified) (3 diffs)
- trunk/pihlaja/src/shiraz/canvas/Rectangle.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pihlaja/src/shiraz/canvas/Draw.d
r48 r49 122 122 glColor3f(1.0f, 1.0f, 1.0f); 123 123 124 /*124 125 125 //This doesn't work anymore with GL_CCW?... 126 glRectf(ix1,127 iy1,128 ix2,129 iy2);130 */126 //glRectf(ix1, 127 // iy1, 128 // ix2, 129 // iy2); 130 131 131 glBegin(GL_QUADS); 132 132 glNormal3f(0.0f, 0.0f, 1.0f); … … 205 205 void pushClipping(float ix1, float iy1, float ix2, float iy2, float iz = 0.0f) 206 206 { 207 debug(clipping) 208 { 209 Trace.formatln("Draw.pushClipping() START."); 210 211 Trace.format("ix1:{}, ", cast(double) ix1 ); 212 Trace.format("iy1:{}, ", cast(double) iy1 ); 213 Trace.format("ix2:{}, ", cast(double) ix2 ); 214 Trace.format("iy2:{}, ", cast(double) iy2 ); 215 } 216 207 217 ClippingInfo clipinfo = new ClippingInfo(ix1, iy1, ix2, iy2, iz); 208 if( clipStack.length > 0 )218 /*if( clipStack.length > 0 ) 209 219 { 210 220 clipStack.tail.clip( clipinfo );//Wow! We clip it with the old clip. 211 } 221 }*/ 212 222 clipStack.push( clipinfo ); 223 debug(clipping) Trace.formatln("Draw.pushClipping() push. size: {}", clipStack.length ); 213 224 clipinfo.startClipping(); 214 225 } … … 216 227 void popClipping() 217 228 { 229 debug(clipping) Trace.formatln("Draw.popClipping() START."); 230 218 231 scope ClippingInfo clipinfo = clipStack.pop(); 232 233 debug(clipping) Trace.formatln("Draw.popClipping() pop. size: {}", clipStack.length ); 234 235 clipinfo.endClipping(); 236 219 237 if( clipStack.length > 0 ) 220 238 { 221 239 clipStack.tail.startClipping(); 222 240 } 223 else clipinfo.endClipping();241 //else clipinfo.endClipping(); 224 242 } 225 243 trunk/pihlaja/src/shiraz/canvas/PlainRectangle.d
r48 r49 1042 1042 } 1043 1043 1044 //Maybe remove this. It's just 1045 //for debug in render(). 1046 public char[] fullName(char[] recursive = "") 1047 { 1048 return name ~ "." ~ recursive; 1049 } 1050 1051 public bool isClipping() { return m_isClipping; } 1052 public bool isClipping(bool set) { return m_isClipping = set; } 1053 protected bool m_isClipping = false; 1054 1044 1055 void render( Draw draw ) 1045 1056 { 1057 debug(clipping) Trace.formatln("PlainRectangle.render() START. name: {}", fullName() ); 1058 1046 1059 beginRender(draw); 1047 1060 … … 1050 1063 //draw.colour(); 1051 1064 //draw.gradient( gradient ); 1065 1066 //TODO 1067 glColor4f(r, g, b, a); 1052 1068 1053 1069 shape.bounds(ix1, iy1, ix2, iy2, iz); … … 1062 1078 } 1063 1079 1064 //if( isClipping == true )1080 if( isClipping == true ) 1065 1081 draw.pushClipping(ix1, iy1, ix2, iy2, iz); 1066 1082 1067 1083 renderChildren(draw); 1068 1084 1069 //if( isClipping == true ) 1085 endRender(draw);//TEMP hack... 1086 1087 if( isClipping == true ) 1070 1088 draw.popClipping(); 1071 1089 1072 1090 1073 endRender(draw);1091 1074 1092 } 1075 1093 trunk/pihlaja/src/shiraz/canvas/Rectangle.d
r48 r49 3040 3040 } 3041 3041 3042 public bool isClipping() { return m_isClipping; }3043 public bool isClipping(bool set) { return m_isClipping = set; }3044 protected bool m_isClipping = false;3045 3046 3042 public double tempclip = 0.0f; 3047 3043 public double tempclip2 = 0.0f;
