Make getangle() a __fastcall function instead of static inline.

This trims four 4k pages of code from the release EDuke32 build and
one page from Mapster32.

git-svn-id: https://svn.eduke32.com/eduke32@2991 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-09-02 14:12:01 +00:00
parent 1fdc464568
commit 72b73f6356
2 changed files with 12 additions and 13 deletions

View file

@ -685,7 +685,7 @@ int32_t checksectorpointer(int16_t i, int16_t sectnum);
void getmousevalues(int32_t *mousx, int32_t *mousy, int32_t *bstatus) ATTRIBUTE((nonnull(1,2,3))); void getmousevalues(int32_t *mousx, int32_t *mousy, int32_t *bstatus) ATTRIBUTE((nonnull(1,2,3)));
int32_t krand(void); int32_t krand(void);
int32_t ksqrt(uint32_t num); int32_t ksqrt(uint32_t num);
// int32_t getangle(int32_t xvect, int32_t yvect); int32_t __fastcall getangle(int32_t xvect, int32_t yvect);
// //
// getangle // getangle
@ -698,18 +698,6 @@ static inline uint32_t uhypsq(int32_t dx, int32_t dy)
return (uint32_t)dx*dx + (uint32_t)dy*dy; return (uint32_t)dx*dx + (uint32_t)dy*dy;
} }
static inline int32_t getangle(int32_t xvect, int32_t yvect)
{
if ((xvect|yvect) == 0) return(0);
if (xvect == 0) return 512+((yvect<0)<<10);
if (yvect == 0) return ((xvect<0)<<10);
if (xvect == yvect) return 256+((xvect<0)<<10);
if (xvect == -yvect) return 768+((xvect>0)<<10);
if (klabs(xvect) > klabs(yvect))
return ((radarang[640+scale(160,yvect,xvect)]>>6)+((xvect<0)<<10))&2047;
return ((radarang[640-scale(160,xvect,yvect)]>>6)+512+((yvect<0)<<10))&2047;
}
void rotatepoint(int32_t xpivot, int32_t ypivot, int32_t x, int32_t y, void rotatepoint(int32_t xpivot, int32_t ypivot, int32_t x, int32_t y,
int16_t daang, int32_t *x2, int32_t *y2) ATTRIBUTE((nonnull(6,7))); int16_t daang, int32_t *x2, int32_t *y2) ATTRIBUTE((nonnull(6,7)));
int32_t lastwall(int16_t point); int32_t lastwall(int16_t point);

View file

@ -11019,6 +11019,17 @@ int32_t inside(int32_t x, int32_t y, int16_t sectnum)
return(cnt>>31); return(cnt>>31);
} }
__fastcall int32_t getangle(int32_t xvect, int32_t yvect)
{
if ((xvect|yvect) == 0) return(0);
if (xvect == 0) return 512+((yvect<0)<<10);
if (yvect == 0) return ((xvect<0)<<10);
if (xvect == yvect) return 256+((xvect<0)<<10);
if (xvect == -yvect) return 768+((xvect>0)<<10);
if (klabs(xvect) > klabs(yvect))
return ((radarang[640+scale(160,yvect,xvect)]>>6)+((xvect<0)<<10))&2047;
return ((radarang[640-scale(160,xvect,yvect)]>>6)+512+((yvect<0)<<10))&2047;
}
// //
// ksqrt // ksqrt