mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-30 04:20:23 +00:00
Use fixmath lib in point shapes
This commit is contained in:
parent
3e7f54f289
commit
21e700da4f
@ -22,8 +22,19 @@ if(MSVC)
|
||||
endif(MSVC)
|
||||
|
||||
# Libraries in this directory
|
||||
set(aseprite_libraries app-lib css-lib doc-lib raster-lib
|
||||
scripting-lib undo-lib filters-lib ui-lib she gfx-lib base-lib)
|
||||
set(aseprite_libraries
|
||||
app-lib
|
||||
fixmath-lib
|
||||
css-lib
|
||||
doc-lib
|
||||
raster-lib
|
||||
scripting-lib
|
||||
undo-lib
|
||||
filters-lib
|
||||
ui-lib
|
||||
she
|
||||
gfx-lib
|
||||
base-lib)
|
||||
|
||||
# Directories where .h files can be found
|
||||
include_directories(. .. ../third_party)
|
||||
|
@ -132,24 +132,24 @@ public:
|
||||
|
||||
// In Windows, rand() has a RAND_MAX too small
|
||||
#if RAND_MAX <= 0xffff
|
||||
fixed angle, radius;
|
||||
fixmath::fixed angle, radius;
|
||||
|
||||
for (c=0; c<times; c++) {
|
||||
angle = itofix(rand() * 256 / RAND_MAX);
|
||||
radius = itofix(rand() * (spray_width*10) / RAND_MAX) / 10;
|
||||
u = fixtoi(fixmul(radius, fixcos(angle)));
|
||||
v = fixtoi(fixmul(radius, fixsin(angle)));
|
||||
angle = fixmath::itofix(rand() * 256 / RAND_MAX);
|
||||
radius = fixmath::itofix(rand() * (spray_width*10) / RAND_MAX) / 10;
|
||||
u = fixmath::fixtoi(fixmath::fixmul(radius, fixmath::fixcos(angle)));
|
||||
v = fixmath::fixtoi(fixmath::fixmul(radius, fixmath::fixsin(angle)));
|
||||
|
||||
m_subPointShape.transformPoint(loop, x+u, y+v);
|
||||
}
|
||||
#else
|
||||
fixed angle, radius;
|
||||
fixmath::fixed angle, radius;
|
||||
|
||||
for (c=0; c<times; c++) {
|
||||
angle = rand();
|
||||
radius = rand() % itofix(spray_width);
|
||||
u = fixtoi(fixmul(radius, fixcos(angle)));
|
||||
v = fixtoi(fixmul(radius, fixsin(angle)));
|
||||
radius = rand() % fixmath::itofix(spray_width);
|
||||
u = fixmath::fixtoi(fixmath::fixmul(radius, fixmath::fixcos(angle)));
|
||||
v = fixmath::fixtoi(fixmath::fixmul(radius, fixmath::fixsin(angle)));
|
||||
m_subPointShape.transformPoint(loop, x+u, y+v);
|
||||
}
|
||||
#endif
|
||||
|
@ -30,15 +30,13 @@
|
||||
#include "app/tools/tool_group.h"
|
||||
#include "app/tools/tool_loop.h"
|
||||
#include "base/exception.h"
|
||||
#include "fixmath/fixmath.h"
|
||||
#include "raster/algo.h"
|
||||
#include "raster/brush.h"
|
||||
#include "raster/image.h"
|
||||
#include "raster/mask.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <allegro/file.h>
|
||||
#include <allegro/fixed.h>
|
||||
#include <allegro/fmaths.h>
|
||||
|
||||
#include "app/tools/controllers.h"
|
||||
#include "app/tools/inks.h"
|
||||
|
@ -3,6 +3,10 @@
|
||||
* Based on Allegro library by Shawn Hargreaves.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "fixmath/fixmath.h"
|
||||
|
||||
#include <cmath>
|
||||
|
Loading…
x
Reference in New Issue
Block a user