Fix whitespace

This commit is contained in:
Rob Loach
2020-11-01 05:33:45 -05:00
parent 899934ef27
commit 2245a4f959
14 changed files with 82 additions and 8 deletions

View File

@@ -144,9 +144,8 @@ class AudioStream : public ::AudioStream {
/**
* Default size for new audio streams
*/
inline AudioStream& SetBufferSizeDefault(int size) {
inline static void SetBufferSizeDefault(int size) {
::SetAudioStreamBufferSizeDefault(size);
return *this;
}
protected:

View File

@@ -67,9 +67,11 @@ class Camera2D : public ::Camera2D {
inline Matrix GetMatrix() const {
return ::GetCameraMatrix2D(*this);
}
inline Vector2 GetWorldToScreen2D(Vector2 position) const {
return ::GetWorldToScreen2D(position, *this);
}
inline Vector2 GetScreenToWorld2D(Vector2 position) const {
return ::GetScreenToWorld2D(position, *this);
}

View File

@@ -145,18 +145,22 @@ class Color : public ::Color {
::DrawLine(startPosX, startPosY, endPosX, endPosY, *this);
return *this;
}
inline Color& DrawLine(::Vector2 startPos, ::Vector2 endPos) {
::DrawLineV(startPos, endPos, *this);
return *this;
}
inline Color& DrawLine(::Vector2 startPos, ::Vector2 endPos, float thick) {
::DrawLineEx(startPos, endPos, thick, *this);
return *this;
}
inline Color& DrawLineBezier(::Vector2 startPos, Vector2 endPos, float thick) {
::DrawLineBezier(startPos, endPos, thick, *this);
return *this;
}
inline Color& DrawLineStrip(::Vector2 *points, int numPoints) {
::DrawLineStrip(points, numPoints, *this);
return *this;
@@ -166,6 +170,7 @@ class Color : public ::Color {
::DrawText(text.c_str(), posX, posY, fontSize, *this);
return *this;
}
inline Color& DrawText(::Font font, const std::string& text, ::Vector2 position,
float fontSize, float spacing) {
::DrawTextEx(font, text.c_str(), position, fontSize, spacing, *this);

View File

@@ -84,11 +84,13 @@ class Font : public ::Font {
::DrawTextEx(*this, text.c_str(), position, fontSize, spacing, tint);
return *this;
}
inline Font& DrawText(const std::string& text, ::Rectangle rec, float fontSize, float spacing,
bool wordWrap, ::Color tint = WHITE) {
::DrawTextRec(*this, text.c_str(), rec, fontSize, spacing, wordWrap, tint);
return *this;
}
inline Font& DrawText(const std::string& text, ::Rectangle rec, float fontSize, float spacing,
bool wordWrap, Color tint, int selectStart, int selectLength, ::Color selectText,
Color selectBack) {

View File

@@ -72,6 +72,7 @@ class Gamepad {
inline bool IsButtonReleased(int button) const {
return ::IsGamepadButtonReleased(number, button);
}
inline bool IsButtonUp(int button) const {
return ::IsGamepadButtonUp(number, button);
}

View File

@@ -195,6 +195,7 @@ class Image : public ::Image {
::ImageResize(this, newWidth, newHeight);
return *this;
}
inline Image& ResizeNN(int newWidth, int newHeight) {
::ImageResizeNN(this, newWidth, newHeight);
return *this;
@@ -303,22 +304,27 @@ class Image : public ::Image {
::ImageDrawCircleV(this, center, radius, color);
return *this;
}
inline Image& DrawRectangle(int posX, int posY, int width, int height, ::Color color = WHITE) {
::ImageDrawRectangle(this, posX, posY, width, height, color);
return *this;
}
inline Image& DrawRectangle(Vector2 position, Vector2 size, ::Color color = WHITE) {
::ImageDrawRectangleV(this, position, size, color);
return *this;
}
inline Image& DrawRectangle(::Rectangle rec, ::Color color = WHITE) {
::ImageDrawRectangleRec(this, rec, color);
return *this;
}
inline Image& DrawRectangleLines(::Rectangle rec, int thick, ::Color color) {
::ImageDrawRectangleLines(this, rec, thick, color);
return *this;
}
inline Image& Draw(const ::Image& src, ::Rectangle srcRec, ::Rectangle dstRec,
::Color tint = WHITE) {
::ImageDraw(this, src, srcRec, dstRec, tint);
@@ -340,6 +346,7 @@ class Image : public ::Image {
::ImageDrawText(this, text.c_str(), x, y, fontSize, color);
return *this;
}
inline Image& DrawText(::Font font, const std::string& text, ::Vector2 position,
float fontSize, float spacing, ::Color tint = WHITE) {
::ImageDrawTextEx(this, font, text.c_str(), position, fontSize, spacing, tint);
@@ -353,6 +360,7 @@ class Image : public ::Image {
inline ::Vector4* GetImageDataNormalized() {
return ::GetImageDataNormalized(*this);
}
inline operator Texture2D() {
return ::LoadTextureFromImage(*this);
}

View File

@@ -135,57 +135,74 @@ class Matrix : public ::Matrix {
}
#ifndef RAYLIB_CPP_NO_MATH
float Trace() {
inline float Trace() {
return ::MatrixTrace(*this);
}
Matrix Transpose() {
inline Matrix Transpose() {
return ::MatrixTranspose(*this);
}
Matrix Invert() {
inline Matrix Invert() {
return ::MatrixInvert(*this);
}
Matrix Normalize() {
inline Matrix Normalize() {
return ::MatrixNormalize(*this);
}
static Matrix Identity() {
return ::MatrixIdentity();
}
Matrix Add(::Matrix right) {
return ::MatrixAdd(*this, right);
}
Matrix operator+(const Matrix& matrix) {
return ::MatrixAdd(*this, matrix);
}
Matrix Subtract(::Matrix right) {
return ::MatrixSubtract(*this, right);
}
Matrix operator-(const Matrix& matrix) {
return ::MatrixSubtract(*this, matrix);
}
static Matrix Translate(float x, float y, float z) {
return ::MatrixTranslate(x, y, z);
}
static Matrix Rotate(Vector3 axis, float angle) {
return ::MatrixRotate(axis, angle);
}
static Matrix RotateXYZ(Vector3 angle) {
return ::MatrixRotateXYZ(angle);
}
static Matrix RotateX(float angle) {
return ::MatrixRotateX(angle);
}
static Matrix RotateY(float angle) {
return ::MatrixRotateY(angle);
}
static Matrix RotateZ(float angle) {
return ::MatrixRotateZ(angle);
}
static Matrix Scale(float x, float y, float z) {
return ::MatrixScale(x, y, z);
}
Matrix Multiply(Matrix right) {
return ::MatrixMultiply(*this, right);
}
Matrix operator*(const Matrix& matrix) {
return ::MatrixMultiply(*this, matrix);
}
@@ -211,6 +228,7 @@ class Matrix : public ::Matrix {
inline float16 ToFloatV() {
return ::MatrixToFloatV(*this);
}
operator float16() {
return ToFloatV();
}

View File

@@ -35,44 +35,56 @@ class Mouse {
inline bool IsButtonPressed(int button) const {
return ::IsMouseButtonPressed(button);
}
inline bool IsButtonDown(int button) const {
return ::IsMouseButtonDown(button);
}
inline bool IsButtonReleased(int button) const {
return ::IsMouseButtonReleased(button);
}
inline bool IsButtonUp(int button) const {
return ::IsMouseButtonUp(button);
}
inline int GetX() const {
return ::GetMouseX();
}
inline int GetY() const {
return ::GetMouseY();
}
inline Mouse& SetX(int x) {
::SetMouseOffset(x, GetY());
return *this;
}
inline Mouse& SetY(int y) {
::SetMouseOffset(GetX(), y);
return *this;
}
inline Vector2 GetPosition() const {
return ::GetMousePosition();
}
inline Mouse& SetPosition(int x, int y) {
::SetMousePosition(x, y);
return *this;
}
inline Mouse& SetOffset(int offsetX, int offsetY) {
::SetMouseOffset(offsetX, offsetY);
return *this;
}
inline Mouse& SetScale(float scaleX, float scaleY) {
::SetMouseScale(scaleX, scaleY);
return *this;
}
inline float GetWheelMove() const {
return ::GetMouseWheelMove();
}
@@ -80,6 +92,7 @@ class Mouse {
inline int GetCursor() const {
return ::GetMouseCursor();
}
inline Mouse& SetCursor(int cursor) {
::SetMouseCursor(cursor);
return *this;
@@ -88,9 +101,11 @@ class Mouse {
inline int GetTouchX() const {
return ::GetTouchX();
}
inline int GetTouchY() const {
return ::GetTouchY();
}
inline Vector2 GetTouchPosition(int index) const {
return ::GetTouchPosition(index);
}

View File

@@ -80,6 +80,7 @@ class Sound : public ::Sound {
::StopSound(*this);
return *this;
}
inline Sound& Pause() {
::PauseSound(*this);
return *this;
@@ -102,10 +103,12 @@ class Sound : public ::Sound {
inline bool IsPlaying() const {
return ::IsSoundPlaying(*this);
}
inline Sound& SetVolume(float volume) {
::SetSoundVolume(*this, volume);
return *this;
}
inline Sound& SetPitch(float pitch) {
::SetSoundPitch(*this, pitch);
return *this;

View File

@@ -96,6 +96,7 @@ class Texture : public ::Texture {
inline Image GetTextureData() const {
return ::GetTextureData(*this);
}
inline operator raylib::Image() {
return GetTextureData();
}
@@ -124,6 +125,7 @@ class Texture : public ::Texture {
::DrawTextureV(*this, position, tint);
return *this;
}
inline Texture& Draw(::Vector2 position, float rotation, float scale = 1.0f,
::Color tint = WHITE) {
::DrawTextureEx(*this, position, rotation, scale, tint);

View File

@@ -34,6 +34,7 @@ class VrSimulator {
VrSimulator() {
Init();
}
VrSimulator(::VrDeviceInfo info, ::Shader distortion) {
Init();
Set(info, distortion);
@@ -55,18 +56,22 @@ class VrSimulator {
::UpdateVrTracking(camera);
return *this;
}
inline VrSimulator& Set(::VrDeviceInfo info, ::Shader distortion) {
::SetVrConfiguration(info, distortion);
return *this;
}
inline VrSimulator& Toggle() {
::ToggleVrMode();
return *this;
}
inline VrSimulator& Begin() {
::BeginVrDrawing();
return *this;
}
inline VrSimulator& End() {
::EndVrDrawing();
return *this;

View File

@@ -106,7 +106,7 @@ class Wave : public ::Wave {
return ::LoadSoundFromWave(*this);
}
inline float* GetWaveData() {
inline float* GetData() {
return ::GetWaveData(*this);
}

View File

@@ -85,15 +85,19 @@ class Window {
inline static bool IsReady() {
return ::IsWindowReady();
}
inline bool IsMinimized() const {
return ::IsWindowMinimized();
}
inline bool IsFocused() const {
return ::IsWindowFocused();
}
inline bool IsResized() const {
return ::IsWindowResized();
}
inline bool IsHidden() const {
return ::IsWindowHidden();
}
@@ -101,42 +105,52 @@ class Window {
inline bool IsFullscreen() const {
return ::IsWindowFullscreen();
}
inline Window& ToggleFullscreen() {
::ToggleFullscreen();
return *this;
}
inline Window& Unhide() {
::UnhideWindow();
return *this;
}
inline Window& Hide() {
::HideWindow();
return *this;
}
inline Window& SetIcon(Image image) {
::SetWindowIcon(image);
return *this;
}
inline Window& SetTitle(const std::string& title) {
::SetWindowTitle(title.c_str());
return *this;
}
inline Window& SetPosition(int x, int y) {
::SetWindowPosition(x, y);
return *this;
}
inline Window& SetMonitor(int monitor) {
::SetWindowMonitor(monitor);
return *this;
}
inline Window& SetMinSize(int width, int height) {
::SetWindowMinSize(width, height);
return *this;
}
inline Window& SetSize(int width, int height) {
::SetWindowSize(width, height);
return *this;
}
inline void* GetHandle() const {
return ::GetWindowHandle();
}

2
vendor/raylib vendored