Changeset 594 for trunk/core/luascript.c
- Timestamp:
- 11/27/08 07:13:55 (4 years ago)
- File:
-
- 1 edited
-
trunk/core/luascript.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/luascript.c
r579 r594 11 11 #include "ubasic.h" 12 12 #include "stdlib.h" 13 #include "raw.h" 14 #include "raw_merge.h" 13 15 14 16 static int luaCB_shoot( lua_State* L ) … … 477 479 { 478 480 479 if lua_isboolean( L, 1 ) script_print_screen_statement( lua_toboolean( L, 1 ) ); 480 else script_print_screen_statement( luaL_checknumber( L, 1 )+10000 ); 481 if (lua_isboolean( L, 1 )) 482 script_print_screen_statement( lua_toboolean( L, 1 ) ); 483 else 484 script_print_screen_statement( luaL_checknumber( L, 1 )+10000 ); 481 485 return 0; 482 486 } … … 491 495 { 492 496 int to; 493 to = luaL_checknumber( L, 1 ); 494 if (to==1) { 495 if (movie_status == 4) { 496 movie_status = 1; 497 }} 498 if (to==2) { 499 if (movie_status == 1) { 500 movie_status = 4; 501 } 502 } 503 if (to==3) { 504 if (movie_status == 1 || 4) { 505 movie_status = 5; 506 }} 497 switch(luaL_checknumber( L, 1 )) { 498 case 1: 499 if (movie_status == 4) { 500 movie_status = 1; 501 } 502 break; 503 case 2: 504 if (movie_status == 1) { 505 movie_status = 4; 506 } 507 break; 508 case 3: 509 if (movie_status == 1 || movie_status == 4) { 510 movie_status = 5; 511 } 512 break; 513 } 507 514 return 0; 508 515 } … … 758 765 lua_pushnumber( L, m ); 759 766 return 3; 767 } 768 769 // TODO sanity check file ? 770 static int luaCB_set_raw_develop( lua_State* L ) 771 { 772 raw_prepare_develop(luaL_optstring( L, 1, NULL )); 773 return 0; 774 } 775 776 static int luaCB_raw_merge_start( lua_State* L ) 777 { 778 int op = luaL_checknumber(L,1); 779 if (op == RAW_OPERATION_SUM || op == RAW_OPERATION_AVERAGE) { 780 raw_merge_start(op); 781 } 782 else { 783 return luaL_argerror(L,1,"invalid raw merge op"); 784 } 785 return 0; 786 } 787 788 // TODO sanity check file ? 789 static int luaCB_raw_merge_add_file( lua_State* L ) 790 { 791 raw_merge_add_file(luaL_checkstring( L, 1 )); 792 return 0; 793 } 794 795 static int luaCB_raw_merge_end( lua_State* L ) 796 { 797 raw_merge_end(); 798 return 0; 760 799 } 761 800 … … 885 924 FUNC(get_buildinfo); 886 925 FUNC(get_mode); 887 } 926 927 FUNC(set_raw_develop); 928 // NOTE these functions normally run in the spytask. 929 // called from lua they will run from kbd task instead 930 FUNC(raw_merge_start); 931 FUNC(raw_merge_add_file); 932 FUNC(raw_merge_end); 933 }
Note: See TracChangeset
for help on using the changeset viewer.