include/pixmap.h
branchpyrit
changeset 95 ca7d4c665531
parent 94 4c8abb8977dc
child 96 9eb71e76c7fd
--- a/include/pixmap.h	Thu May 08 09:21:25 2008 +0200
+++ b/include/pixmap.h	Sat May 10 14:29:37 2008 +0200
@@ -48,8 +48,22 @@
 	Pixmap(Float *afdata, int aw, int ah):
 		fdata(afdata), w(aw), h(ah), refdata(true) {};
 	Pixmap(int aw, int ah):
-		data(new Colour[aw*ah]), w(aw), h(ah), refdata(false) {};
-	virtual ~Pixmap() { if (!refdata) delete[] data; };
+		w(aw), h(ah), refdata(false)
+	{
+#ifdef NO_SIMD
+		data = new Colour[aw*ah];
+#else
+		data = (Colour*)_mm_malloc(aw*ah*sizeof(Colour), 16);
+#endif
+	};
+	virtual ~Pixmap()
+	{
+#ifdef NO_SIMD
+		if (!refdata) delete[] data;
+#else
+		if (!refdata) _mm_free(data);
+#endif
+	};
 
 	void setData(Float *afdata, int aw, int ah)
 		{ fdata = afdata; w = aw; h = ah; };