WIP Android Port (#79)

* WIP Android Port

Android port. Still needs touch controls and mouse turning (if that's even possible on android) and file saving and SoundSystemSL
You control the camera and movement with your controller for now. You can navigate the gui using touch.
Options.cpp,LocalPlayer.cpp,Minecraft.cpp is configured to use controller.
Blocked out some code in ControllerTurnInput.cpp,Controller.cpp that didn't make sense.

* Fix glClear

glClear is supossed to use GL_DEPTH_BUFFER_BIT (thx TheBrokenRail)

* * Fix build.

* * Ignore assets.

* * More stuff

* * Fix more build errors.

* * It finally built

What I needed to do is rebuild the debug keystore because apparently android studio created it with sha1 digest alg which isn't supported by ant

* * Clean up filters.

* * Add cramped mode to the pause screen.

* * Fix a bug with the hotbar

* * In NinecraftApp::handleBack, pause the game if there is no screen.

* * AppPlatform_android: Add placeholder SoundSystem instance till we get SoundSystemSL working

* * Add properly working touch code.

* * Oh, remove some testing things

* * Fix state resetting when going in background and back in foreground
* Fix bug where the sky isn't being regenerated on graphics reset
* Fix bug where the m_currBoundTex isn't reset in Textures::clear potentially leaving a texture with that ID unassigned and corrupted
* Fix bug in CThread where the thread is detached and then also joined.
* Don't log anything if the program isn't in debug mode.

* * Add virtual keyboard support.

The screen instance slides so that the focused text box is kept visible.

* Rename from com.minecraftcpp to com.reminecraftpe

---------

Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com>
This commit is contained in:
f
2023-11-03 11:54:39 +01:00
committed by GitHub
parent f119d89048
commit f83ead9f8d
59 changed files with 5742 additions and 424 deletions

View File

@@ -58,8 +58,8 @@ public:
LoginPacket(const std::string& uname) { m_str = RakNet::RakString(uname.c_str()); }
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
RakNet::RakString m_str;
};
@@ -74,8 +74,8 @@ public:
}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
RakNet::RakString m_str;
};
@@ -89,8 +89,8 @@ public:
m_time = 0;
}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
TLong field_4;
int field_8;
@@ -108,8 +108,8 @@ public:
AddPlayerPacket() {}
AddPlayerPacket(const RakNet::RakNetGUID& guid, RakNet::RakString name, int id, float x, float y, float z);
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int field_4;
RakNet::RakNetGUID m_guid;
@@ -128,8 +128,8 @@ public:
RemoveEntityPacket(int id) { m_id = id; }
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_id;
};
@@ -140,8 +140,8 @@ public:
MovePlayerPacket() {}
MovePlayerPacket(int id, float x, float y, float z, float pitch, float yaw): m_id(id), m_x(x), m_y(y), m_z(z), m_pitch(pitch), m_yaw(yaw) {}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_id;
float m_x;
@@ -166,8 +166,8 @@ public:
}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_playerID;
int m_x;
@@ -184,8 +184,8 @@ public:
RemoveBlockPacket(int id, int x, int y, int z) :m_playerID(id), m_x(x), m_z(z), m_y(uint8_t(y)) {}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_playerID;
int m_x;
@@ -197,8 +197,8 @@ class UpdateBlockPacket : public Packet
{
public:
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_x;
int m_z;
@@ -213,8 +213,8 @@ public:
RequestChunkPacket() {}
RequestChunkPacket(int x, int z) { m_x = x; m_z = z; }
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_x;
int m_z;
@@ -226,8 +226,8 @@ public:
ChunkDataPacket() {}
ChunkDataPacket(int x, int z, LevelChunk* c) :m_x(x), m_z(z), m_pChunk(c) {}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_x;
int m_z;
@@ -241,8 +241,8 @@ public:
LevelDataPacket() {}
LevelDataPacket(Level* level) : m_pLevel(level) {}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
RakNet::BitStream m_data;
Level* m_pLevel;
@@ -254,8 +254,8 @@ public:
PlayerEquipmentPacket() {}
PlayerEquipmentPacket(int playerID, int itemID): m_playerID(playerID), m_itemID(itemID) {}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_playerID;
uint8_t m_itemID;