Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
MapRenderer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/renderer/actor/ActorRenderer.h"
7#include "mc/common/SubClientId.h"
8#include "mc/deps/application/AppPlatformListener.h"
9#include "mc/deps/core/math/Vec2.h"
10#include "mc/deps/core/resource/ResourceLocation.h"
11#include "mc/deps/minecraft_renderer/renderer/MaterialPtr.h"
12#include "mc/deps/minecraft_renderer/renderer/Mesh.h"
13#include "mc/deps/minecraft_renderer/renderer/TexturePtr.h"
14#include "mc/legacy/ActorUniqueID.h"
15
16// auto generated forward declare list
17// clang-format off
18class ActorRenderData;
20class BlockPos;
21class BlockSource;
22class MapDecoration;
24class Player;
25class ScreenContext;
26class Tessellator;
27class Vec3;
28struct Brightness;
30namespace mce { class Color; }
31namespace mce { class TextureGroup; }
32// clang-format on
33
35public:
36 // MapRenderer inner types declare
37 // clang-format off
38 class MapInstance;
39 // clang-format on
40
41 // MapRenderer inner types define
42 class MapInstance {
43 public:
44 // member variables
45 // NOLINTBEGIN
46 ::ll::TypedStorage<4, 4, float const> mArrowRotationConverter;
47 ::ll::TypedStorage<8, 8, ::MapItemSavedData const&> mMapData;
48 ::ll::TypedStorage<1, 1, bool> mDirtyTexture;
49 ::ll::TypedStorage<8, 8, ::MapRenderer&> mMapRenderer;
50 ::ll::TypedStorage<8, 56, ::ResourceLocation> mResourceLocation;
51 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mMapTexture;
52 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMarkerMaterial;
53 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mDecorationMaterial;
54 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mNameTagMaterial;
55 ::ll::TypedStorage<4, 8, ::Vec2> playerM;
56 ::ll::TypedStorage<4, 4, float> overlap_dist;
57 // NOLINTEND
58
59 public:
60 // prevent constructor by default
61 MapInstance& operator=(MapInstance const&);
62 MapInstance(MapInstance const&);
63 MapInstance();
64
65 public:
66 // member functions
67 // NOLINTBEGIN
69 ::ScreenContext& screenContext,
70 ::mce::Color const& color,
71 float zOffset,
72 ::OffscreenCaptureDescription const& offscreenCaptureDescription
73 );
74
75 MCNAPI bool _renderFaceIcon(
77 ::BaseActorRenderContext& renderContext,
78 ::Player* holdingPlayer,
79 ::mce::Color const& lightColor,
80 float scale,
81 ::MapDecoration const& dec,
82 ::ActorUniqueID const& playerID,
83 int,
84 bool isEduWorld
85 );
86
87 MCNAPI void _renderLabel(
88 ::BaseActorRenderContext& renderContext,
89 ::Vec3 const& pos,
90 ::std::string const& label,
91 ::mce::Color const& labelColor
92 );
93
94 MCNAPI ~MapInstance();
95 // NOLINTEND
96
97 public:
98 // destructor thunk
99 // NOLINTBEGIN
100 MCNAPI void $dtor();
101 // NOLINTEND
102 };
103
104 using DecorationMeshArray = ::std::array<::mce::Mesh, 30>;
105
106public:
107 // member variables
108 // NOLINTBEGIN
109 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::mce::TextureGroup>> mTextureGroup;
110 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ActorUniqueID, ::std::unique_ptr<::MapRenderer::MapInstance>>>
111 mMapInstances;
112 ::ll::TypedStorage<1, 1, ::SubClientId> mClientId;
113 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mDecorationTexture;
114 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mMapBackgroundTexture;
115 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mIconBackgroundTexture;
116 ::ll::TypedStorage<8, 960, ::std::array<::mce::TexturePtr, 30>> mMarkerTextures;
117 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMapMaterial;
118 ::ll::TypedStorage<8, 608, ::mce::Mesh> mBackgroundMesh;
119 ::ll::TypedStorage<8, 608, ::mce::Mesh> mForegroundMesh;
120 ::ll::TypedStorage<8, 18240, ::mce::Mesh[30]> mDecorationMeshes;
121 // NOLINTEND
122
123public:
124 // prevent constructor by default
125 MapRenderer();
126
127public:
128 // virtual functions
129 // NOLINTBEGIN
130 virtual void render(::BaseActorRenderContext&, ::ActorRenderData&) /*override*/;
131
132 virtual void onAppSuspended() /*override*/;
133 // NOLINTEND
134
135public:
136 // member functions
137 // NOLINTBEGIN
138 MCNAPI MapRenderer(::SubClientId clientId, ::std::shared_ptr<::mce::TextureGroup> textureGroup);
139
140 MCNAPI void _generateMeshes(::BaseActorRenderContext& renderContext);
141
142 MCNAPI ::MapRenderer::MapInstance& _getMapInstance(::MapItemSavedData const& data);
143
144 MCNAPI void render(
145 ::BaseActorRenderContext& renderContext,
146 ::Player* holdingPlayer,
147 ::BlockPos const& pos,
148 ::BlockSource& region,
149 ::MapItemSavedData const& data,
150 bool showOnlyFrame,
151 bool isBasic,
152 ::std::optional<bool> ignoreLighting,
153 ::std::optional<::Brightness const> lightEmission
154 );
155 // NOLINTEND
156
157public:
158 // constructor thunks
159 // NOLINTBEGIN
160 MCNAPI void* $ctor(::SubClientId clientId, ::std::shared_ptr<::mce::TextureGroup> textureGroup);
161 // NOLINTEND
162
163public:
164 // virtual function thunks
165 // NOLINTBEGIN
167
168 MCNAPI void $onAppSuspended();
169 // NOLINTEND
170};
Definition ActorRenderData.h:5
Definition ActorRenderer.h:5
Definition AppPlatformListener.h:16
Definition BaseActorRenderContext.h:5
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition MapDecoration.h:8
Definition MapItemSavedData.h:32
Definition MapRenderer.h:13
MCAPI void _drawIconBackground(::ScreenContext &screenContext, ::mce::Color const &color, float zOffset, ::OffscreenCaptureDescription const &offscreenCaptureDescription)
MCAPI void _renderLabel(::BaseActorRenderContext &renderContext, ::Vec3 const &pos, ::std::string const &label, ::mce::Color const &labelColor)
MCAPI bool _renderFaceIcon(::Tessellator &, ::BaseActorRenderContext &renderContext, ::Player *holdingPlayer, ::mce::Color const &lightColor, float scale, ::MapDecoration const &dec, ::ActorUniqueID const &playerID, int, bool isEduWorld)
Definition MapRenderer.h:5
MCAPI MapRenderer(::SubClientId clientId, ::std::shared_ptr<::mce::TextureGroup > textureGroup)
MCAPI void $onAppSuspended()
MCAPI void * $ctor(::SubClientId clientId, ::std::shared_ptr<::mce::TextureGroup > textureGroup)
MCAPI::MapRenderer::MapInstance & _getMapInstance(::MapItemSavedData const &data)
MCAPI void $render(::BaseActorRenderContext &, ::ActorRenderData &)
MCAPI void _generateMeshes(::BaseActorRenderContext &renderContext)
MCAPI void render(::BaseActorRenderContext &renderContext, ::Player *holdingPlayer, ::BlockPos const &pos, ::BlockSource &region, ::MapItemSavedData const &data, bool showOnlyFrame, bool isBasic, ::std::optional< bool > ignoreLighting, ::std::optional<::Brightness const > lightEmission)
Definition Player.h:131
Definition ScreenContext.h:5
Definition Tessellator.h:5
Definition Vec3.h:10
Definition Color.h:13
Definition TextureGroup.h:7
Definition ActorUniqueID.h:5
Definition Brightness.h:8
Definition OffscreenCaptureDescription.h:5