* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a4399472.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
70 lines
1.2 KiB
C++
70 lines
1.2 KiB
C++
#include "stdafx.h"
|
|
#include <iostream>
|
|
#include "InputOutputStream.h"
|
|
#include "PacketListener.h"
|
|
#include "PlayerInputPacket.h"
|
|
|
|
|
|
|
|
PlayerInputPacket::PlayerInputPacket()
|
|
{
|
|
xxa = 0.0f;
|
|
yya = 0.0f;
|
|
isJumpingVar = false;
|
|
isSneakingVar = false;
|
|
}
|
|
|
|
PlayerInputPacket::PlayerInputPacket(float xxa, float yya, bool isJumpingVar, bool isSneakingVar)
|
|
{
|
|
this->xxa = xxa;
|
|
this->yya = yya;
|
|
this->isJumpingVar = isJumpingVar;
|
|
this->isSneakingVar = isSneakingVar;
|
|
}
|
|
|
|
void PlayerInputPacket::read(DataInputStream *dis) //throws IOException
|
|
{
|
|
xxa = dis->readFloat();
|
|
yya = dis->readFloat();
|
|
isJumpingVar = dis->readBoolean();
|
|
isSneakingVar = dis->readBoolean();
|
|
}
|
|
|
|
void PlayerInputPacket::write(DataOutputStream *dos) //throws IOException
|
|
{
|
|
dos->writeFloat(xxa);
|
|
dos->writeFloat(yya);
|
|
dos->writeBoolean(isJumpingVar);
|
|
dos->writeBoolean(isSneakingVar);
|
|
}
|
|
|
|
void PlayerInputPacket::handle(PacketListener *listener)
|
|
{
|
|
listener->handlePlayerInput(shared_from_this());
|
|
}
|
|
|
|
int PlayerInputPacket::getEstimatedSize()
|
|
{
|
|
return 10;
|
|
}
|
|
|
|
float PlayerInputPacket::getXxa()
|
|
{
|
|
return xxa;
|
|
}
|
|
|
|
float PlayerInputPacket::getYya()
|
|
{
|
|
return yya;
|
|
}
|
|
|
|
bool PlayerInputPacket::isJumping()
|
|
{
|
|
return isJumpingVar;
|
|
}
|
|
|
|
bool PlayerInputPacket::isSneaking()
|
|
{
|
|
return isSneakingVar;
|
|
}
|