-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
169 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,8 +42,8 @@ namespace love | |
} | ||
|
||
private: | ||
Vertex* data; | ||
GX2RBuffer* buffer; | ||
Vertex* data; | ||
}; | ||
|
||
public: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#pragma once | ||
|
||
#include <common/screen_ext.hpp> | ||
#include <common/vector.hpp> | ||
|
||
#include <coreinit/memfrmheap.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include <objects/font/wrap_font.hpp> | ||
|
||
using namespace love; | ||
|
||
int Wrap_Font::GetWrap(lua_State* L) | ||
{ | ||
auto* self = Wrap_Font::CheckFont(L, 1); | ||
|
||
std::vector<Font<>::ColoredString> text; | ||
Wrap_Font::CheckColoredString(L, 2, text); | ||
|
||
float wrap = luaL_checknumber(L, 3); | ||
|
||
int maxWidth = 0; | ||
std::vector<std::string> lines; | ||
std::vector<int> widths; | ||
|
||
luax::CatchException(L, [&]() { self->GetWrap(text, wrap, lines, &widths); }); | ||
|
||
for (const auto width : widths) | ||
maxWidth = std::max(maxWidth, width); | ||
|
||
lua_pushinteger(L, maxWidth); | ||
|
||
lua_createtable(L, (int)lines.size(), 0); | ||
for (size_t index = 0; index < lines.size(); index++) | ||
{ | ||
lua_pushstring(L, lines[index].c_str()); | ||
lua_rawseti(L, -2, index + 1); | ||
} | ||
|
||
return 2; | ||
} | ||
|
||
// clang-format off | ||
static constexpr luaL_Reg functions[] = | ||
{ | ||
{ "getWrap", Wrap_Font::GetWrap } | ||
}; | ||
// clang-format on | ||
|
||
std::span<const luaL_Reg> Wrap_Font::extensions = functions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.