2023-06-20 04:33:09 +00:00
|
|
|
#include "StarEntityRendering.hpp"
|
|
|
|
#include "StarRoot.hpp"
|
|
|
|
#include "StarAssets.hpp"
|
|
|
|
|
|
|
|
namespace Star {
|
|
|
|
|
|
|
|
RenderCallback::~RenderCallback() {}
|
|
|
|
|
|
|
|
void RenderCallback::addDrawables(List<Drawable> drawables, EntityRenderLayer renderLayer, Vec2F translate) {
|
|
|
|
for (auto& drawable : drawables) {
|
|
|
|
drawable.translate(translate);
|
2024-02-19 15:55:19 +00:00
|
|
|
addDrawable(std::move(drawable), renderLayer);
|
2023-06-20 04:33:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void RenderCallback::addLightSources(List<LightSource> lightSources, Vec2F translate) {
|
|
|
|
for (auto& lightSource : lightSources) {
|
|
|
|
lightSource.translate(translate);
|
2024-02-19 15:55:19 +00:00
|
|
|
addLightSource(std::move(lightSource));
|
2023-06-20 04:33:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void RenderCallback::addParticles(List<Particle> particles, Vec2F translate) {
|
|
|
|
for (auto& particle : particles) {
|
|
|
|
particle.translate(translate);
|
2024-02-19 15:55:19 +00:00
|
|
|
addParticle(std::move(particle));
|
2023-06-20 04:33:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void RenderCallback::addAudios(List<AudioInstancePtr> audios, Vec2F translate) {
|
|
|
|
for (auto& audio : audios) {
|
|
|
|
audio->translate(translate);
|
2024-02-19 15:55:19 +00:00
|
|
|
addAudio(std::move(audio));
|
2023-06-20 04:33:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void RenderCallback::addTilePreviews(List<PreviewTile> previews) {
|
|
|
|
for (auto& preview : previews)
|
2024-02-19 15:55:19 +00:00
|
|
|
addTilePreview(std::move(preview));
|
2023-06-20 04:33:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void RenderCallback::addOverheadBars(List<OverheadBar> bars, Vec2F translate) {
|
|
|
|
for (auto& bar : bars) {
|
|
|
|
bar.entityPosition += translate;
|
2024-02-19 15:55:19 +00:00
|
|
|
addOverheadBar(std::move(bar));
|
2023-06-20 04:33:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|