Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
libretro-chailove
Commits
69dc710c
Verified
Commit
69dc710c
authored
Mar 05, 2018
by
RobLoach
Browse files
Update graphics.draw()
parent
de898d7a
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
69dc710c
...
...
@@ -4,6 +4,15 @@ 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
)
.
## 0.16.0 - 2018-03-05
### Fixed
-
Fix undefined zlib symbols in debug build
-
By
[
@fetzerch
](
https://github.com/fetzerch
)
in
[
#200
](
https://github.com/libretro/libretro-chailove/pull/200
)
### Changed
-
Added
`love.graphics.draw(Image)`
and
`love.graphics.draw(Image, Quad)`
with default position of 0,0
-
Update documentation
## 0.15.1 - 2017-03-05
### Changed
-
Update dependencies
...
...
src/love/graphics.cpp
View file @
69dc710c
...
...
@@ -95,6 +95,10 @@ graphics& graphics::line(int x1, int y1, int x2, int y2) {
return
*
this
;
}
graphics
&
graphics
::
draw
(
Image
*
image
)
{
return
draw
(
image
);
}
graphics
&
graphics
::
draw
(
Image
*
image
,
int
x
,
int
y
)
{
if
(
image
&&
image
->
loaded
())
{
SDL_Rect
dstrect
;
...
...
@@ -106,6 +110,10 @@ graphics& graphics::draw(Image* image, int x, int y) {
return
*
this
;
}
graphics
&
graphics
::
draw
(
Image
*
image
,
Quad
quad
)
{
return
draw
(
image
,
quad
,
0
,
0
);
}
graphics
&
graphics
::
draw
(
Image
*
image
,
Quad
quad
,
int
x
,
int
y
)
{
if
(
image
&&
image
->
loaded
())
{
SDL_Rect
dest
;
...
...
src/love/graphics.h
View file @
69dc710c
...
...
@@ -72,23 +72,13 @@ class graphics {
/**
* @brief Draws a line.
*/
graphics
&
line
(
int
x1
,
int
y1
,
int
x2
,
int
y2
);
/**
* @brief Draws an image on screen.
*
* @param image The image to draw on the screen.
* @param x The position to draw the object (x-axis).
* @param y The position to draw the object (y-axis).
*/
graphics
&
draw
(
Image
*
image
,
int
x
,
int
y
);
/**
* @brief Draws an image on screen, using the given Quad as a source.
* @param x1 The position of first point on the x-axis.
* @param y1 The position of first point on the y-axis.
* @param x2 The position of second point on the x-axis.
* @param y2 The position of second point on the y-axis.
*/
graphics
&
draw
(
Image
*
image
,
Quad
quad
,
int
x
,
int
y
);
graphics
&
line
(
int
x1
,
int
y1
,
int
x
2
,
int
y
2
);
/**
* @brief Creates a new Quad.
...
...
@@ -246,6 +236,19 @@ class graphics {
graphics
&
draw
(
Image
*
image
,
int
x
,
int
y
,
float
r
,
float
sx
,
float
sy
);
graphics
&
draw
(
Image
*
image
,
int
x
,
int
y
,
float
r
,
float
sx
);
graphics
&
draw
(
Image
*
image
,
int
x
,
int
y
,
float
r
);
graphics
&
draw
(
Image
*
image
,
int
x
,
int
y
);
graphics
&
draw
(
Image
*
image
);
/**
* @brief Draws an image on screen, using the given Quad as a source.
*
* @param image The image to draw on the screen.
* @param quad The source quad of the image.
* @param x (0) The position to draw the object (x-axis).
* @param y (0) The position to draw the object (y-axis).
*/
graphics
&
draw
(
Image
*
image
,
Quad
quad
,
int
x
,
int
y
);
graphics
&
draw
(
Image
*
image
,
Quad
quad
);
/**
* @brief Draws an arc.
...
...
src/love/script.cpp
View file @
69dc710c
...
...
@@ -196,6 +196,7 @@ script::script(const std::string& file) {
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
int
,
int
,
int
>
(
&
graphics
::
setBackgroundColor
),
"setBackgroundColor"
);
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
Image
*
,
int
,
int
>
(
&
graphics
::
draw
),
"draw"
);
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
Image
*>
(
&
graphics
::
draw
),
"draw"
);
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
Image
*
,
int
,
int
,
float
,
float
,
float
,
float
,
float
>
(
&
graphics
::
draw
),
"draw"
);
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
Image
*
,
int
,
int
,
float
,
float
,
float
,
float
>
(
&
graphics
::
draw
),
"draw"
);
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
Image
*
,
int
,
int
,
float
,
float
,
float
>
(
&
graphics
::
draw
),
"draw"
);
...
...
@@ -203,6 +204,8 @@ script::script(const std::string& file) {
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
Image
*
,
int
,
int
,
float
>
(
&
graphics
::
draw
),
"draw"
);
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
Image
*
,
Quad
,
int
,
int
>
(
&
graphics
::
draw
),
"draw"
);
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
Image
*
,
Quad
>
(
&
graphics
::
draw
),
"draw"
);
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
int
,
int
,
int
,
int
>
(
&
graphics
::
clear
),
"clear"
);
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
,
int
,
int
,
int
>
(
&
graphics
::
clear
),
"clear"
);
chai
.
add
(
fun
<
love
::
graphics
&
,
graphics
>
(
&
graphics
::
clear
),
"clear"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment