Changeset 350

Show
Ignore:
Timestamp:
06/03/08 06:46:56 (6 months ago)
Author:
FeepingCreature
Message:
  • Whoo
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/qd/SDL_ttf.d

    r345 r350  
    9797} 
    9898 
    99 void print(int x, int y, Align how, fontsettings[] settings, string[] strings) in { 
     99void print(Area delegate(int w, int h) dg, fontsettings[] settings, string[] strings) in { 
    100100    assert(settings.length == strings.length); 
    101101  } body { 
     
    110110    if (surfs[i].height > height) height = surfs[i].height; 
    111111  } 
    112   auto target = display.select(pt(x, y), pt(width, height), how); 
     112  //auto target = display.select(pt(x, y), pt(width, height), how); 
     113  auto target = dg(width, height); 
    113114  foreach (surf; surfs) { 
    114115    target.blit(surf, Top|Left); 
     
    118119} 
    119120 
    120 void print(int x, int y, Align how, rgb col, string what) { 
    121   fontsettings foo; foo.color = col; 
    122   print(x, y, how, [foo], [what]); 
    123 
     121void print(int x, int y, Align how, fontsettings[] settings, string[] strings) { 
     122  print((int w, int h) { return display.select(pt(x, y), pt(w, h), how); }, settings, strings); 
     123
     124 
     125void print(Area target, Align how, rgb col, string what) { 
     126  fontsettings foo; foo.color = col; print((int w, int h) { return target.select(pt(w, h), how); }, [foo], [what]); 
     127
     128 
     129void print(Align how, fontsettings[] settings, string[] strings) { 
     130  print((int w, int h) { return display.select(pt(w, h), how); }, settings, strings); 
     131
     132 
     133void print(int x, int y, Align how, rgb col, string what) { fontsettings foo; foo.color = col; print(x, y, how, [foo], [what]); } 
     134 
     135void print(Align how, rgb col, string what) { fontsettings foo; foo.color = col; print(how, [foo], [what]); } 
    124136 
    125137void print(pt p, Align how, rgb col, string what) { print(p.x, p.y, how, col, what); } 
  • trunk/qd/dsss.conf

    r343 r350  
    22[qd.d] 
    33type=sourcelibrary 
    4 [dt.d] 
     4[dt/dt.d] 
    55buildflags=-L-lSDL -L-lSDL_ttf -g -O 
    66# [test.d] 
  • trunk/qd/dt/fatline.d

    r347 r350  
    1 module dt.test13
     1module dt.fatline
    22 
    33import qd, dglut.vector, std.stdio, tools.base, tools.log, std.math; 
  • trunk/qd/dt/main.d

    r347 r350  
    1 module dt.dt; // D Tower Defense 
     1module dt.main; // D Tower Defense 
    22 
    33import tools.base; 
     
    505505} 
    506506 
    507 import dt.test13, tools.functional; 
     507import dt.fatline, tools.functional; 
    508508void main() { 
    509509  auto blink_fn = blink(0.5); 
  • trunk/qd/qd.d

    r346 r350  
    607607void updateMouse(int x, int y, ubyte button, int pushed) { 
    608608  mouse.pos = pt(x, y); 
    609   if (pushed == 1) mouse._clicked = true; 
     609  if (pushed == 1) { 
     610    if (button == 1) mouse._leftclicked = true; 
     611    if (button == 3) mouse._rightclicked = true; 
     612  } 
    610613} 
    611614 
     
    613616  static { 
    614617    pt pos; 
    615     bool _clicked; 
    616     bool clicked() { if (!_clicked) return false; _clicked = false; return true; } 
     618    bool _leftclicked, _rightclicked; 
     619    bool clicked() { if (!_leftclicked) return false; _leftclicked = false; return true; } 
     620    bool rightclicked() { if (!_rightclicked) return false; _rightclicked = false; return true; } 
    617621    bool opIn(Area area) { 
    618622      return pos in area;