| 647 | } |
| 648 | |
| 649 | static Handle<Value> sdl::SetColorKey(const Arguments& args) { |
| 650 | HandleScope scope; |
| 651 | |
| 652 | if (!(args.Length() == 3 && args[0]->IsObject() && args[1]->IsNumber() && args[2]->IsNumber())) { |
| 653 | return ThrowException(Exception::TypeError(String::New("Invalid arguments: Expected SetColorKey(Surface, Number, Number)"))); |
| 654 | } |
| 655 | |
| 656 | SDL_Surface* surface = UnwrapSurface(args[0]->ToObject()); |
| 657 | int flag = args[1]->Int32Value(); |
| 658 | int key = args[2]->Int32Value(); |
| 659 | |
| 660 | if (SDL_SetColorKey(surface, flag, key) < 0) return ThrowSDLException(__func__); |
| 661 | |
| 662 | return Undefined(); |
| 663 | |
| 664 | } |
| 665 | |
| 666 | static Handle<Value> sdl::DisplayFormat(const Arguments& args) { |
| 667 | HandleScope scope; |
nothing calls this directly
no test coverage detected