Remove WinAPI types from tutorial helpers

This commit is contained in:
notmatthewbeshay 2026-03-14 06:44:08 +11:00
parent 6e2f40f581
commit ff592ca6a1
4 changed files with 19 additions and 13 deletions

View file

@ -9,7 +9,7 @@
#include "../../Minecraft.Client/Network/ClientConnection.h"
#include "../../Minecraft.World/Headers/net.minecraft.network.packet.h"
ChangeStateConstraint::ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], DWORD sourceStatesCount,
ChangeStateConstraint::ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], std::size_t sourceStatesCount,
double x0, double y0, double z0, double x1, double y1, double z1, bool contains /*= true*/, bool changeGameMode /*= false*/, GameType *targetGameMode /*= 0*/ )
: TutorialConstraint( -1 )
{
@ -73,7 +73,7 @@ void ChangeStateConstraint::tick(int iPad)
bool inASourceState = false;
Minecraft *minecraft = Minecraft::GetInstance();
for(DWORD i = 0; i < m_sourceStatesCount; ++i)
for(std::size_t i = 0; i < m_sourceStatesCount; ++i)
{
if(m_sourceStates[i] == m_tutorial->getCurrentState())
{

View file

@ -3,6 +3,8 @@
#include "TutorialEnum.h"
#include "TutorialConstraint.h"
#include <cstddef>
class AABB;
class Tutorial;
class GameType;
@ -18,7 +20,7 @@ private:
eTutorial_State m_targetState;
eTutorial_State *m_sourceStates;
DWORD m_sourceStatesCount;
std::size_t m_sourceStatesCount;
bool m_bHasChanged;
eTutorial_State m_changedFromState;
@ -30,8 +32,8 @@ private:
public:
virtual ConstraintType getType() { return e_ConstraintChangeState; }
ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], DWORD sourceStatesCount, double x0, double y0, double z0, double x1, double y1, double z1, bool contains = true, bool changeGameMode = false, GameType *targetGameMode = NULL );
ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], std::size_t sourceStatesCount, double x0, double y0, double z0, double x1, double y1, double z1, bool contains = true, bool changeGameMode = false, GameType *targetGameMode = NULL );
~ChangeStateConstraint();
virtual void tick(int iPad);
};
};

View file

@ -6,6 +6,8 @@
#include "TutorialMessage.h"
#include "TutorialEnum.h"
#include <cstdint>
// #define TUTORIAL_HINT_DELAY_TIME 14000 // How long we should wait from displaying one hint to the next
// #define TUTORIAL_DISPLAY_MESSAGE_TIME 7000
// #define TUTORIAL_MINIMUM_DISPLAY_MESSAGE_TIME 2000
@ -93,8 +95,8 @@ protected:
//D3DXVECTOR3 m_OriginalPosition;
public:
DWORD lastMessageTime;
DWORD m_lastHintDisplayedTime;
std::uint32_t lastMessageTime;
std::uint32_t m_lastHintDisplayedTime;
private:
PopupMessageDetails *m_lastMessage;

View file

@ -1,14 +1,16 @@
#pragma once
#include <cstdint>
typedef struct {
WORD index;
DWORD diffsSize;
BYTE *diffs;
DWORD lastByteChanged;
std::uint16_t index;
std::uint32_t diffsSize;
std::uint8_t *diffs;
std::uint32_t lastByteChanged;
} TutorialDiff_Chunk;
typedef struct {
DWORD diffCount;
std::uint32_t diffCount;
TutorialDiff_Chunk *diffs;
} TutorialDiff_File;
@ -326,4 +328,4 @@ enum eTutorial_CompletionAction
e_Tutorial_Completion_Complete_State, // This will make the current tutorial state complete
e_Tutorial_Completion_Complete_State_Gameplay_Constraints, // This will make the current tutorial state complete, and move the delayed constraints to the gameplay state
e_Tutorial_Completion_Jump_To_Last_Task,
};
};