Changeset 257
- Timestamp:
- 03/11/08 08:50:01 (9 months ago)
- Files:
-
- trunk/qd/qd.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/qd/qd.d
r225 r257 112 112 int SDL_PollEvent(SDL_Event *event); 113 113 int SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst); 114 void SDL_QuitSubSystem(uint flags); 115 const uint SDL_INIT_VIDEO = 0x00000020; 114 116 } 115 117 … … 237 239 int lastx, lasty; 238 240 239 void pset(T...)(int x, int y, T params) { 240 lastx=x; lasty=y; 241 void pset(T...)(T params) { 242 auto x = cast(int) params[0], y = cast(int) params[1]; 243 lastx=cast(int) x; lasty=cast(int) y; 241 244 SDL_LockSurface(display.target); 242 245 scope(exit) { SDL_UnlockSurface(display.target); if (doFlip) flip; } 243 execParams(params); 244 with (color) putpixel32(display.target, x, y, SDL_MapRGBA(display.target.format, values[0], values[1], values[2], 0)); 246 execParams(params[2..$]); 247 if (x<0 || x!<screen.w || y<0 || y!<screen.h) return; 248 with (color) putpixel32( 249 display.target, x, y, 250 SDL_MapRGBA(display.target.format, values[0], values[1], values[2], 0) 251 ); 245 252 } 246 253 … … 451 458 else display=Area(SDL_SetVideoMode(w, h, 32, sdl_flags)); 452 459 } 460 void close() { SDL_QuitSubSystem(SDL_INIT_VIDEO); } 453 461 int width() { return display.width; } 454 462 int height() { return display.height; }
