[cpp][flutter] Fix formatting.

This commit is contained in:
Mario Zechner 2023-01-16 15:02:43 +01:00
parent ba71af746b
commit e9c68326de
2 changed files with 29 additions and 28 deletions

View File

@ -37,7 +37,7 @@ using namespace spine;
struct Block {
int size;
int allocated;
uint8_t* memory;
uint8_t *memory;
int free() {
return size - allocated;
@ -47,14 +47,14 @@ struct Block {
return free() >= numBytes;
}
uint8_t* allocate(int numBytes) {
uint8_t *allocate(int numBytes) {
uint8_t *ptr = memory + allocated;
allocated += numBytes;
return ptr;
}
};
class BlockAllocator : public SpineObject{
class BlockAllocator : public SpineObject {
int initialBlockSize;
Vector<Block> blocks;
@ -77,7 +77,7 @@ public:
template<typename T>
T *allocate(size_t num) {
return (T *) _allocate((int)(sizeof(T) * num));
return (T *) _allocate((int) (sizeof(T) * num));
}
void compress() {
@ -89,6 +89,7 @@ public:
blocks.clear();
blocks.add(newBlock(totalSize));
}
private:
void *_allocate(int numBytes) {
// 16-byte align allocations
@ -656,7 +657,7 @@ void spine_skeleton_drawable_dispose(spine_skeleton_drawable drawable) {
SpineExtension::free(drawable, __FILE__, __LINE__);
}
static _spine_render_command *batch_sub_commands(BlockAllocator &allocator, Vector<_spine_render_command*> &commands, int first, int last, int numVertices, int numIndices) {
static _spine_render_command *batch_sub_commands(BlockAllocator &allocator, Vector<_spine_render_command *> &commands, int first, int last, int numVertices, int numIndices) {
_spine_render_command *batched = spine_render_command_create(allocator, numVertices, numIndices, commands[first]->blendMode, commands[first]->atlasPage);
float *positions = batched->positions;
float *uvs = batched->uvs;
@ -679,7 +680,7 @@ static _spine_render_command *batch_sub_commands(BlockAllocator &allocator, Vect
return batched;
}
static _spine_render_command *batch_commands(BlockAllocator &allocator, Vector<_spine_render_command*> &commands) {
static _spine_render_command *batch_commands(BlockAllocator &allocator, Vector<_spine_render_command *> &commands) {
if (commands.size() == 0) return nullptr;
_spine_render_command *root = nullptr;
@ -1472,7 +1473,7 @@ spine_path_constraint spine_skeleton_find_path_constraint(spine_skeleton skeleto
}
spine_bounds spine_skeleton_get_bounds(spine_skeleton skeleton) {
_spine_bounds *bounds = (_spine_bounds*)malloc(sizeof(_spine_bounds));
_spine_bounds *bounds = (_spine_bounds *) malloc(sizeof(_spine_bounds));
if (skeleton == nullptr) return (spine_bounds) bounds;
Skeleton *_skeleton = (Skeleton *) skeleton;
Vector<float> vertices;