You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 98037bc
Browse filesBrowse the repository at this point in the historyBrowse files
* Sets up a blank 8bpp surface with the specified size and position,
44
-
* with pure black as the transparent color.
45
-
* @note Surfaces don't have to fill the whole size since their
46
-
* background is transparent, specially subclasses with their own
47
-
* drawing logic, so it just covers the maximum drawing area.
48
-
* @param width Width in pixels.
49
-
* @param height Height in pixels.
50
-
* @param x X position in pixels.
51
-
* @param y Y position in pixels.
52
-
* @param bpp Bits-per-pixel depth.
50
+
* Helper function counting pitch with 16byte align
51
+
* @param bpp bytes per pixel
52
+
* @param width number of pixel in row
53
+
* @return pitch in bytes
53
54
*/
55
+
inlineintGetPitch(int bpp, int width)
56
+
{
57
+
return (bpp/8) * ((width+15)& ~0xF);
58
+
}
54
59
55
-
#ifdef __MORPHOS__
56
-
#include<ppcinline/exec.h>
57
-
#endif
58
-
59
-
Surface::Surface(int width, int height, int x, int y, int bpp) : _x(x), _y(y), _visible(true), _hidden(false), _redraw(false), _originalColors(0), _misalignedPixelBuffer(0), _alignedBuffer(0)
60
+
/**
61
+
* Helper function creating aligned buffer
62
+
* @param bpp bytes per pixel
63
+
* @param width number of pixel in row
64
+
* @param height number of rows
65
+
* @return pointer to memory
66
+
*/
67
+
inlinevoid* NewAligned(int bpp, int width, int height)
* Sets up a blank 8bpp surface with the specified size and position,
125
+
* with pure black as the transparent color.
126
+
* @note Surfaces don't have to fill the whole size since their
127
+
* background is transparent, specially subclasses with their own
128
+
* drawing logic, so it just covers the maximum drawing area.
129
+
* @param width Width in pixels.
130
+
* @param height Height in pixels.
131
+
* @param x X position in pixels.
132
+
* @param y Y position in pixels.
133
+
* @param bpp Bits-per-pixel depth.
134
+
*/
135
+
Surface::Surface(int width, int height, int x, int y, int bpp) : _x(x), _y(y), _visible(true), _hidden(false), _redraw(false), _originalColors(0), _alignedBuffer(0)
0 commit comments