Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Nov 25, 2024
1 parent e55c467 commit 350faf2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions spine-cpp/spine-cpp-lite/spine-cpp-lite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class CallbackTextureLoad : public TextureLoader {
spine_texture_loader_unload_func unloadCb;

public:
CallbackTextureLoad(): loadCb(nullptr), unloadCb(nullptr) {}
CallbackTextureLoad() : loadCb(nullptr), unloadCb(nullptr) {}

void setCallbacks(spine_texture_loader_load_func load, spine_texture_loader_unload_func unload) {
loadCb = load;
Expand All @@ -233,7 +233,7 @@ spine_atlas spine_atlas_load_callback(const utf8 *atlasData, const utf8 *atlasDi
if (!atlasData) return nullptr;
int32_t length = (int32_t) strlen(atlasData);
callbackLoader.setCallbacks(load, unload);
auto atlas = new (__FILE__, __LINE__) Atlas(atlasData, length, (const char *)atlasDir, &callbackLoader, true);
auto atlas = new (__FILE__, __LINE__) Atlas(atlasData, length, (const char *) atlasDir, &callbackLoader, true);
_spine_atlas *result = SpineExtension::calloc<_spine_atlas>(1, __FILE__, __LINE__);
result->atlas = atlas;
result->numImagePaths = (int32_t) atlas->getPages().size();
Expand Down
8 changes: 4 additions & 4 deletions spine-glfw/example/main-cpp-lite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ uint8_t *read_file(const char *path, int *length) {
*length = (int) ftell(file);
fseek(file, 0, SEEK_SET);

uint8_t *data = (uint8_t*)malloc(*length);
uint8_t *data = (uint8_t *) malloc(*length);
fread(data, 1, *length, file);
fclose(file);

return data;
}

void *load_texture(const char *path) {
return (void *) (uintptr_t)texture_load(path);
return (void *) (uintptr_t) texture_load(path);
}

void unload_texture(void *texture) {
texture_dispose((texture_t)(uintptr_t)texture);
texture_dispose((texture_t) (uintptr_t) texture);
}

int main() {
Expand All @@ -62,7 +62,7 @@ int main() {
// Load the atlas and the skeleton data
int atlas_length = 0;
uint8_t *atlas_bytes = read_file("data/spineboy-pma.atlas", &atlas_length);
spine_atlas atlas = spine_atlas_load_callback((utf8 *)atlas_bytes, "data/", load_texture, unload_texture);
spine_atlas atlas = spine_atlas_load_callback((utf8 *) atlas_bytes, "data/", load_texture, unload_texture);
int skeleton_length = 0;
uint8_t *skeleton_bytes = read_file("data/spineboy-pro.skel", &skeleton_length);
spine_skeleton_data_result result = spine_skeleton_data_load_binary(atlas, skeleton_bytes, skeleton_length);
Expand Down
2 changes: 1 addition & 1 deletion spine-glfw/src/spine-glfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void renderer_set_viewport_size(renderer_t *renderer, int width, int height) {
}

void renderer_draw_lite(renderer_t *renderer, spine_skeleton skeleton, bool premultipliedAlpha) {
renderer_draw(renderer, (Skeleton*)skeleton, premultipliedAlpha);
renderer_draw(renderer, (Skeleton *) skeleton, premultipliedAlpha);
}

void renderer_draw(renderer_t *renderer, Skeleton *skeleton, bool premultipliedAlpha) {
Expand Down

0 comments on commit 350faf2

Please sign in to comment.