Mercurial > love-experiments
annotate src/common/wrap_Data.cpp @ 1448:108ee2e81f65 default tip
Fix a case typo, imageData.h -> ImageData.h
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Sat, 18 Jan 2014 13:57:44 +0100 |
| parents | b7f097053d74 |
| children |
| rev | line source |
|---|---|
| 1096 | 1 /** |
|
1282
b7f097053d74
Updated copyright text for the new year
Alex Szpakowski <slime73@gmail.com>
parents:
1167
diff
changeset
|
2 * Copyright (c) 2006-2013 LOVE Development Team |
| 1096 | 3 * |
| 4 * This software is provided 'as-is', without any express or implied | |
| 5 * warranty. In no event will the authors be held liable for any damages | |
| 6 * arising from the use of this software. | |
| 7 * | |
| 8 * Permission is granted to anyone to use this software for any purpose, | |
| 9 * including commercial applications, and to alter it and redistribute it | |
| 10 * freely, subject to the following restrictions: | |
| 11 * | |
| 12 * 1. The origin of this software must not be misrepresented; you must not | |
| 13 * claim that you wrote the original software. If you use this software | |
| 14 * in a product, an acknowledgment in the product documentation would be | |
| 15 * appreciated but is not required. | |
| 16 * 2. Altered source versions must be plainly marked as such, and must not be | |
| 17 * misrepresented as being the original software. | |
| 18 * 3. This notice may not be removed or altered from any source distribution. | |
| 19 **/ | |
| 20 | |
| 21 #include "wrap_Data.h" | |
| 22 | |
| 23 namespace love | |
| 24 { | |
| 25 | |
| 26 Data *luax_checkdata(lua_State *L, int idx) | |
| 27 { | |
| 28 return luax_checktype<Data>(L, idx, "Data", DATA_T); | |
| 29 } | |
| 30 | |
| 31 int w_Data_getPointer(lua_State *L) | |
| 32 { | |
| 33 Data *t = luax_checkdata(L, 1); | |
| 34 lua_pushlightuserdata(L, t->getData()); | |
| 35 return 1; | |
| 36 } | |
| 37 | |
| 38 int w_Data_getSize(lua_State *L) | |
| 39 { | |
| 40 Data *t = luax_checkdata(L, 1); | |
| 41 lua_pushinteger(L, t->getSize()); | |
| 42 return 1; | |
| 43 } | |
| 44 | |
| 45 const luaL_Reg w_Data_functions[] = | |
| 46 { | |
|
1167
c2d293428788
Disable Data:getPointer (issue #520)
Bart van Strien <bart.bes+projects@gmail.com>
parents:
1096
diff
changeset
|
47 // { "getPointer", w_Data_getPointer }, |
| 1096 | 48 { "getSize", w_Data_getSize }, |
| 49 { 0, 0 } | |
| 50 }; | |
| 51 | |
| 52 int w_Data_open(lua_State *L) | |
| 53 { | |
| 54 luax_register_type(L, "Data", w_Data_functions); | |
| 55 return 0; | |
| 56 } | |
| 57 | |
| 58 } // love |
