Skip to content

Commit

Permalink
fix switch and wii u building locally
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtleP committed Aug 27, 2023
1 parent a530dde commit 1725536
Show file tree
Hide file tree
Showing 26 changed files with 190 additions and 654 deletions.
2 changes: 1 addition & 1 deletion include/modules/font/fontmodule.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ namespace love
}

protected:
StrongReference<Object> defaultFontData;
StrongReference<Data> defaultFontData;
};
} // namespace love
6 changes: 4 additions & 2 deletions include/objects/font/font.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <utilities/driver/renderer/vertex.hpp>

#include <objects/rasterizer/rasterizer.tcc>
#include <objects/texture/texture.tcc>

#include <vector>

namespace love
Expand Down Expand Up @@ -62,7 +64,7 @@ namespace love
int height;
};

template<typename Tex, size_t N>
template<typename Tex = Texture<Console::Which>, size_t N = 4>
struct Glyph
{
Tex* texture;
Expand All @@ -72,7 +74,7 @@ namespace love
int sheet;
};

template<typename Tex>
template<typename Tex = Texture<Console::Which>>
struct DrawCommand
{
Tex* texture;
Expand Down
56 changes: 0 additions & 56 deletions include/utilities/driver/renderer/drawbuffer.tcc

This file was deleted.

2 changes: 1 addition & 1 deletion include/utilities/driver/renderer/drawcommand.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <common/console.hpp>
#include <common/vector.hpp>

#include <objects/shader/shader.tcc>
#include <objects/shader_ext.hpp>
#include <objects/texture/texture.tcc>

#include <utilities/driver/renderer/vertex.hpp>
Expand Down
5 changes: 0 additions & 5 deletions include/utilities/driver/renderer/vertex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ namespace love

static constexpr size_t VERTEX_SIZE = sizeof(Vertex);

static inline uint16_t normto16t(float in)
{
return uint16_t(in * 0xFFFF);
}

// clang-format off
static constexpr BidirectionalMap cullModes = {
"none", CULL_NONE,
Expand Down
42 changes: 14 additions & 28 deletions platform/cafe/include/objects/font_ext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ namespace love
class Font<Console::CAFE> : public Font<Console::ALL>
{
public:
struct DrawCommand
{
Texture<Console::CAFE>* texture;
int start;
int count;
};

Font(Rasterizer<Console::CAFE>* rasterizer, const SamplerState& state);

virtual ~Font()
Expand Down Expand Up @@ -88,31 +81,24 @@ namespace love
return 0.0f;
}

std::vector<DrawCommand> GenerateVertices(const ColoredCodepoints& codepoints,
const Color& color,
std::vector<vertex::Vertex>& vertices,
float extraSpacing = 0.0f, Vector2 offset = {},
TextInfo* info = nullptr);
std::vector<DrawCommand<>> GenerateVertices(const ColoredCodepoints& codepoints,
const Color& color,
std::vector<vertex::Vertex>& vertices,
float extraSpacing = 0.0f, Vector2 offset = {},
TextInfo* info = nullptr);

std::vector<DrawCommand> GenerateVerticesFormatted(const ColoredCodepoints& codepoints,
const Color& color, float wrap,
AlignMode align,
std::vector<vertex::Vertex>& vertices,
TextInfo* info = nullptr);
std::vector<DrawCommand<>> GenerateVerticesFormatted(const ColoredCodepoints& codepoints,
const Color& color, float wrap,
AlignMode align,
std::vector<vertex::Vertex>& vertices,
TextInfo* info = nullptr);

uint32_t GetTextureCacheID() const
{
return this->textureCacheID;
}

private:
struct Glyph
{
Texture<Console::CAFE>* texture;
int spacing;
vertex::Vertex vertices[4];
};

struct TextureSize
{
int width;
Expand Down Expand Up @@ -140,12 +126,12 @@ namespace love

GlyphData* GetRasterizerGlyphData(uint32_t glyph, float& dpiScale);

const Glyph& AddGlyph(uint32_t glyph);
const Glyph<>& AddGlyph(uint32_t glyph);

const Glyph& FindGlyph(uint32_t glyph);
const Glyph<>& FindGlyph(uint32_t glyph);

void Printv(Graphics<Console::CAFE>& graphics, const Matrix4<Console::CAFE>& transform,
const std::vector<DrawCommand>& drawCommands,
const std::vector<DrawCommand<>>& drawCommands,
const std::vector<vertex::Vertex>& vertices);

int textureX;
Expand All @@ -159,7 +145,7 @@ namespace love

std::vector<StrongReference<Texture<Console::CAFE>>> textures;

std::unordered_map<uint32_t, Glyph> glyphs;
std::unordered_map<uint32_t, Glyph<>> glyphs;
std::unordered_map<uint64_t, float> kernings;

std::vector<StrongRasterizer> rasterizers;
Expand Down
2 changes: 1 addition & 1 deletion platform/cafe/include/objects/textbatch_ext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace love
Matrix4<Console::CAFE> matrix;
};

std::vector<Font<Console::CAFE>::DrawCommand> drawCommands;
std::vector<Font<Console::CAFE>::DrawCommand<>> drawCommands;
std::vector<TextData> textData;
size_t vertexOffset;
std::vector<vertex::Vertex> vertexBuffer;
Expand Down
99 changes: 0 additions & 99 deletions platform/cafe/include/utilities/driver/buffer.hpp

This file was deleted.

Loading

0 comments on commit 1725536

Please sign in to comment.