Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,18 @@ xcuserdata/
/game/assets/misc/vignette.png
/game/assets/misc/shadow.png
/game/assets/misc/pumpkinblur.png
/game/assets/environment/rain.png
/game/assets/environment/snow.png
/game/assets/item/boat.png
/game/assets/item/cart.png
/game/assets/item/door.png
/game/assets/mob/ghast.png
/game/assets/mob/ghast_fire.png
/game/assets/mob/pigman.png
/game/assets/mob/saddle.png
/game/assets/mob/slime.png
/game/assets/mob/spider_eyes.png
/game/assets/mob/squid.png

# Ignore the panorama textures. Adding them yourself will make the title screen use them.
/game/assets/gui/background/panorama_0.png
Expand Down Expand Up @@ -256,3 +268,4 @@ xcuserdata/
# PCM sound extraction
/tools/__pycache__
/tools/venv
/game/assets
Empty file modified game/assets/app/launch/Default-568h@2x.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified game/assets/app/launch/Default-Landscape~ipad.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified game/assets/app/launch/Default.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified game/assets/app/launch/Default@2x.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified game/assets/icon.ico
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion platforms/ios/AppPlatform_iOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AppPlatform_iOS : public AppPlatform
bool doesTextureExist(const std::string& path) const override;
int getUserInputStatus() override;
bool isTouchscreen() const override;
std::string getAssetPath(const std::string &path) const override;
std::string getAssetPath(const std::string& path) const override;
std::string getPatchData() override;
SoundSystem* const getSoundSystem() const override { return m_pSoundSystem; }

Expand Down
2 changes: 1 addition & 1 deletion platforms/ios/AppPlatform_iOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "common/Utils.hpp"

#include "platforms/openal/SoundSystemAL.hpp"
#include "platforms/sound/openal/CustomSoundSystem.hpp"

