You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.2 KiB
73 lines
2.2 KiB
|
5 years ago
|
#pragma once
|
||
|
8 years ago
|
|
||
|
5 years ago
|
#include <cstdint>
|
||
|
5 years ago
|
#include <cstdlib>
|
||
|
5 years ago
|
|
||
|
5 years ago
|
#include "engine/point.hpp"
|
||
|
5 years ago
|
#include "engine/size.hpp"
|
||
|
5 years ago
|
#include "engine/surface.hpp"
|
||
|
5 years ago
|
|
||
|
5 years ago
|
namespace devilution {
|
||
|
5 years ago
|
|
||
|
2 years ago
|
/**
|
||
|
|
* @brief Fill a rectangle with the given color.
|
||
|
|
*/
|
||
|
|
void FillRect(const Surface &out, int x, int y, int width, int height, uint8_t colorIndex);
|
||
|
|
|
||
|
5 years ago
|
/**
|
||
|
5 years ago
|
* @brief Draw a horizontal line segment in the target buffer (left to right)
|
||
|
5 years ago
|
* @param out Target buffer
|
||
|
5 years ago
|
* @param from Start of the line segment
|
||
|
|
* @param width
|
||
|
|
* @param colorIndex Color index from current palette
|
||
|
5 years ago
|
*/
|
||
|
5 years ago
|
void DrawHorizontalLine(const Surface &out, Point from, int width, std::uint8_t colorIndex);
|
||
|
5 years ago
|
|
||
|
|
/** Same as DrawHorizontalLine but without bounds clipping. */
|
||
|
5 years ago
|
void UnsafeDrawHorizontalLine(const Surface &out, Point from, int width, std::uint8_t colorIndex);
|
||
|
5 years ago
|
|
||
|
|
/**
|
||
|
|
* @brief Draw a vertical line segment in the target buffer (top to bottom)
|
||
|
|
* @param out Target buffer
|
||
|
|
* @param from Start of the line segment
|
||
|
|
* @param height
|
||
|
|
* @param colorIndex Color index from current palette
|
||
|
|
*/
|
||
|
5 years ago
|
void DrawVerticalLine(const Surface &out, Point from, int height, std::uint8_t colorIndex);
|
||
|
5 years ago
|
|
||
|
|
/** Same as DrawVerticalLine but without bounds clipping. */
|
||
|
5 years ago
|
void UnsafeDrawVerticalLine(const Surface &out, Point from, int height, std::uint8_t colorIndex);
|
||
|
5 years ago
|
|
||
|
5 years ago
|
/**
|
||
|
2 years ago
|
* Draws a half-transparent rectangle by palette blending with black.
|
||
|
5 years ago
|
*
|
||
|
|
* @brief Render a transparent black rectangle
|
||
|
|
* @param out Target buffer
|
||
|
|
* @param sx Screen coordinate
|
||
|
|
* @param sy Screen coordinate
|
||
|
|
* @param width Rectangle width
|
||
|
|
* @param height Rectangle height
|
||
|
|
*/
|
||
|
5 years ago
|
void DrawHalfTransparentRectTo(const Surface &out, int sx, int sy, int width, int height);
|
||
|
5 years ago
|
|
||
|
3 years ago
|
/**
|
||
|
|
* Draws a half-transparent pixel
|
||
|
|
*
|
||
|
|
* @brief Render a transparent pixel
|
||
|
|
* @param out Target buffer
|
||
|
|
* @param position Screen coordinates
|
||
|
|
* @param col Pixel color
|
||
|
|
*/
|
||
|
|
void SetHalfTransparentPixel(const Surface &out, Point position, uint8_t color);
|
||
|
|
|
||
|
3 years ago
|
/**
|
||
|
|
* Draws a 2px inset border.
|
||
|
|
*
|
||
|
|
* @param out Target buffer
|
||
|
|
* @param rect The rectangle that border pixels are rendered inside of.
|
||
|
|
* @param color Border color.
|
||
|
|
*/
|
||
|
|
void UnsafeDrawBorder2px(const Surface &out, Rectangle rect, uint8_t color);
|
||
|
|
|
||
|
5 years ago
|
} // namespace devilution
|