Changeset 47
- Timestamp:
- 02/24/07 04:54:29 (2 years ago)
- Files:
-
- trunk/luigi/base.d (modified) (5 diffs)
- trunk/luigi/event.d (modified) (2 diffs)
- trunk/luigi/gui.d (modified) (1 diff)
- trunk/luigi/themes/dxut.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/luigi/base.d
r37 r47 72 72 float y2(float v) { return h=(v-y); } 73 73 74 Point center() { return Point(x+width/2,y+height/2); } 75 Point minpos() { return Point(x1,y1); } 76 Point maxpos() { return Point(x2,y2); } 77 74 78 /** Rect constructor */ 75 79 static Rect opCall(float rx = 0, float ry = 0, float rwidth = 0, float rheight = 0) { … … 85 89 set(leftx,topy,rightx-leftx,bottomy-topy); 86 90 } 91 alias setLTRB setMinMax; 87 92 88 93 /** Point-inside-rect test */ … … 116 121 /** Grow rect to enclose point p. */ 117 122 void enclose(Point p) { 123 if (!valid) { 124 x = p.x; y=p.y; 125 w = 0; h = 0; 126 } 118 127 if (p.x < x) { w = x2-p.x; x = p.x; } 119 128 else if (p.x > x2) { x2 = p.x; } … … 122 131 } 123 132 133 134 bool valid() { 135 return !(math.isnan(x)||math.isnan(y)|| 136 math.isnan(w)||math.isnan(h)); 137 } 124 138 125 139 char[] toString() { … … 162 176 } 163 177 178 /** Return a pointer to the first element */ 179 float *ptr() { return &x; } 164 180 } 165 181 trunk/luigi/event.d
r33 r47 47 47 }; 48 48 49 char[] toString(KeyMods k) {49 char[] modsToString(KeyMods k) { 50 50 alias KeyMods e; 51 51 char [] ret; … … 70 70 }; 71 71 72 char[] toString(MouseButtons b) {72 char[] buttonsToString(MouseButtons b) { 73 73 alias MouseButtons e; 74 74 char[] ret; trunk/luigi/gui.d
r46 r47 670 670 void on_mouse_button(MouseButtonEvent ev) 671 671 { 672 alias .toString str;672 alias string.toString str; 673 673 version (LuigiTrace) 674 674 writefln("button %s %s: ",str(ev.button), ev.is_press?"press":"release", trunk/luigi/themes/dxut.d
r46 r47 120 120 loadCompressedTexture(filepath, m_texid); 121 121 } else { 122 char[] str = std.string.format( 123 "couldn't find, or failed to load \"%s\"", filepath); 124 report_error(str); 122 report_error("Couldn't find, or failed to load dxutcontrols.dds"); 125 123 return; 126 124 }
