Android fixes

This commit is contained in:
Nikola Petrov 2025-01-04 16:34:31 +01:00
parent 70861d3e35
commit ddb19902ee
3 changed files with 10 additions and 7 deletions

View File

@ -34,7 +34,7 @@ private:
void drawBranch();
inline int getNumOfBranches(int dep);
inline size_t getNumOfBranches(int dep);
inline Color getStartColor(DrawArgs &arg);
inline Color getEndColor(int dep, Color &start);
inline int getStartSize(DrawArgs &arg);

View File

@ -120,7 +120,7 @@ void Tree::drawBranch()
}
}
inline int Tree::getNumOfBranches(int dep)
inline size_t Tree::getNumOfBranches(int dep)
{
if (m_dna->branches[dep].branchCount < 128)
return 2;
@ -151,11 +151,10 @@ inline Color Tree::getStartColor(DrawArgs &arg)
inline Color Tree::getEndColor(int dep, Color &start)
{
return {
start.r + m_dna->branches[dep].colorR_change,
start.g + m_dna->branches[dep].colorG_change,
start.b + m_dna->branches[dep].colorB_change,
255};
uint8_t r = start.r + m_dna->branches[dep].colorR_change;
uint8_t g = start.g + m_dna->branches[dep].colorG_change;
uint8_t b = start.b + m_dna->branches[dep].colorB_change;
return {r, g, b, 255};
}
inline int Tree::getStartSize(DrawArgs &arg)

View File

@ -3,6 +3,10 @@
#include "sys.hpp"
#include <raylib.h>
#if defined(PLATFORM_ANDROID)
#include <raymob.h>
#endif
namespace sys
{