Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F125848
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/util/gradient.cpp b/util/gradient.cpp
index ad569bff..091ac860 100644
--- a/util/gradient.cpp
+++ b/util/gradient.cpp
@@ -1,54 +1,54 @@
#include "gradient.h"
#include "funcs.h"
namespace Effects{
/* this class does virtually no error checking. great job */
Gradient::Gradient(int size, Graphics::Color startColor, Graphics::Color endColor):
colors(0),
size(size),
index(0){
colors = new Graphics::Color[size];
Graphics::blend_palette(colors, size / 2, startColor, endColor);
Graphics::blend_palette(colors + size / 2, size / 2, endColor, startColor);
}
Gradient::Gradient(const Gradient & copy):
colors(NULL),
size(copy.size),
index(copy.index){
colors = new Graphics::Color[size];
- for (int i = 0; i < size; i++){
+ for (unsigned int i = 0; i < size; i++){
colors[i] = copy.colors[i];
}
}
void Gradient::forward(){
index = (index + 1) % size;
}
void Gradient::backward(){
index = (index - 1 + size) % size;
}
void Gradient::update(){
forward();
}
void Gradient::reset(){
index = 0;
}
Graphics::Color Gradient::current() const {
return colors[index];
}
Graphics::Color Gradient::current(int offset) const {
return colors[(index + offset + size) % size];
}
Gradient::~Gradient(){
delete[] colors;
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Jun 11, 9:54 AM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
68224
Default Alt Text
(1 KB)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline