* Add CowRenderer

This commit is contained in:
iProgramInCpp 2023-12-05 21:12:05 +02:00
parent 5882d2dc7f
commit efebfdd122
8 changed files with 235 additions and 4 deletions

View file

@ -320,8 +320,24 @@
<ClInclude Include="$(MC_ROOT)\source\client\renderer\FoliageColor.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\GrassColor.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\components\OptionList.hpp" />
<ClInclude Include="..\..\..\..\source\client\model\ChickenModel.hpp" />
<ClInclude Include="..\..\..\..\source\client\model\CowModel.hpp" />
<ClInclude Include="..\..\..\..\source\client\model\CreeperModel.hpp" />
<ClInclude Include="..\..\..\..\source\client\model\PigModel.hpp" />
<ClInclude Include="..\..\..\..\source\client\model\SheepFurModel.hpp" />
<ClInclude Include="..\..\..\..\source\client\model\SheepModel.hpp" />
<ClInclude Include="..\..\..\..\source\client\model\SkeletonModel.hpp" />
<ClInclude Include="..\..\..\..\source\client\model\SpiderModel.hpp" />
<ClInclude Include="..\..\..\..\source\client\model\ZombieModel.hpp" />
<ClInclude Include="..\..\..\..\source\client\renderer\entity\ChickenRenderer.hpp" />
<ClInclude Include="..\..\..\..\source\client\renderer\entity\CowRenderer.hpp" />
<ClInclude Include="..\..\..\..\source\client\renderer\entity\CreeperRenderer.hpp" />
<ClInclude Include="..\..\..\..\source\client\renderer\entity\PigRenderer.hpp" />
<ClInclude Include="..\..\..\..\source\client\renderer\entity\SheepFurRenderer.hpp" />
<ClInclude Include="..\..\..\..\source\client\renderer\entity\SheepRenderer.hpp" />
<ClInclude Include="..\..\..\..\source\client\renderer\entity\SkeletonRenderer.hpp" />
<ClInclude Include="..\..\..\..\source\client\renderer\entity\SpiderRenderer.hpp" />
<ClInclude Include="..\..\..\..\source\client\renderer\entity\ZombieRenderer.hpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MC_ROOT)\source\client\app\App.cpp" />
@ -422,8 +438,24 @@
<ClCompile Include="$(MC_ROOT)\source\client\renderer\FoliageColor.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\GrassColor.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\components\OptionList.cpp" />
<ClCompile Include="..\..\..\..\source\client\model\ChickenModel.cpp" />
<ClCompile Include="..\..\..\..\source\client\model\CowModel.cpp" />
<ClCompile Include="..\..\..\..\source\client\model\CreeperModel.cpp" />
<ClCompile Include="..\..\..\..\source\client\model\PigModel.cpp" />
<ClCompile Include="..\..\..\..\source\client\model\SheepFurModel.cpp" />
<ClCompile Include="..\..\..\..\source\client\model\SheepModel.cpp" />
<ClCompile Include="..\..\..\..\source\client\model\SkeletonModel.cpp" />
<ClCompile Include="..\..\..\..\source\client\model\SpiderModel.cpp" />
<ClCompile Include="..\..\..\..\source\client\model\ZombieModel.cpp" />
<ClCompile Include="..\..\..\..\source\client\renderer\entity\ChickenRenderer.cpp" />
<ClCompile Include="..\..\..\..\source\client\renderer\entity\CowRenderer.cpp" />
<ClCompile Include="..\..\..\..\source\client\renderer\entity\CreeperRenderer.cpp" />
<ClCompile Include="..\..\..\..\source\client\renderer\entity\PigRenderer.cpp" />
<ClCompile Include="..\..\..\..\source\client\renderer\entity\SheepFurRenderer.cpp" />
<ClCompile Include="..\..\..\..\source\client\renderer\entity\SheepRenderer.cpp" />
<ClCompile Include="..\..\..\..\source\client\renderer\entity\SkeletonRenderer.cpp" />
<ClCompile Include="..\..\..\..\source\client\renderer\entity\SpiderRenderer.cpp" />
<ClCompile Include="..\..\..\..\source\client\renderer\entity\ZombieRenderer.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.vcxproj">

View file

