mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-17 13:20:45 +00:00
Add Dirty::getMemSize() method.
This commit is contained in:
parent
072b19a9bb
commit
f85070c1c6
@ -221,6 +221,21 @@ void dirty_free(Dirty* dirty)
|
||||
jfree(dirty);
|
||||
}
|
||||
|
||||
int Dirty::getMemSize() const
|
||||
{
|
||||
int u, v, size = 4+1+2*4+2; /* DWORD+BYTE+WORD[4]+WORD */
|
||||
|
||||
for (v=0; v<this->rows; v++) {
|
||||
size += 4; /* y, cols (WORD[2]) */
|
||||
for (u=0; u<this->row[v].cols; u++) {
|
||||
size += 4; /* x, w (WORD[2]) */
|
||||
size += image_line_size(this->image, this->row[v].col[u].w);
|
||||
}
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
void dirty_hline(Dirty* dirty, int x1, int y, int x2)
|
||||
{
|
||||
DirtyRow* row; /* row=dirty->row+v */
|
||||
|
@ -52,6 +52,8 @@ struct Dirty
|
||||
int rows;
|
||||
DirtyRow* row;
|
||||
Mask* mask;
|
||||
|
||||
int getMemSize() const;
|
||||
};
|
||||
|
||||
Dirty* dirty_new(Image* image, int x1, int y1, int x2, int y2, bool tiled);
|
||||
|
Loading…
x
Reference in New Issue
Block a user