Fix missing return values

Fixes #8
This commit is contained in:
Rob Loach
2020-03-09 17:57:45 -04:00
parent 7d866d9f35
commit 2ef582b999
7 changed files with 15 additions and 13 deletions

View File

@@ -60,7 +60,7 @@ namespace raylib {
ResumeAudioStream(*this);
}
bool IsPlaying() {
IsAudioStreamPlaying(*this);
return IsAudioStreamPlaying(*this);
}
void Stop() {
StopAudioStream(*this);

View File

@@ -54,19 +54,19 @@ namespace raylib {
format = image.format;
}
bool Load(const std::string& fileName) {
void Load(const std::string& fileName) {
set(LoadImage(fileName.c_str()));
}
bool LoadEx(::Color *pixels, int width, int height) {
void LoadEx(::Color *pixels, int width, int height) {
set(LoadImageEx(pixels, width, height));
}
bool LoadPro(void *data, int width, int height, int format) {
void LoadPro(void *data, int width, int height, int format) {
set(LoadImagePro(data, width, height, format));
}
bool LoadRaw(const std::string& fileName, int width, int height, int format, int headerSize) {
void LoadRaw(const std::string& fileName, int width, int height, int format, int headerSize) {
set(LoadImageRaw(fileName.c_str(), width, height, format, headerSize));
}

View File

@@ -13,7 +13,7 @@ namespace raylib {
set(mesh);
};
Mesh(float VertexCount = 0, float TriangleCount = 0) {
Mesh(int VertexCount = 0, int TriangleCount = 0) {
vertexCount = VertexCount;
triangleCount = TriangleCount;
};
@@ -36,8 +36,8 @@ namespace raylib {
vboId = mesh.vboId;
}
GETTERSETTER(float,VertexCount,vertexCount)
GETTERSETTER(float,TriangleCount,triangleCount)
GETTERSETTER(int,VertexCount,vertexCount)
GETTERSETTER(int,TriangleCount,triangleCount)
Mesh& operator=(const ::Mesh& mesh) {
set(mesh);

View File

@@ -41,7 +41,7 @@ namespace raylib {
}
void Draw(::Color color) {
DrawRectangle(x, y, width, height, color);
::DrawRectangle(x, y, width, height, color);
}
void Draw(::Vector2 origin, float rotation, ::Color color) {
::DrawRectanglePro(*this, origin, rotation, color);

View File

@@ -24,7 +24,7 @@ namespace raylib {
depthTexture = renderTexture.depthTexture;
}
GETTERSETTER(float,Id,id)
GETTERSETTER(unsigned int,Id,id)
GETTERSETTER(Texture2D,Texture,texture)
GETTERSETTER(Texture2D,Depth,depth)
GETTERSETTER(bool,DepthTexture,depthTexture)

View File

@@ -49,10 +49,11 @@ namespace raylib {
return *this;
}
bool LoadFromImage(::Image& image) {
void LoadFromImage(::Image& image) {
set(LoadTextureFromImage(image));
}
bool Load(const std::string& fileName) {
void Load(const std::string& fileName) {
set(LoadTexture(fileName.c_str()));
}
@@ -86,7 +87,7 @@ namespace raylib {
void Unload() {
UnloadTexture(*this);
};
}
void SetMaterialTexture(Material *material, int mapType) {
::SetMaterialTexture(material, mapType, *this);

View File

@@ -38,6 +38,7 @@ list(APPEND SOURCES catch.hpp raylib_test.cpp)
list(APPEND LIBS raylib-cpp raylib)
add_executable(raylib_test ${SOURCES})
target_compile_options(raylib_test PRIVATE -Wall -Wextra -Wconversion -Wsign-conversion)
target_link_libraries(raylib_test ${LIBS})