2018-08-02 01:29:06 -04:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-02-23 02:11:40 -05:00
|
|
|
#ifndef STARTREK_BITMAP_H
|
|
|
|
#define STARTREK_BITMAP_H
|
|
|
|
|
2018-05-07 20:25:09 -04:00
|
|
|
#include "common/ptr.h"
|
2018-02-23 02:11:40 -05:00
|
|
|
#include "common/stream.h"
|
2019-06-10 01:16:48 +03:00
|
|
|
#include "common/memstream.h"
|
2018-02-23 02:11:40 -05:00
|
|
|
|
|
|
|
namespace StarTrek {
|
|
|
|
|
|
|
|
struct Bitmap {
|
2018-05-25 21:53:18 -04:00
|
|
|
int16 xoffset;
|
|
|
|
int16 yoffset;
|
|
|
|
int16 width;
|
|
|
|
int16 height;
|
2018-02-23 02:11:40 -05:00
|
|
|
byte *pixels;
|
|
|
|
|
2019-12-28 13:21:23 +02:00
|
|
|
Bitmap(Common::MemoryReadStreamEndian *stream, bool closeStream = true);
|
2018-07-17 04:10:48 -04:00
|
|
|
Bitmap(const Bitmap &bitmap);
|
2018-02-23 02:11:40 -05:00
|
|
|
Bitmap(int w, int h);
|
|
|
|
~Bitmap();
|
|
|
|
|
|
|
|
protected:
|
2018-07-17 04:10:48 -04:00
|
|
|
int32 pixelsArraySize;
|
2018-07-23 22:06:24 -04:00
|
|
|
Bitmap() : xoffset(0), yoffset(0), width(0), height(0), pixels(nullptr), pixelsArraySize(0) {}
|
2018-02-23 02:11:40 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-07-23 22:06:24 -04:00
|
|
|
/**
|
|
|
|
* TextBitmap is the same as Bitmap, except it stores character indices in its "pixels"
|
|
|
|
* array instead of actual pixels.
|
|
|
|
* A consequence of this is that the pixels array is smaller than otherwise expected
|
|
|
|
* (since width/height still reflect the actual size when drawn).
|
|
|
|
*/
|
2018-02-23 02:11:40 -05:00
|
|
|
struct TextBitmap : Bitmap {
|
|
|
|
TextBitmap(int w, int h);
|
|
|
|
};
|
|
|
|
|
2018-07-17 04:10:48 -04:00
|
|
|
|
2018-07-23 22:06:24 -04:00
|
|
|
/**
|
|
|
|
* StubBitmap is a bitmap without any actual pixel data. Used as a stub for the
|
|
|
|
* "starfield" sprite, which is always in draw mode 1 (invisible), so it never gets drawn;
|
|
|
|
* however, it does trigger refreshes on the background in that area, so the game can draw
|
|
|
|
* on the background layer manually.
|
|
|
|
*/
|
2018-07-17 04:10:48 -04:00
|
|
|
struct StubBitmap : Bitmap {
|
|
|
|
StubBitmap(int w, int h);
|
|
|
|
};
|
|
|
|
|
2018-07-28 21:20:43 +02:00
|
|
|
} // End of namespace StarTrek
|
2018-02-23 02:11:40 -05:00
|
|
|
|
|
|
|
#endif
|