Removed NLA winqread and write runtime obfuscation cruft.

Can we just dump all this silly key stuff please?
This commit is contained in:
2003-03-23 21:42:31 +00:00
parent 05afb06397
commit e0cec3d2c4
5 changed files with 13 additions and 100 deletions

View File

@@ -41,9 +41,7 @@
functions too easily, some of those functions have nonsense names. functions too easily, some of those functions have nonsense names.
*/ */
#define key_func1 make_beautiful_animation #define key_func1 key_return_true
#define key_func2 key_return_true
#define key_func3 calc_memleak
/* add the corresponding function pointer defines here. /* add the corresponding function pointer defines here.
Example: Example:
@@ -56,11 +54,5 @@
license_key.c:init_ftable() if necessary. license_key.c:init_ftable() if necessary.
*/ */
#define KEY_WRITE_RUNTIME KEY_GETPTR(KEY_FUNC1) #define KEY_RETURN_TRUE KEY_GETPTR(KEY_FUNC1)
#define KEY_RETURN_TRUE KEY_GETPTR(KEY_FUNC2)
#define KEY_NLA_EVENT KEY_GETPTR(KEY_FUNC3)
/* PROTOS */
int make_beautiful_animation(void *vp);
int calc_memleak (void* ptr);

View File

@@ -129,10 +129,8 @@ static void init_ftable(void) // initializes functiontable
int i; int i;
g_functab[0] = &key_func1; g_functab[0] = &key_func1;
g_functab[1] = &key_func2;
g_functab[2] = &key_func3;
for (i = 3; i < PYKEY_TABLEN; i++) for (i = 1; i < PYKEY_TABLEN; i++)
{ {
g_functab[i] = &sticky_shoes; g_functab[i] = &sticky_shoes;
} }

View File

@@ -88,11 +88,6 @@
/* Note: A lot of these pretty much duplicate the behaviour of the /* Note: A lot of these pretty much duplicate the behaviour of the
action windows. The functions should be shared, not copy-pasted */ action windows. The functions should be shared, not copy-pasted */
typedef struct NlaParam{
SpaceNla *snla;
unsigned short event;
short val;
}NlaParam;
static void deselect_nlachannel_keys (int test); static void deselect_nlachannel_keys (int test);
static void deselect_nlachannels(int test); static void deselect_nlachannels(int test);
@@ -116,28 +111,16 @@ extern int nla_filter (Base* base, int flags); /* From drawnla.c */
/* ******************** SPACE: NLA ********************** */ /* ******************** SPACE: NLA ********************** */
/* Protected creator function */ void winqreadnlaspace(unsigned short event, short val, char ascii)
int calc_memleak (void* ptr){ {
SpaceNla *snla = curarea->spacedata.first;
int doredraw= 0; int doredraw= 0;
short mval[2]; short mval[2];
float dx,dy; float dx,dy;
int cfra; int cfra;
SpaceNla *snla;
NlaParam *params=(NlaParam*) ptr;
unsigned short event;
short val ;
if (!ptr)
return -1;
snla= params->snla;
event = params->event;
val = params->val;
if(curarea->win==0) return 0; if (curarea->win==0) return;
if (!snla) return;
if (!snla)
return 0;
if(val) { if(val) {
if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0; if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
@@ -239,25 +222,6 @@ int calc_memleak (void* ptr){
} }
if(doredraw) scrarea_queue_winredraw(curarea); if(doredraw) scrarea_queue_winredraw(curarea);
return 0;
}
void winqreadnlaspace(unsigned short event, short val, char ascii)
{
NlaParam param;
Base *base;
bActionStrip *strip, *next;
short mval[2];
float dx, dy;
int cfra;
param.event = event;
param.val = val;
param.snla = curarea->spacedata.first;
/* Call the protected (&obfuscated) eventloop function */
calc_memleak(&param); /* enable NLA */
} }
static void convert_nla(short mval[2]) static void convert_nla(short mval[2])

View File

@@ -2119,30 +2119,9 @@ static void check_packAll()
} }
/* KEYED FUNCTIONS int write_runtime(char *str, char *exename)
--------------- */
/* this function name is meaningless and only called that way for some
obscurity
It is called by a function table from the license_key;
see include/keyed_functions.h
*/
struct twostrings
{
char *outname;
char *exename;
};
/** This function is called for writing runtimes.
* It's locked behind the key and called through a function table
* which is initialized properly by the Python key code (if valid)
*/
int make_beautiful_animation(void *vp)
{ {
char *freestr= NULL; char *freestr= NULL;
struct twostrings *twostrings = (struct twostrings *) vp;
char *str = twostrings->outname;
char *ext = 0; char *ext = 0;
#ifdef _WIN32 #ifdef _WIN32
@@ -2160,7 +2139,7 @@ int make_beautiful_animation(void *vp)
} }
if (!BLI_exists(str) || saveover(str)) if (!BLI_exists(str) || saveover(str))
BLO_write_runtime(str, twostrings->exename); BLO_write_runtime(str, exename);
if (freestr) if (freestr)
MEM_freeN(freestr); MEM_freeN(freestr);
@@ -2168,33 +2147,15 @@ int make_beautiful_animation(void *vp)
return 0; return 0;
} }
/*
int make_nice_software(void)
{
Fptr f = KEY_RETURN_TRUE;
if (f) return f(0);
else return 0;
}
*/
static void write_runtime_check_dynamic(char *str) static void write_runtime_check_dynamic(char *str)
{ {
struct twostrings twostrings; write_runtime(str, "blenderdynplayer.exe");
twostrings.outname = str;
twostrings.exename = "blenderdynplayer.exe";
make_beautiful_animation((void *) &twostrings);
} }
static void write_runtime_check(char *str) static void write_runtime_check(char *str)
{ {
struct twostrings twostrings;
char player[128]; char player[128];
twostrings.outname = str;
twostrings.exename = player;
strcpy(player, "blenderplayer"); strcpy(player, "blenderplayer");
#ifdef _WIN32 #ifdef _WIN32
@@ -2205,7 +2166,7 @@ static void write_runtime_check(char *str)
strcat(player, ".app"); strcat(player, ".app");
#endif #endif
make_beautiful_animation((void *) &twostrings); write_runtime(str, player);
} }
/* end keyed functions */ /* end keyed functions */

View File

@@ -210,11 +210,9 @@ static void init_ftable(void) // initializes functiontable
int i; int i;
g_functab[0] = &key_func1; g_functab[0] = &key_func1;
g_functab[1] = &key_func2;
g_functab[2] = &key_func3;
/* add more key_funcs here */ /* add more key_funcs here */
for (i = 3; i < PYKEY_TABLEN; i++) for (i = 1; i < PYKEY_TABLEN; i++)
{ {
g_functab[i] = &sticky_shoes; g_functab[i] = &sticky_shoes;
} }