@ -386,6 +386,54 @@
<ClInclude Include="..\..\..\..\source\client\renderer\entity\PigRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\model\CreeperModel.hpp">
<Filter>Header Files\Model</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\model\CowModel.hpp">
<Filter>Header Files\Model</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\model\ChickenModel.hpp">
<Filter>Header Files\Model</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\model\SheepFurModel.hpp">
<Filter>Header Files\Model</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\model\SheepModel.hpp">
<Filter>Header Files\Model</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\model\SkeletonModel.hpp">
<Filter>Header Files\Model</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\model\SpiderModel.hpp">
<Filter>Header Files\Model</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\model\ZombieModel.hpp">
<Filter>Header Files\Model</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\renderer\entity\CreeperRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\renderer\entity\CowRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\renderer\entity\ChickenRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\renderer\entity\SheepFurRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\renderer\entity\SheepRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\renderer\entity\SkeletonRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\renderer\entity\SpiderRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\source\client\renderer\entity\ZombieRenderer.hpp">
<Filter>Header Files\Renderer\Entity</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MC_ROOT)\source\client\gui\components\AvailableGamesList.cpp">
@ -688,5 +736,53 @@
<ClCompile Include="..\..\..\..\source\client\renderer\entity\PigRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\model\CreeperModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\model\SheepFurModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\model\SheepModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\model\SkeletonModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\model\SpiderModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\model\ZombieModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\model\ChickenModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\model\CowModel.cpp">
<Filter>Source Files\Model</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\renderer\entity\SheepRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\renderer\entity\SkeletonRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\renderer\entity\SpiderRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\renderer\entity\ZombieRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\renderer\entity\ChickenRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\renderer\entity\CowRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\renderer\entity\CreeperRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\source\client\renderer\entity\SheepFurRenderer.cpp">
<Filter>Source Files\Renderer\Entity</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -0,0 +1,47 @@
/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#include "CowModel.hpp"
CowModel::CowModel() :
QuadrupedModel(12, 0.0f)
{
m_head = ModelPart(0, 0);
m_head.setModel(this);
// head
m_head.addBox(-4, -4, -6, 8, 8, 6);
m_head.setPos(0, 4, -8);
// horns
m_head.texOffs(22, 0);
m_head.addBox(-5, -5, -4, 1, 3, 1);
m_head.texOffs(22, 0);
m_head.addBox(4, -5, -4, 1, 3, 1);
m_body = ModelPart(18, 4);
m_body.setModel(this);
// torso
m_body.addBox(-6, -10, -7, 12, 18, 10);
m_body.setPos(0, 5, 2);
// udders
m_body.texOffs(52, 0);
m_body.addBox(-2, 2, -8, 4, 6, 1);
m_leg1.m_posX -= 1.0f;
m_leg2.m_posX += 1.0f;
m_leg3.m_posX -= 1.0f;
m_leg4.m_posX += 1.0f;
field_290 += 2.0f;
}
CowModel::~CowModel()
{
}

View file

@ -0,0 +1,17 @@
/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#pragma once
#include "QuadrupedModel.hpp"
class CowModel : public QuadrupedModel
{
public:
CowModel();
~CowModel();
};

View file

@ -0,0 +1,16 @@
/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#include "CowRenderer.hpp"
CowRenderer::CowRenderer(Model* pModel, float f) : MobRenderer(pModel, f)
{
}
CowRenderer::~CowRenderer()
{
}

View file

@ -0,0 +1,17 @@
/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#pragma once
#include "MobRenderer.hpp"
class CowRenderer : public MobRenderer
{
public:
CowRenderer(Model*, float);
~CowRenderer();
};

View file

@ -11,13 +11,15 @@
#include "../ItemInHandRenderer.hpp"
#include "client/model/PigModel.hpp"
#include "client/model/CowModel.hpp"
EntityRenderDispatcher* EntityRenderDispatcher::instance;
float EntityRenderDispatcher::xOff, EntityRenderDispatcher::yOff, EntityRenderDispatcher::zOff;
EntityRenderDispatcher::EntityRenderDispatcher() :
m_HumanoidMobRenderer(new HumanoidModel(0.0f, 0.0f), 0.0f),
m_PigRenderer(new PigModel(0.0f), 0.0f)
m_PigRenderer(new PigModel(0.0f), 0.0f),
m_CowRenderer(new CowModel, 0.0f)
{
m_pItemInHandRenderer = nullptr;
m_pTextures = nullptr;
@ -31,6 +33,7 @@ EntityRenderDispatcher::EntityRenderDispatcher() :
m_HumanoidMobRenderer.init(this);
m_PigRenderer.init(this);
m_CowRenderer.init(this);
// TODO
@ -71,12 +74,14 @@ EntityRenderer* EntityRenderDispatcher::getRenderer(int renderType)
{
case RENDER_TNT:
return &m_TntRenderer;
case RENDER_HUMANOID:
return &m_HumanoidMobRenderer;
case RENDER_ITEM:
return &m_ItemRenderer;
case RENDER_CAMERA:
return &m_CameraRenderer;
case RENDER_HUMANOID:
return &m_HumanoidMobRenderer;
case RENDER_COW:
return &m_CowRenderer;
case RENDER_PIG:
return &m_PigRenderer;
// TODO

View file

@ -15,6 +15,7 @@
#include "ItemRenderer.hpp"
#include "FallingTileRenderer.hpp"
#include "PigRenderer.hpp"
#include "CowRenderer.hpp"
class Minecraft;
class Font;
@ -44,7 +45,7 @@ public:
ItemInHandRenderer* m_pItemInHandRenderer;
HumanoidMobRenderer m_HumanoidMobRenderer;
PigRenderer m_PigRenderer;
//CowRenderer m_CowRenderer;
CowRenderer m_CowRenderer;
//ChickenRenderer m_ChickenRenderer;
TntRenderer m_TntRenderer;
//padding??