Skip to content

Commit

Permalink
Added njDrawSprite2D and njDrawSprite3D.
Browse files Browse the repository at this point in the history
Renamed sin/cos/tan functions.
  • Loading branch information
michael-fadely committed Jan 2, 2016
1 parent 171c9f7 commit a1d8b18
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SADXModLoader/FixFOV.cpp
Expand Up @@ -53,7 +53,7 @@ static void __cdecl SetClippingRelatedThing_hook(int bams)
double m = (double)bams_default / bams;
bams = (int)(fov_bams / m);

double tan = BAMStan(bams / 2) * 2;
double tan = njTan(bams / 2) * 2;
ClippingRelated = (float)((double)VerticalResolution / tan);
}

Expand Down
23 changes: 20 additions & 3 deletions SADXModLoader/include/SADXModLoader/SADXFunctions.h
Expand Up @@ -343,9 +343,26 @@ VoidFunc(InitSonicAnimData, 0x7CEC90);
VoidFunc(InitEC0NPCData, 0x7D2720);
VoidFunc(InitEC3NPCData, 0x7D2CF0);
VoidFunc(InitSSNPCData, 0x7D5810);
FastcallFunctionPointer(double, BAMSsin, (int bams), 0x00788290);
FastcallFunctionPointer(double, BAMScos, (int bams), 0x007883C0);
ThiscallFunctionPointer(double, BAMStan, (int bams), 0x00787E30);
FastcallFunctionPointer(Float, njSin, (Angle n), 0x00788290);
FastcallFunctionPointer(Float, njCos, (Angle n), 0x007883C0);
ThiscallFunctionPointer(Float, njTan, (Angle n), 0x00787E30);
/// <summary>
/// Draws 2D sprite with animations if available.
/// </summary>
/// <param name="sp">Pointer for sprite structure.</param>
/// <param name="n">Sprite number.</param>
/// <param name="pri">Priority (Z value). Can be -1.0 through -65535.0.</param>
/// <param name="attr">Attributes. See the <c>NJD_SPRITE_*</c> preprocessor definitions in ninja.h.</param>
FunctionPointer(void, njDrawSprite2D, (NJS_SPRITE* sp, Int n, Float pri, Uint32 attr), 0x00407070);

/// <summary>
/// Draws a sprite in 3D space.
/// </summary>
/// <param name="sp">Pointer for sprite structure.</param>
/// <param name="n">Sprite number.</param>
/// <param name="attr">Attributes. <c>NJD_SPRITE_SCALE</c> makes the sprite always face the camera.</param>
FunctionPointer(void, njDrawSprite3D, (NJS_SPRITE* sp, Int n, Uint32 attr), 0x0077E050);


#ifdef _MSC_VER

Expand Down

0 comments on commit a1d8b18

Please sign in to comment.