mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-03 10:26:29 +00:00
Merge branch 'lobby' of github.com:AnonymusRaccoon/Bomberman into lobby
This commit is contained in:
@@ -30,4 +30,9 @@ namespace RAY::Drawables::Drawables3D
|
||||
{
|
||||
DrawCubeV(this->_position, this->_dimensions, this->_color);
|
||||
}
|
||||
|
||||
void Cube::drawWiresOn(RAY::Window &)
|
||||
{
|
||||
DrawCubeWiresV(this->_position, this->_dimensions, this->_debugColor);
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,9 @@ namespace RAY::Drawables::Drawables3D {
|
||||
|
||||
//! @brief Draw circle on window
|
||||
void drawOn(RAY::Window &) override;
|
||||
|
||||
//! @brief Draw cube's wires on window
|
||||
void drawWiresOn(RAY::Window &) override;
|
||||
private:
|
||||
//! @brief Dimensions of the cube
|
||||
Vector3 _dimensions;
|
||||
|
||||
@@ -52,4 +52,9 @@ namespace RAY::Drawables::Drawables3D
|
||||
{
|
||||
DrawCylinder(this->_position, this->_topRadius, this->_bottomRadius, this->_height, 0, this->_color);
|
||||
}
|
||||
|
||||
void Cylinder::drawWiresOn(RAY::Window &)
|
||||
{
|
||||
DrawCylinderWires(this->_position, this->_topRadius, this->_bottomRadius, this->_height, 0, this->_debugColor);
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,8 @@ namespace RAY::Drawables::Drawables3D {
|
||||
//! @brief Draw point on window
|
||||
void drawOn(RAY::Window &) override;
|
||||
|
||||
//! @brief Draw cylinder's wires on window
|
||||
void drawWiresOn(RAY::Window &) override;
|
||||
private:
|
||||
//! @brief Radius of the cylinder
|
||||
float _topRadius;
|
||||
|
||||
@@ -30,4 +30,9 @@ namespace RAY::Drawables::Drawables3D
|
||||
{
|
||||
DrawSphere(this->_position, this->_radius, this->_color);
|
||||
}
|
||||
|
||||
void Sphere::drawWiresOn(RAY::Window &)
|
||||
{
|
||||
DrawSphereWires(this->_position, this->_radius, 10, 10, this->_debugColor);
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,9 @@ namespace RAY::Drawables::Drawables3D {
|
||||
//! @brief Draw point on window
|
||||
void drawOn(RAY::Window &) override;
|
||||
|
||||
//! @brief Draw sphere's wires on window
|
||||
void drawWiresOn(RAY::Window &) override;
|
||||
|
||||
private:
|
||||
//! @brief Radius of the sphere
|
||||
int _radius;
|
||||
|
||||
@@ -36,4 +36,18 @@ namespace RAY::Drawables
|
||||
this->_position = position;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void ADrawable3D::drawWiresOn(RAY::Window &)
|
||||
{}
|
||||
|
||||
const RAY::Color &ADrawable3D::getDebugColor(void) const
|
||||
{
|
||||
return this->_debugColor;
|
||||
}
|
||||
|
||||
ADrawable3D &ADrawable3D::setDebugColor(const Color &debugColor)
|
||||
{
|
||||
this->_debugColor = debugColor;
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
@@ -30,12 +30,21 @@ namespace RAY::Drawables {
|
||||
//! @brief Draw drawble on window
|
||||
void drawOn(RAY::Window &) override = 0;
|
||||
|
||||
//! @brief Draw drawble's wires on window
|
||||
virtual void drawWiresOn(RAY::Window &);
|
||||
|
||||
//! @return the color of the ADrawable
|
||||
const RAY::Color &getColor(void) const;
|
||||
|
||||
|
||||
//! @brief set color
|
||||
ADrawable3D &setColor(const RAY::Color &color);
|
||||
|
||||
//! @return the debug color of the ADrawable
|
||||
const RAY::Color &getDebugColor(void) const;
|
||||
|
||||
//! @brief set the debug color
|
||||
ADrawable3D &setDebugColor(const RAY::Color &debugColor);
|
||||
|
||||
//! @return the position of the ADrawable
|
||||
virtual const RAY::Vector3 &getPosition(void) const;
|
||||
|
||||
@@ -49,6 +58,9 @@ namespace RAY::Drawables {
|
||||
//! @brief Color of the ADrawable
|
||||
Color _color;
|
||||
|
||||
//! @brief Color of the ADrawable's Debug
|
||||
Color _debugColor = GREEN;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -114,6 +114,20 @@ namespace RAY::Drawables::Drawables3D
|
||||
this->_color);
|
||||
}
|
||||
|
||||
void Model::drawWiresOn(RAY::Window &)
|
||||
{
|
||||
if (this->_model->meshCount) {
|
||||
::BoundingBox box = GetMeshBoundingBox(*this->_model->meshes);
|
||||
box.min.x += this->_position.x;
|
||||
box.min.y += this->_position.y;
|
||||
box.min.z += this->_position.z;
|
||||
box.max.x += this->_position.x;
|
||||
box.max.y += this->_position.y;
|
||||
box.max.z += this->_position.z;
|
||||
DrawBoundingBox(box, this->_debugColor);
|
||||
}
|
||||
}
|
||||
|
||||
void Model::setShader(const RAY::Shader &shader)
|
||||
{
|
||||
this->_originalShader = this->_model->materials[0].shader;
|
||||
|
||||
@@ -87,6 +87,9 @@ namespace RAY::Drawables::Drawables3D {
|
||||
|
||||
void drawOn(RAY::Window &) override;
|
||||
|
||||
//! @brief Draw model's wires on window
|
||||
void drawWiresOn(RAY::Window &) override;
|
||||
|
||||
private:
|
||||
//! @brief Raw data from raylib
|
||||
std::shared_ptr<::Model> _model;
|
||||
|
||||
Reference in New Issue
Block a user