Advertisement
Benji23245

Untitled

Mar 7th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. // Sonic+Miscellaneous.cpp : Defines the exported functions for the DLL application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "SADXModLoader.h"
  6. #include "functions.h"
  7.  
  8. bool just_untransformed = false;
  9. bool gauge2_lv1 = false;
  10. bool gauge2_lv2 = false;
  11. bool gauge2_full = false;
  12. bool sonic_gameplay = false;
  13.  
  14. int Gauge;
  15. int Gauge2;
  16.  
  17. ////////////////////// HUD //////////////////////////////////////////////////////////////////////////
  18.  
  19.  
  20. enum HUDTextureIndex
  21. {
  22. HUD_gauge, HUD_rings_lives, HUD_score_timer,
  23. };
  24.  
  25.  
  26.  
  27. static NJS_TEXNAME HUD_TEXNAME[8];
  28. static NJS_TEXLIST HUD_TEXLIST = { arrayptrandlength(HUD_TEXNAME) }; //MY OWN HUD STUFF
  29.  
  30.  
  31. static NJS_TEXANIM HUD_TEXANIM[] = {
  32. // w, h, cx, cy, u1, v1, u2, v2, texid, attr
  33. // u2 and v2 must be 0xFF
  34. { 24, 16, 0, 0, 0, 0, 0xFF, 0xFF, HUD_gauge, 0 },
  35. { 24, 24, 0, 0, 0, 0, 0xFF, 0xFF, HUD_rings_lives, 0 },
  36. { 24, 24, 0, 0, 0, 0, 0xFF, 0xFF, HUD_score_timer, 0 }
  37. };
  38.  
  39.  
  40. NJS_SPRITE HUD_SPRITE = { { 0.0f, 0.0f, 0.0f }, 1.0f, 1.0f, 0, &HUD_TEXLIST, HUD_TEXANIM };//the three numbers in the brackets are X, Y, and Z position, then X and Y scaling, rotation, texlist, and texanim
  41.  
  42.  
  43.  
  44. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  45.  
  46. extern "C"
  47. {
  48. __declspec(dllexport) ModInfo SADXModInfo = { ModLoaderVer };
  49.  
  50.  
  51. __declspec(dllexport) void Init(const char *path, const HelperFunctions &helperFunctions)
  52. {
  53. Sonic_Init(path, helperFunctions);
  54. Miscellaneous_Init(path, helperFunctions);
  55. }
  56.  
  57. __declspec(dllexport) void OnInput()
  58. {
  59. Sonic_OnInput();
  60. //Miscellaneous_OnInput();
  61. }
  62.  
  63. __declspec(dllexport) void OnFrame()
  64. {
  65. //if (ControllerPointers[0]->PressedButtons & Buttons_Y)
  66. //{
  67. // sonic_gameplay = true;
  68. //}
  69. //if (ControllerPointers[0]->PressedButtons & Buttons_B)
  70. //{
  71. // sonic_gameplay = false;
  72. //}
  73. //if (sonic_gameplay)
  74. //{
  75. // Sonic_OnFrame();
  76. //}
  77. Sonic_OnFrame();
  78. Miscellaneous_OnFrame();
  79. if (GetCharacterObject(0) && GetCharacterID(0) == Characters_Sonic && MetalSonicFlag == 0)
  80. {
  81. njDrawSprite2D_Queue(&HUD_SPRITE, HUD_gauge, -1, 0, (QueuedModelFlagsB)0);
  82. }
  83.  
  84.  
  85. //HUD *******************************************************************************************************************************************
  86.  
  87.  
  88.  
  89. }
  90.  
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement