Chris Taylor / Mbed 2 deprecated RETRO-CaveDweller Featured

Dependencies:   mbed

Committer:
taylorza
Date:
Mon Feb 16 03:46:57 2015 +0000
Revision:
16:f9227904afc4
Parent:
7:2fd875c1d9b1
Added a 4th game screen

Who changed what in which revision?

UserRevisionLine numberNew contents of line
taylorza 0:2ee0812e2615 1 #include "mbed.h"
taylorza 0:2ee0812e2615 2 #include "Bitmap4bpp.h"
taylorza 0:2ee0812e2615 3
taylorza 0:2ee0812e2615 4 Bitmap4bpp::Bitmap4bpp(uint16_t width, uint16_t height) :
taylorza 0:2ee0812e2615 5 _width(width),
taylorza 0:2ee0812e2615 6 _height(height),
taylorza 7:2fd875c1d9b1 7 _stride((width >> 1) + (width & 0x01)),
taylorza 7:2fd875c1d9b1 8 _pBitmapData(new uint8_t[_stride * height])
taylorza 0:2ee0812e2615 9 {
taylorza 7:2fd875c1d9b1 10
taylorza 7:2fd875c1d9b1 11 }
taylorza 7:2fd875c1d9b1 12
taylorza 7:2fd875c1d9b1 13 Bitmap4bpp::~Bitmap4bpp()
taylorza 7:2fd875c1d9b1 14 {
taylorza 7:2fd875c1d9b1 15 if (_pBitmapData != NULL)
taylorza 7:2fd875c1d9b1 16 {
taylorza 7:2fd875c1d9b1 17 delete []_pBitmapData;
taylorza 7:2fd875c1d9b1 18 _pBitmapData = NULL;
taylorza 7:2fd875c1d9b1 19 }
taylorza 0:2ee0812e2615 20 }
taylorza 0:2ee0812e2615 21
taylorza 0:2ee0812e2615 22 void Bitmap4bpp::clear()
taylorza 0:2ee0812e2615 23 {
taylorza 0:2ee0812e2615 24 memset(_pBitmapData, 0, _stride * _height);
taylorza 0:2ee0812e2615 25 }
taylorza 0:2ee0812e2615 26