Verified Commit 97467018 authored by RobLoach's avatar RobLoach
Browse files

0.11.0

parent 996a1c90
......@@ -4,17 +4,17 @@ All notable changes to [ChaiLove](https://github.com/RobLoach/ChaiLove) will be
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased] - xxxx-xx-xx
## [0.11.0] - 2017-12-09
### Added
- `love` namespace
- Example: `love.graphics.draw()`
- Rotation and scaling for `love.graphics.draw()`
### Changed
- ChaiScript_Extras now using original source, upstream GCC issue fixed
- Updated libretro-common
- Updated random
- Updated sdl-libretro
- [ChaiScript_Extras](https://github.com/ChaiScript/ChaiScript_Extras) now using original source as upstream issue is fixed
- Updated [libretro-common](http://github.com/libretro/libretro-common)
- Updated [random](https://github.com/libretro/sdl-libretro)
- Updated [sdl-libretro](https://github.com/libretro/sdl-libretro)
### Fixed
- `keyreleased()` callback parameter types
......
......@@ -11,8 +11,8 @@
* global y
*
* def load() {
* graphics.setBackgroundColor(54, 172, 248)
* logo = graphics.newImage("logo.png")
* love.graphics.setBackgroundColor(54, 172, 248)
* logo = love.graphics.newImage("logo.png")
* x = 10.0f
* y = 10.0f
* }
......@@ -23,8 +23,8 @@
* }
*
* def draw() {
* graphics.print("Hello World!", 100, 100)
* graphics.draw(logo, x, y)
* love.graphics.print("Hello World!", 100, 100)
* love.graphics.draw(logo, x, y)
* }
* @endcode
*
......
......@@ -37,7 +37,7 @@ class graphics {
* @param height Height of the rectangle.
*
* @code
* graphics.rectangle("fill", 100, 100, 50, 50)
* love.graphics.rectangle("fill", 100, 100, 50, 50)
* @endcode
*/
void rectangle(const std::string& drawmode, int x, int y, int width, int height);
......
......@@ -54,6 +54,18 @@ class joystick {
std::string getButtonName(int key);
int16_t joystick_cache[4][14];
/**
* @brief Retrieve the given joystick.
*
* ### Example
* @code
* love.joystick[0].isDown("left")
* @endcode
*
* @param player The number of which player's joystick you would like to retrieve.
*
* @return The joystick of the given player number.
*/
Joystick& operator[](int i);
};
......
......@@ -47,11 +47,11 @@ class script {
* global hamster
*
* def load() {
* hamster = graphics.newImage("hamster.png")
* hamster = love.graphics.newImage("hamster.png")
* }
*
* def draw() {
* graphics.draw(hamster, 100, 100)
* love.graphics.draw(hamster, 100, 100)
* }
* @endcode
*/
......@@ -71,10 +71,10 @@ class script {
* var rate = 3
*
* def update(dt) {
* if (keyboard.isDown("down")) {
* if (love.keyboard.isDown("down")) {
* position -= dt * rate
* }
* if (keyboard.isDown("up")) {
* if (love.keyboard.isDown("up")) {
* position += dt * rate
* }
* }
......@@ -93,11 +93,11 @@ class script {
* global hamster
*
* dev load() {
* hamster = graphics.newImage("hamster.png")
* hamster = love.graphics.newImage("hamster.png")
* }
*
* def love.draw() {
* graphics.draw(hamster, 100, 100)
* love.graphics.draw(hamster, 100, 100)
* }
* @endcode
*/
......
......@@ -7,24 +7,48 @@ namespace Types {
namespace Graphics {
/**
* @brief A color.
* @brief A color, holding red, green, blue and alpha values.
*/
struct Color {
/**
* @brief Create a color with the value of 0, 0, 0, 0.
*/
Color() : r(0), g(0), b(0), a(0) {
// Nothing.
}
/**
* @brief Create a new color.
*/
Color(int rValue, int gValue, int bValue, int aValue) : r(rValue), g(gValue), b(bValue), a(aValue) {
// Nothing.
}
/**
* @brief Create a new color.
*/
Color(int rValue, int gValue, int bValue) : r(rValue), g(gValue), b(bValue) {
// Nothing.
}
/**
* @brief The amount of red.
*/
int r;
/**
* @brief The amount of green.
*/
int g;
/**
* @brief The amount of blue.
*/
int b;
/**
* @brief The amount of alpha.
*/
int a;
SDL_Color toSDLColor() {
......
......@@ -29,14 +29,17 @@ class Font {
TTF_Font* ttfFont = NULL;
TTY_Font* ttyFont = NULL;
int ttyFontWidth, ttyFontHeight;
/**
* @brief Determines the vertical size the given text needs.
*/
int getHeight(const std::string& text);
/**
* @brief Determines the vertical size a line of text needs.
*/
int getHeight();
/**
* @brief Determines the horizontal size a line of text needs.
*/
......
......@@ -11,7 +11,28 @@ namespace Graphics {
*/
class Quad {
public:
int x, y, width, height, sw, sh;
/**
* @brief The x coordinate.
*/
int x;
/**
* @brief The y coordinate.
*/
int y;
/**
* @brief The width of the Quad.
*/
int width;
/**
* @brief The height of the Quad.
*/
int height;
int sw
int sh;
Quad();
Quad(int x, int y, int width, int height, int sw, int sh);
Quad(int x, int y, int width, int height);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment