Esempio n. 1
0
void TileMap::setTileEntity(int x, int y, int entityNumber)
{
    if (x < 0 || y < 0 || x >= getWidth() || y >= getHeight())
    {
        return;
    }

    _putpixel24(mEntityMapBitmap, x, y, entityNumber);
}
Esempio n. 2
0
void rrestore(BITMAP * bmp)
{
    int i;
    
    pixel *ptr = (pixel *) savedpixels;

    for (i = 0; i < pos_sp; i++, ptr++)	/* from savedpixels[0] -> savedpixels[ii]
					   * is putpixel too slow? maybe this is causing flickering? */
	_putpixel24(bmp, ptr->x, ptr->y, ptr->color);

    pos_sp = 0;			/* all done.. lets start on a new circle */
}
Esempio n. 3
0
void TileMap::setTileFlags(int x, int y, int flags)
{
    if (x < 0 || y < 0 || x >= getWidth() || y >= getHeight())
    {
        return;
    }

    int pixel = _getpixel24(mTileMapBitmap, x, y);
    int newPixel = makecol24(getr24(pixel),
                             getg24(pixel),
                             flags);
    _putpixel24(mTileMapBitmap, x, y, newPixel);
}
Esempio n. 4
0
void TileMap::setTile(int x, int y, int tileNumber)
{
    if (x < 0 || y < 0 || x >= getWidth() || y >= getHeight())
    {
        return;
    }

    int pixel = _getpixel24(mTileMapBitmap, x, y);
    int newPixel = makecol24(tileNumber,
                             getg24(pixel),
                             getb24(pixel));
    _putpixel24(mTileMapBitmap, x, y, newPixel);
}
Esempio n. 5
0
void rsave(BITMAP * bmp, int x, int y, int d)
{
    /* save pixel information into array */
    // clipping
    if (x < GUIWIDTH || x >= XMAX || y < 0 || y >= YMAX)
	return;
    savedpixels[pos_sp].x = x;
    savedpixels[pos_sp].y = y;
    savedpixels[pos_sp].color = _getpixel24(bmp, x, y);
    pos_sp++;
    /* Doing this will remove the need to call circle again */
    _putpixel24(bmp, x, y, d);
}
Esempio n. 6
0
void Bitmap::PutPixel(int x, int y, color_t color)
{
    if (x < 0 || x >= _alBitmap->w || y < 0 || y >= _alBitmap->h)
    {
        return;
    }

	switch (bitmap_color_depth(_alBitmap))
	{
	case 8:
		return _putpixel(_alBitmap, x, y, color);
	case 15:
		return _putpixel15(_alBitmap, x, y, color);
	case 16:
		return _putpixel16(_alBitmap, x, y, color);
	case 24:
		return _putpixel24(_alBitmap, x, y, color);
	case 32:
		return _putpixel32(_alBitmap, x, y, color);
	}
    assert(0); // this should not normally happen
	return putpixel(_alBitmap, x, y, color);
}