MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / read_celdata

Function read_celdata

src/doc/cel_data_io.cpp:36–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36CelData* read_celdata(std::istream& is, SubObjectsIO* subObjects, bool setId)
37{
38 ObjectId id = read32(is);
39 int x = read32(is);
40 int y = read32(is);
41 int opacity = read8(is);
42 ObjectId imageId = read32(is);
43 UserData userData = read_user_data(is);
44
45 ImageRef image(subObjects->getImageRef(imageId));
46 if (!image)
47 return nullptr;
48
49 std::unique_ptr<CelData> celdata(new CelData(image));
50 celdata->setPosition(x, y);
51 celdata->setOpacity(opacity);
52 celdata->setUserData(userData);
53 if (setId)
54 celdata->setId(id);
55 return celdata.release();
56}
57
58}

Callers 3

readCelDataMethod · 0.85
onRedoMethod · 0.85
read_layerFunction · 0.85

Calls 8

read8Function · 0.85
read_user_dataFunction · 0.85
setUserDataMethod · 0.80
getImageRefMethod · 0.45
setPositionMethod · 0.45
setOpacityMethod · 0.45
setIdMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected