Skip to content

Commit 70349fe

Browse files
committed
[migration] removed all palette code
1 parent 58334e0 commit 70349fe

52 files changed

Lines changed: 639 additions & 1370 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Makefile.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ OBJ_NAMES = \
129129
netplay \
130130
network \
131131
options \
132-
palette \
133132
parser \
134133
path \
135134
ping \

src/alleg2.c

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ typedef char *(*my_getfuncptr) (int, int *);
7070
/*==================================================================*/
7171
extern void _draw_scrollable_frame (DIALOG * d,
7272
int listsize, int offset, int height,
73-
int fg_color, int bg);
73+
ALLEGRO_COLOR fg_color, ALLEGRO_COLOR bg);
7474
extern int isspace (int c);
7575

7676
static void my_handle_scrollable_scroll_click (DIALOG * d, int listsize,
@@ -91,7 +91,7 @@ static void my_handle_listbox_click (DIALOG * d);
9191
* Draws a dotted rectangle, for showing an object has the input focus.
9292
*/
9393
static void
94-
my_dotted_rect (int x1, int y1, int x2, int y2, int fg, int bg)
94+
my_dotted_rect (int x1, int y1, int x2, int y2, ALLEGRO_COLOR fg, ALLEGRO_COLOR bg)
9595
{
9696
ALLEGRO_BITMAP *gui_bmp = gui_get_screen ();
9797
int x = ((x1 + y1) & 1) ? 1 : 0;
@@ -116,7 +116,7 @@ my_dotted_rect (int x1, int y1, int x2, int y2, int fg, int bg)
116116
static void
117117
my_draw_textbox (char *thetext, int *listsize, int draw, int offset,
118118
int wword, int tabsize, int x, int y, int w, int h,
119-
int disabled, int fore, int deselect, int disable)
119+
int disabled, ALLEGRO_COLOR fore, ALLEGRO_COLOR deselect, ALLEGRO_COLOR disable)
120120
{
121121
ALLEGRO_BITMAP *gui_bmp = gui_get_screen ();
122122
int y1 = y + 4;
@@ -271,7 +271,7 @@ my_draw_textbox (char *thetext, int *listsize, int draw, int offset,
271271
{
272272
usetc (s + usetc (s, ' '), 0);
273273
//textout_ex(gui_bmp, font, s, x1, y1, fg, deselect);
274-
textout_ex (gui_bmp, font, s, x1, y1, -1, deselect); // ufoot
274+
textout_ex (gui_bmp, font, s, x1, y1, NO_COLOR, deselect); // ufoot
275275
x1 += text_length (font, s);
276276
}
277277
break;
@@ -282,7 +282,7 @@ my_draw_textbox (char *thetext, int *listsize, int draw, int offset,
282282
{
283283
usetc (s + usetc (s, ugetc (printed)), 0);
284284
//textout_ex(gui_bmp, font, s, x1, y1, fg, deselect);
285-
textout_ex (gui_bmp, font, s, x1, y1, -1, deselect); // ufoot
285+
textout_ex (gui_bmp, font, s, x1, y1, NO_COLOR, deselect); // ufoot
286286
x1 += text_length (font, s);
287287
}
288288
}
@@ -334,7 +334,7 @@ my_textbox_proc (int msg, DIALOG * d, int c)
334334
int height, bar, ret = D_O_K;
335335
int start, top, bottom, l;
336336
int used, delta;
337-
int fg_color;
337+
ALLEGRO_COLOR fg_color;
338338
ALLEGRO_ASSERT (d);
339339

340340
fg_color = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
@@ -349,15 +349,15 @@ my_textbox_proc (int msg, DIALOG * d, int c)
349349
my_draw_textbox (d->dp, &d->d1, 0, /* DONT DRAW anything */
350350
d->d2, !(d->flags & D_SELECTED), 8,
351351
d->x, d->y, d->w, d->h,
352-
(d->flags & D_DISABLED), 0, 0, 0);
352+
(d->flags & D_DISABLED), NO_COLOR, NO_COLOR, NO_COLOR);
353353
break;
354354

355355
case MSG_DRAW:
356356
/* tell the object to sort of draw, but only calculate the listsize */
357357
my_draw_textbox (d->dp, &d->d1, 0, /* DONT DRAW anything */
358358
d->d2, !(d->flags & D_SELECTED), 8,
359359
d->x, d->y, d->w, d->h,
360-
(d->flags & D_DISABLED), 0, 0, 0);
360+
(d->flags & D_DISABLED), NO_COLOR, NO_COLOR, NO_COLOR);
361361

362362
if (d->d1 > height && d->d1 > 1) // ufoot
363363
{
@@ -501,9 +501,10 @@ int
501501
my_button_proc (int msg, DIALOG * d, int c)
502502
{
503503
ALLEGRO_BITMAP *gui_bmp;
504-
int state1, state2;
505-
int black;
504+
ALLEGRO_COLOR state1, state2;
505+
ALLEGRO_COLOR black;
506506
int swap;
507+
int click_state1, click_state2; // Boolean states for MSG_CLICK
507508
int g;
508509
ALLEGRO_ASSERT (d);
509510

@@ -532,8 +533,8 @@ my_button_proc (int msg, DIALOG * d, int c)
532533
d->y + d->h - 3 + g, state2);
533534
rect (gui_bmp, d->x + g, d->y + g, d->x + d->w - 2 + g,
534535
d->y + d->h - 2 + g, state1);
535-
//gui_textout_ex(gui_bmp, d->dp, d->x+d->w/2+g, d->y+d->h/2-text_height(font)/2+g, state1, -1, TRUE);
536-
gui_textout_ex (gui_bmp, d->dp, d->x + d->w / 2 + g, d->y + d->h / 2 - text_height (font) / 2 + g, -1, -1, TRUE); // ufoot
536+
//gui_textout_ex(gui_bmp, d->dp, d->x+d->w/2+g, d->y+d->h/2-text_height(font)/2+g, state1, NO_COLOR, TRUE);
537+
gui_textout_ex (gui_bmp, d->dp, d->x + d->w / 2 + g, d->y + d->h / 2 - text_height (font) / 2 + g, NO_COLOR, NO_COLOR, TRUE); // ufoot
537538

538539
if (d->flags & D_SELECTED)
539540
{
@@ -542,7 +543,7 @@ my_button_proc (int msg, DIALOG * d, int c)
542543
}
543544
else
544545
{
545-
black = 0; // [FIXME:ufoot] sounds a bit hardcoded, double-check this
546+
black = al_map_rgb(0, 0, 0); // [FIXME:ufoot] sounds a bit hardcoded, double-check this
546547
vline (gui_bmp, d->x + d->w - 1, d->y + 1, d->y + d->h - 2, black);
547548
hline (gui_bmp, d->x + 1, d->y + d->h - 1, d->x + d->w - 1, black);
548549
}
@@ -569,26 +570,26 @@ my_button_proc (int msg, DIALOG * d, int c)
569570

570571
case MSG_CLICK:
571572
/* what state was the button originally in? */
572-
state1 = d->flags & D_SELECTED;
573+
click_state1 = d->flags & D_SELECTED;
573574
if (d->flags & D_EXIT)
574575
swap = FALSE;
575576
else
576-
swap = state1;
577+
swap = click_state1;
577578

578579
/* track the mouse until it is released */
579580
while (gui_mouse_b ())
580581
{
581-
state2 = ((gui_mouse_x () >= d->x) && (gui_mouse_y () >= d->y) &&
582+
click_state2 = ((gui_mouse_x () >= d->x) && (gui_mouse_y () >= d->y) &&
582583
(gui_mouse_x () < d->x + d->w)
583584
&& (gui_mouse_y () < d->y + d->h));
584585
if (swap)
585-
state2 = !state2;
586+
click_state2 = !click_state2;
586587

587588
/* redraw? */
588-
if (((state1) && (!state2)) || ((state2) && (!state1)))
589+
if (((click_state1) && (!click_state2)) || ((click_state2) && (!click_state1)))
589590
{
590591
d->flags ^= D_SELECTED;
591-
state1 = d->flags & D_SELECTED;
592+
click_state1 = d->flags & D_SELECTED;
592593
object_message (d, MSG_DRAW, 0);
593594
}
594595

@@ -627,7 +628,7 @@ my_text_proc (int msg, DIALOG * d, int c)
627628
font = d->dp2;
628629

629630
//gui_textout_ex(gui_get_screen(), d->dp, d->x, d->y, fg, d->bg, FALSE);
630-
gui_textout_ex (gui_get_screen (), d->dp, d->x, d->y, -1, d->bg, FALSE); // ufoot
631+
gui_textout_ex (gui_get_screen (), d->dp, d->x, d->y, NO_COLOR, d->bg, FALSE); // ufoot
631632

632633
font = oldfont;
633634
}
@@ -654,7 +655,7 @@ my_ctext_proc (int msg, DIALOG * d, int c)
654655
font = d->dp2;
655656

656657
//gui_textout_ex(gui_get_screen(), d->dp, d->x + d->w/2, d->y, fg, d->bg, TRUE);
657-
gui_textout_ex (gui_get_screen (), d->dp, d->x + d->w / 2, d->y, -1, d->bg, TRUE); // ufoot
658+
gui_textout_ex (gui_get_screen (), d->dp, d->x + d->w / 2, d->y, NO_COLOR, d->bg, TRUE); // ufoot
658659

659660
font = oldfont;
660661
}
@@ -682,7 +683,7 @@ my_slider_proc (int msg, DIALOG * d, int c)
682683
ALLEGRO_BITMAP *gui_bmp = gui_get_screen ();
683684
ALLEGRO_BITMAP *slhan = NULL;
684685
int oldpos, newpos;
685-
int sfg; /* slider foreground color */
686+
ALLEGRO_COLOR sfg; /* slider foreground color */
686687
int vert = TRUE; /* flag: is slider vertical? */
687688
int hh = 7; /* handle height (width for horizontal sliders) */
688689
int hmar; /* handle margin */
@@ -1026,7 +1027,7 @@ my_edit_proc (int msg, DIALOG * d, int c)
10261027
break;
10271028
f = ((p == d->d2) && (d->flags & D_GOTFOCUS));
10281029
//textout_ex(gui_bmp, font, buf, d->x+x, d->y, (f) ? d->bg : fg, (f) ? fg : d->bg);
1029-
textout_ex (gui_bmp, font, buf, d->x + x, d->y, -1, (f) ? d->fg : d->bg); // ufoot
1030+
textout_ex (gui_bmp, font, buf, d->x + x, d->y, NO_COLOR, (f) ? d->fg : d->bg); // ufoot
10301031
x += w;
10311032
}
10321033
if (x < d->w)
@@ -1334,7 +1335,7 @@ my_draw_listbox (DIALOG * d)
13341335
{
13351336
ALLEGRO_BITMAP *gui_bmp = gui_get_screen ();
13361337
int height, listsize, i, len, bar, x, y, w;
1337-
int fg_color, bg;
1338+
ALLEGRO_COLOR fg_color, bg;
13381339
char *sel = d->dp2;
13391340
char s[1024];
13401341

@@ -1386,7 +1387,7 @@ my_draw_listbox (DIALOG * d)
13861387
usetat (s, len, 0, sizeof (s));
13871388
}
13881389
//textout_ex(gui_bmp, font, s, x, y, fg, bg);
1389-
textout_ex (gui_bmp, font, s, x, y, -1, bg); // ufoot
1390+
textout_ex (gui_bmp, font, s, x, y, NO_COLOR, bg); // ufoot
13901391
x += text_length (font, s);
13911392
if (x <= d->x + w)
13921393
rectfill (gui_bmp, x, y, d->x + w, y + text_height (font) - 1,

src/back.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656

5757
#include "back.h"
5858
#include "disk.h"
59-
#include "palette.h"
6059
#include "viewport.h"
6160
#include "dialog.h"
6261

0 commit comments

Comments
 (0)