AppPlatform_iOS::AppPlatform_iOS(minecraftpeViewController *viewController)
{
Expand Down
3 changes: 3 additions & 0 deletions platforms/ios/minecraftpeViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ - (void)viewDidLoad
//_keyboardView = [[ShowKeyboardView alloc] init];
[super viewDidLoad];

// Setup logging
Logger::setSingleton(new Logger);

//EAGLContext *aContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
//
//if (!aContext)
Expand Down
1,648 changes: 1,606 additions & 42 deletions platforms/macos/projects/Minecraft/Minecraft.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions platforms/windows/projects/Client/Client.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,9 @@
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\PigRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\SheepFurRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\SheepRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\SkeletonRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\SpiderRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\ZombieRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\RocketRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\ArrowRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\ControllerMoveInput.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\MouseBuildInput.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\Lighting.hpp" />
Expand Down Expand Up @@ -293,19 +292,18 @@
<ClCompile Include="$(MC_ROOT)\source\client\model\SheepModel.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\model\SkeletonModel.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\model\SpiderModel.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\model\ZombieModel.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\ChickenRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\CowRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\CreeperRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\PigRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\SheepFurRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\SheepRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\SkeletonRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\SpiderRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\ZombieRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\RocketRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\ArrowRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\MouseBuildInput.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\Lighting.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\model\ZombieModel.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.vcxproj">
Expand Down
24 changes: 9 additions & 15 deletions platforms/windows/projects/Client/Client.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,9 @@
<ClInclude Include="$(MC_ROOT)\source\client\gui\components\OptionList.hpp">
<Filter>Header Files\GUI\Components</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\ZombieRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\SpiderRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\SkeletonRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\SheepRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
Expand Down Expand Up @@ -467,6 +461,9 @@
<ClInclude Include="$(MC_ROOT)\source\client\sound\music_list.h">
<Filter>Header Files\Sound</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\ArrowRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MC_ROOT)\source\client\gui\components\AvailableGamesList.cpp">
Expand Down Expand Up @@ -796,12 +793,6 @@
<ClCompile Include="$(MC_ROOT)\source\client\model\SpiderModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\client\model\ZombieModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\ZombieRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\ChickenRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
Expand All @@ -820,9 +811,6 @@
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\SheepRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\SkeletonRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\SpiderRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
Expand All @@ -841,5 +829,11 @@
<ClCompile Include="$(MC_ROOT)\source\client\renderer\Lighting.cpp">
<Filter>Source Files\Renderer</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\client\model\ZombieModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\ArrowRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions platforms/windows/projects/World/World.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@
<ClCompile Include="$(MC_ROOT)\source\world\entity\EntityType.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\EntityTypeDescriptor.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\MobCategory.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\Arrow.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\Skeleton.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\Spider.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\Zombie.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MC_ROOT)\source\world\entity\Entity.hpp" />
Expand Down Expand Up @@ -296,6 +300,10 @@
<ClInclude Include="$(MC_ROOT)\source\world\entity\Sheep.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\SynchedEntityData.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\MobCategory.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\Arrow.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\Skeleton.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\Spider.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\Zombie.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
24 changes: 24 additions & 0 deletions platforms/windows/projects/World/World.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,18 @@
<ClCompile Include="$(MC_ROOT)\source\world\entity\EntityType.cpp">
<Filter>Source Files\Entity</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\world\entity\Zombie.cpp">
<Filter>Source Files\Entity</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\world\entity\Spider.cpp">
<Filter>Source Files\Entity</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\world\entity\Skeleton.cpp">
<Filter>Source Files\Entity</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\world\entity\Arrow.cpp">
<Filter>Source Files\Entity</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MC_ROOT)\source\world\entity\Entity.hpp">
Expand Down Expand Up @@ -871,5 +883,17 @@
<ClInclude Include="$(MC_ROOT)\source\world\entity\EntityType.hpp">
<Filter>Header Files\Entity</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\source\world\entity\Zombie.hpp">
<Filter>Header Files\Entity</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\source\world\entity\Spider.hpp">
<Filter>Header Files\Entity</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\source\world\entity\Skeleton.hpp">
<Filter>Header Files\Entity</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\source\world\entity\Arrow.hpp">
<Filter>Header Files\Entity</Filter>
</ClInclude>
</ItemGroup>
</Project>
8 changes: 5 additions & 3 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ add_library(reminecraftpe-core STATIC
client/renderer/entity/EntityRenderDispatcher.cpp
client/renderer/entity/HumanoidMobRenderer.cpp
client/renderer/entity/SpiderRenderer.cpp
client/renderer/entity/ZombieRenderer.cpp
client/renderer/entity/SkeletonRenderer.cpp
client/renderer/entity/ArrowRenderer.cpp
client/renderer/entity/SheepRenderer.cpp
client/renderer/entity/SheepFurRenderer.cpp
client/renderer/entity/CreeperRenderer.cpp
client/renderer/entity/CowRenderer.cpp
client/renderer/entity/PigRenderer.cpp
client/renderer/entity/SheepRenderer.cpp
client/renderer/entity/ChickenRenderer.cpp
client/renderer/entity/RocketRenderer.cpp
client/renderer/RenderList.cpp
Expand Down Expand Up @@ -184,6 +182,10 @@ add_library(reminecraftpe-core STATIC
world/entity/ItemEntity.cpp
world/entity/PathfinderMob.cpp
world/entity/Animal.cpp
world/entity/Skeleton.cpp
world/entity/Spider.cpp
world/entity/Zombie.cpp
world/entity/Arrow.cpp
world/entity/WaterAnimal.cpp
world/entity/Monster.cpp
world/entity/Rocket.cpp
Expand Down
34 changes: 33 additions & 1 deletion source/client/app/AppPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/

#include <fstream>

#include "AppPlatform.hpp"
#include "common/Utils.hpp"

Expand Down Expand Up @@ -234,7 +236,37 @@ std::string AppPlatform::getPatchData()

AssetFile AppPlatform::readAssetFile(const std::string& path, bool quiet) const
{
return AssetFile();
std::string realPath = getAssetPath(path);
std::ifstream ifs(realPath.c_str());

// Open File
if (!ifs.is_open())
{
if (!quiet) LOG_W("Couldn't find asset file: %s", realPath.c_str());
return AssetFile();
}

std::filebuf* pbuf = ifs.rdbuf();

// Get File Size
std::streamoff size = pbuf->pubseekoff(0, ifs.end, ifs.in);
pbuf->pubseekpos(0, ifs.in);
if (size < 0)
{
if (!quiet) LOG_E("Error determining the size of the asset file!");
ifs.close();
return AssetFile();
}

// Read Data
char *buf = new char[size];
pbuf->sgetn(buf, (std::streamsize)size);

// Close File
ifs.close();

// Return
return AssetFile((int64_t)size, (unsigned char*)buf);
}

void AppPlatform::initSoundSystem()
Expand Down
5 changes: 5 additions & 0 deletions source/client/model/HumanoidModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@ HumanoidModel::HumanoidModel(float a, float b):

m_head.addBox(-4, -8, -4, 8, 8, 8, a);
m_head.setPos(0, b, 0);

m_body.addBox(-4, 0, -2, 8, 12, 4);
m_body.setPos(0, b, 0);

m_arm1.addBox(-3, -2, -2, 4, 12, 4, a);
m_arm1.setPos(-5, b + 2, 0);

m_arm2.m_bMirror = true;
m_arm2.addBox(-1, -2, -2, 4, 12, 4, a);
m_arm2.setPos(5, b + 2, 0);

m_leg1.addBox(-2, 0, -2, 4, 12, 4, a);
m_leg1.setPos(-2, b + 12, 0);

m_leg2.m_bMirror = true;
m_leg2.addBox(-2, 0, -2, 4, 12, 4, a);
m_leg2.setPos(2, b + 12, 0);
Expand Down
27 changes: 27 additions & 0 deletions source/client/model/SkeletonModel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include "SkeletonModel.hpp"

SkeletonModel::SkeletonModel() : ZombieModel()
{
m_arm1.clear();
m_arm2.clear();
m_leg1.clear();
m_leg2.clear();

m_arm1.addBox(-1.0f, -2.0f, -1.0f, 2, 12, 2, 0.0f);
m_arm1.setPos(-5.0f, 2.0f, 0.0f);

m_arm2.m_bMirror = true;
m_arm2.addBox(-1.0f, -2.0f, -1.0f, 2, 12, 2, 0.0f);
m_arm2.setPos(5.0f, 2.0f, 0.0f);

m_leg1.addBox(-1.0f, 0.0f, -1.0f, 2, 12, 2, 0.0f);
m_leg1.setPos(-2.0f, 12.0f, 0.0f);

m_leg2.m_bMirror = true;
m_leg2.addBox(-1.0f, 0.0f, -1.0f, 2, 12, 2, 0.0f);
m_leg2.setPos(2.0f, 12.0f, 0.0f);
}

SkeletonModel::~SkeletonModel()
{
}
10 changes: 10 additions & 0 deletions source/client/model/SkeletonModel.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once

#include "ZombieModel.hpp"

class SkeletonModel : public ZombieModel
{
public:
SkeletonModel();
~SkeletonModel();
};
Loading