osb/source/game/StarEntityRendering.cpp

50 lines
1.3 KiB
C++
Raw Normal View History

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);
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);
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);
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);
addAudio(std::move(audio));
2023-06-20 04:33:09 +00:00
}
}
void RenderCallback::addTilePreviews(List<PreviewTile> previews) {
for (auto& preview : previews)
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;
addOverheadBar(std::move(bar));
2023-06-20 04:33:09 +00:00
}
}
}