Skip to content

Commit

Permalink
Update RenderD7 to fix Crash
Browse files Browse the repository at this point in the history
  • Loading branch information
tobid7 committed Mar 9, 2023
1 parent ef2e82a commit 874f687
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 325 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ endif

VERSION_MAJOR := 1

VERSION_MINOR := 3
VERSION_MINOR := 4

VERSION_MICRO := 0

Expand Down
19 changes: 19 additions & 0 deletions libs/include/renderd7/Color.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,39 @@

namespace RenderD7 {
namespace Color {
/// @brief RGBA Struct
struct rgba {
/// @brief rgba Colors
uint8_t r, g, b, a;
};
/// @brief RGBA Class
class RGBA {
public:
/// @brief Construct
/// @param r
/// @param g
/// @param b
/// @param a
RGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
: m_r(r), m_g(g), m_b(b), m_a(a) {}
/// @brief Get as Uint32
/// @return color
uint32_t toRGBA() const {
return (m_r << 24) | (m_g << 16) | (m_b << 8) | m_a;
}

uint8_t m_r, m_g, m_b, m_a;
};
/// @brief Convert RGB to Hex
/// @param r
/// @param g
/// @param b
/// @return Hex-String
std::string RGB2Hex(int r, int g, int b);
/// @brief Hex to U32
/// @param color
/// @param a
/// @return Color32
uint32_t Hex(const std::string &color, uint8_t a = 255);
} // namespace Color
} // namespace RenderD7
20 changes: 20 additions & 0 deletions libs/include/renderd7/Draw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,28 @@

namespace RenderD7 {
namespace Draw {
/// @brief Draw Rectangle
/// @param x Pos X
/// @param y Pos Y
/// @param w Width
/// @param h Height
/// @param color Color
/// @return success ?
bool Rect(float x, float y, float w, float h, u32 color);
/// @brief Draw a not filled Rectangle
/// @param p1x Pos X
/// @param p1y Pos Y
/// @param w Width
/// @param h Height
/// @param color Color
/// @param scale Scale
/// @return success ?
bool NFRect(float p1x, float p1y, float w, float h, u32 color, float scale = 1);
/// @brief Draw A Pixel
/// @param x Pos X
/// @param y Pos Y
/// @param color Color
/// @return success ?
bool Px(float x, float y, u32 color);
void TextCentered(float x, float y, float size, u32 color, std::string Text,
int maxWidth = 0, int maxHeight = 0, C2D_Font fnt = nullptr);
Expand Down
7 changes: 6 additions & 1 deletion libs/include/renderd7/bmpconverter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ namespace BitmapConverter {
unsigned decodeBMP(std::vector<unsigned char> &image, unsigned &w, unsigned &h,
const std::vector<unsigned char> &bmp);

/// @brief Convert A File
/// @param filename
/// @return data
std::vector<unsigned char> ConvertFile(std::string filename);

/// @brief Convert data
/// @param data
/// @return data
std::vector<unsigned char> ConvertData(std::vector<unsigned char> data);
} // namespace BitmapConverter
33 changes: 0 additions & 33 deletions libs/include/renderd7/external/fs.h

This file was deleted.

251 changes: 0 additions & 251 deletions libs/include/renderd7/external/libnsbmp/libnsbmp.h

This file was deleted.

Loading

0 comments on commit 874f687

Please sign in to comment.