diff --git a/src/kshape.c b/src/kshape.c index 16df603..cdb49be 100644 --- a/src/kshape.c +++ b/src/kshape.c @@ -4396,7 +4396,7 @@ extern void TranslationSetup(void) } -#if 0 +#ifndef LINUX #ifndef _MSC_VER void TranslatePoint(int *source, int *dest, int *matrix); #pragma aux TranslatePoint = \ @@ -4496,6 +4496,13 @@ void TranslatePoint(int *source, int *dest, int *matrix) } #endif +#else /* LINUX */ +static void TranslatePoint(const float *source, float *dest, const float *matrix) +{ + dest[0] = matrix[ 0] * source[0] + matrix[ 1] * source[1] + matrix[ 2] * source[2] + matrix[ 3]; + dest[1] = matrix[ 4] * source[0] + matrix[ 5] * source[1] + matrix[ 6] * source[2] + matrix[ 7]; + dest[2] = matrix[ 8] * source[0] + matrix[ 9] * source[1] + matrix[10] * source[2] + matrix[11]; +} #endif void TranslatePointIntoViewspace(VECTORCH *pointPtr) diff --git a/src/kshape.h b/src/kshape.h index a3434ef..0580fd4 100644 --- a/src/kshape.h +++ b/src/kshape.h @@ -94,8 +94,6 @@ extern int FindHeatSourcesInHModel(DISPLAYBLOCK *dispPtr); extern void TranslationSetup(void); extern void TranslatePointIntoViewspace(VECTORCH *pointPtr); -void TranslatePoint(float *source, float *dest, float *matrix); - extern void CheckRenderStatesForModule(MODULE *modulePtr); diff --git a/src/mathline.c b/src/mathline.c index 3416800..50e48a8 100644 --- a/src/mathline.c +++ b/src/mathline.c @@ -209,22 +209,22 @@ int CMP_LL(LONGLONGCH *a, LONGLONGCH *b) llgs: } */ -#if 0 -int retval; -/* TODO */ +#if 1 + int retval; + __asm__("movl 0(%%ebx), %%eax \n\t" "movl 4(%%ebx), %%edx \n\t" "subl 0(%%ecx), %%eax \n\t" "sbbl 4(%%ecx), %%edx \n\t" "xorl %%ebx, %%ebx \n\t" "andl %%edx, %%edx \n\t" - "jne 0 \n\t" /* llnz */ + "jne 0f \n\t" /* llnz */ "andl %%eax, %%eax \n\t" - "je 1 \n" /* llgs */ + "je 1f \n" /* llgs */ "0: \n\t" /* llnz */ "movl $1, %%ebx \n\t" "andl %%edx, %%edx \n\t" - "jge 1 \n\t" /* llgs */ + "jge 1f \n\t" /* llgs */ "negl %%ebx \n" "1: \n\t" /* llgs */ : "=b" (retval) @@ -628,10 +628,9 @@ __asm__ volatile #endif } +#if 0 // SBF - converted to C in kshape.c void TranslatePoint(float *source, float *dest, float *matrix) { -// fprintf(stderr, "TranslatePoint(%f, %f, %f)\n"); - /* TODO - implement the inline assembly here? */ /* Moved it to a separate file because I can't figure out the damn syntax! */ /* This is currently not inlined for testing */ @@ -640,3 +639,4 @@ __asm__("call TranslatePoint_Asm \n\t" : "S" (source), "b" (dest), "D" (matrix) ); } +#endif