21static inline unsigned char
25 float t = (float) val * log10f(power) / 2.0F;
29 return std::min(val, 255);
37 auto *color = (
unsigned char *) col;
38 *color =
lighten (*color, power);
40 *color =
lighten (*color, power);
42 *color =
lighten (*color, power);
44 *color =
lighten (*color, power);
53 l[i].x = ((float) i * rx) / 512.0F;
55 l[i].angle =
M_PI_F / 2.0F;
60 l[i].y = ((float) i * ry) / 512.0F;
67 l[i].angle = 2.0F *
M_PI_F * (float) i / 512.0F;
68 float cosa = param * cosf (l[i].angle);
69 float sina = param * sinf (l[i].angle);
70 l[i].x = ((float) rx / 2.0F) + cosa;
71 l[i].y = ((float) ry / 2.0F) + sina;
81 return (230 << (
ROUGE * 8)) | (120 << (
VERT * 8)) | (10 << (
BLEU * 8));
83 return (120 << (
VERT * 8)) | (252 << (
ROUGE * 8)) | (10 << (
BLEU * 8));
85 return (160 << (
VERT * 8)) | (236 << (
ROUGE * 8)) | (40 << (
BLEU * 8));
87 return (40 << (
BLEU * 8)) | (220 << (
ROUGE * 8)) | (140 << (
VERT * 8));
89 return (200 << (
VERT * 8)) | (80 << (
ROUGE * 8)) | (10 << (
BLEU * 8));
91 return (250 << (
BLEU * 8)) | (30 << (
VERT * 8)) | (80 << (
ROUGE * 8));
93 return 0x5 << (
BLEU * 8);
101 if (gml !=
nullptr) {
122 auto *c1 = (
unsigned char *) &l->
color;
123 auto *c2 = (
unsigned char *) &l->
color2;
124 for (
int i = 0; i < 4; i++) {
127 *c1 = (
unsigned char) ((cc1 * 63 + cc2) >> 6);
133 if (l->
power < 1.1F) {
137 if (l->
power > 17.5F) {
147 float param,
float amplitude,
int col)
159 int IDsrc,
float paramS,
int coulS,
160 int IDdest,
float paramD,
int coulD)
171 l->amplitude = l->amplitudeF = 1.0F;
173 genline (IDsrc, paramS, l->points, rx, ry);
174 genline (IDdest, paramD, l->points2, rx, ry);
200 if (line !=
nullptr) {
201 uint32_t color = line->
color;
204 float cosa = cosf (pt->
angle) / 1000.0F;
205 float sina = sinf (pt->
angle) / 1000.0F;
209 int x1 = (int) (pt->
x + (cosa * line->
amplitude * data[0]));
210 int y1 = (int) (pt->
y + (sina * line->
amplitude * data[0]));
215 cosa = cosf (pt->
angle) / 1000.0F;
216 sina = sinf (pt->
angle) / 1000.0F;
218 int x2 = (int) (pt->
x + (cosa * line->
amplitude * data[i]));
219 int y2 = (int) (pt->
y + (sina * line->
amplitude * data[i]));
static void draw_line(int *data, int x1, int y1, int x2, int y2, int col, int screenx, int screeny)
#define DRAWMETHOD_DONE()
std::array< int16_t, 512 > GoomSingleData
#define ROUGE
position des composantes
void goom_lines_set_res(GMLine *gml, int rx, int ry)
GMLine * goom_lines_init(int rx, int ry, int IDsrc, float paramS, int coulS, int IDdest, float paramD, int coulD)
static void goom_lines_move(GMLine *l)
static void genline(int id, float param, GMUnitArray &l, int rx, int ry)
static uint32_t getcouleur(int mode)
static void lightencolor(int *col, float power)
void goom_lines_switch_to(GMLine *gml, int IDdest, float param, float amplitude, int col)
void goom_lines_draw(GMLine *line, const GoomSingleData &data, unsigned int *p)
void goom_lines_free(GMLine **l)
static unsigned char lighten(unsigned char value, float power)
std::array< GMUnitPointer, LINENUMPOINTS > GMUnitArray
static const int LINENUMPOINTS
Convenience inline random number generator functions.
int MythRandomInt(int min, int max)
generate a uniformly distributed random signed int in the closed interval [min, max].