- Timestamp:
- 03/12/10 09:06:59 (3 years ago)
- Location:
- trunk/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/curves.c
r11 r268 103 103 if((value>=0) && (value<=4)) conf.curve_enable=value; 104 104 curve_init_mode(); 105 } 106 107 void curve_set_file(const char *s) { 108 int l; 109 if(s) { 110 if(strncmp(s,"A/",2)==0) strncpy(conf.curve_file,s,99); 111 else { 112 l=strlen(CURVE_DIR); 113 strcpy(conf.curve_file,CURVE_DIR); 114 conf.curve_file[l]='/'; 115 strncpy(&conf.curve_file[l+1],s,99-l-1); 116 } 117 conf.curve_file[99]=0x0; 118 curve_init_mode(); 119 } 105 120 } 106 121 -
trunk/core/curves.h
r11 r268 7 7 //------------------------------------------------------------------- 8 8 extern void curve_set_mode(); 9 extern void curve_set_file(); 9 10 extern void curve_init_mode(); 10 11 extern void curve_apply(); -
trunk/core/luascript.c
r260 r268 24 24 curve_set_mode(value); 25 25 return 0; 26 } 27 28 static int luaCB_get_curve_state( lua_State* L ) 29 { 30 lua_pushnumber(L,conf.curve_enable); 31 return 1; 32 } 33 34 static int luaCB_set_curve_file( lua_State* L ) 35 { 36 size_t l; 37 const char *s = luaL_checklstring(L, 1, &l); 38 curve_set_file(s); 39 return 0; 40 } 41 42 static int luaCB_get_curve_file( lua_State* L ) 43 { 44 lua_pushstring(L,conf.curve_file); 45 return 1; 26 46 } 27 47 #endif … … 1444 1464 #ifdef OPT_CURVES 1445 1465 FUNC(set_curve_state); 1466 FUNC(get_curve_state); 1467 FUNC(set_curve_file); 1468 FUNC(get_curve_file); 1446 1469 #endif 1447 1470 // get levent definition by name or id, nil if not found
Note: See TracChangeset
for help on using the changeset viewer.