mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[flutter] Repro mesh generator for crash on Android Mail GPU.
This commit is contained in:
parent
ece135b8ec
commit
73b9b2af04
@ -42,7 +42,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.0.4"
|
version: "4.2.5"
|
||||||
ffi:
|
ffi:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -14,9 +14,37 @@ int main(int argc, char** argv) {
|
|||||||
spine_atlas atlas = spine_atlas_load((const utf8*)cstringAtlas);
|
spine_atlas atlas = spine_atlas_load((const utf8*)cstringAtlas);
|
||||||
spine_skeleton_data_result result = spine_skeleton_data_load_binary(atlas, data, dataLength);
|
spine_skeleton_data_result result = spine_skeleton_data_load_binary(atlas, data, dataLength);
|
||||||
spine_skeleton_drawable drawable = spine_skeleton_drawable_create(spine_skeleton_data_result_get_data(result));
|
spine_skeleton_drawable drawable = spine_skeleton_drawable_create(spine_skeleton_data_result_get_data(result));
|
||||||
|
spine_skeleton skeleton = spine_skeleton_drawable_get_skeleton(drawable);
|
||||||
|
spine_skeleton_update_world_transform(skeleton);
|
||||||
spine_render_command cmd = spine_skeleton_drawable_render(drawable);
|
spine_render_command cmd = spine_skeleton_drawable_render(drawable);
|
||||||
while (cmd) {
|
int numVertices = spine_render_command_get_num_vertices(cmd);
|
||||||
uint16_t *indices = spine_render_command_get_indices(cmd);
|
int numIndices = spine_render_command_get_num_indices(cmd);
|
||||||
cmd = spine_render_command_get_next(cmd);
|
float* positions = spine_render_command_get_positions(cmd);
|
||||||
|
float* uvs = spine_render_command_get_uvs(cmd);
|
||||||
|
int32_t *colors = spine_render_command_get_colors(cmd);
|
||||||
|
uint16_t *indices = spine_render_command_get_indices(cmd);
|
||||||
|
String str;
|
||||||
|
str.append(numVertices);
|
||||||
|
str.append("\n");
|
||||||
|
str.append(numIndices);
|
||||||
|
str.append("\n");
|
||||||
|
for (int i = 0; i < numVertices * 2; i++) {
|
||||||
|
str.append(positions[i]);
|
||||||
|
str.append("\n");
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < numVertices * 2; i++) {
|
||||||
|
str.append(uvs[i]);
|
||||||
|
str.append("\n");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < numVertices; i++) {
|
||||||
|
str.append(colors[i]);
|
||||||
|
str.append("\n");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < numIndices; i++) {
|
||||||
|
str.append(indices[i]);
|
||||||
|
str.append("\n");
|
||||||
|
}
|
||||||
|
FILE *file = fopen("/Users/badlogic/Desktop/spineboy.mesh", "w");
|
||||||
|
fwrite(str.buffer(), str.length(), 1, file);
|
||||||
|
fclose(file);
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user