Skip to content

Commit 1305f1d

Browse files
authored
Merge pull request #1170 from The-E/PaletteCleanup
Removes the Palette Manager
2 parents 36c134f + b42fb82 commit 1305f1d

File tree

29 files changed

+24
-881
lines changed

29 files changed

+24
-881
lines changed

code/ai/aicode.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,12 +1238,12 @@ objp->orient = objp_orient_copy; //-V587
12381238
} else {
12391239
vm_forward_interpolate(&desired_fvec, &curr_orient, &vel_in, delta_time, delta_bank, &objp->orient, &vel_out, &vel_limit, &acc_limit);
12401240
}
1241-
1242-
#ifndef NDEBUG
1243-
if (!((objp->type == OBJ_WEAPON) && (Weapon_info[Weapons[objp->instance].weapon_info_index].subtype == WP_MISSILE))) {
1244-
Assertion(!(delta_time < 0.25f && vm_vec_dot(&objp->orient.vec.fvec, &tvec) < 0.1f), "A ship rotated too far. Offending vessel is %s, please investigate.\n", Ships[objp->instance].ship_name);
1245-
}
1246-
#endif
1241+
1242+
#ifndef NDEBUG
1243+
if (!((objp->type == OBJ_WEAPON) && (Weapon_info[Weapons[objp->instance].weapon_info_index].subtype == WP_MISSILE))) {
1244+
Assertion(!(delta_time < 0.25f && vm_vec_dot(&objp->orient.vec.fvec, &tvec) < 0.1f), "A ship rotated too far. Offending vessel is %s, please investigate.\n", Ships[objp->instance].ship_name);
1245+
}
1246+
#endif
12471247

12481248
pip->rotvel = vel_out;
12491249
}

code/bmpman/bmpman.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "io/timer.h"
3030
#include "jpgutils/jpgutils.h"
3131
#include "network/multiutil.h"
32-
#include "palman/palman.h"
3332
#include "parse/parselo.h"
3433
#include "pcxutils/pcxutils.h"
3534
#include "pngutils/pngutils.h"
@@ -2280,7 +2279,7 @@ void bm_lock_pcx(int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, int b
22802279
data = (ubyte *)bm_malloc(bitmapnum, be->mem_taken);
22812280
bmp->bpp = bpp;
22822281
bmp->data = (ptr_u)data;
2283-
bmp->palette = (bpp == 8) ? gr_palette : NULL;
2282+
bmp->palette = NULL;
22842283
memset(data, 0, be->mem_taken);
22852284

22862285
Assert(&be->bm == bmp);

code/graphics/2d.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "io/keycontrol.h" // m!m
3333
#include "io/timer.h"
3434
#include "osapi/osapi.h"
35-
#include "palman/palman.h"
3635
#include "scripting/scripting.h"
3736
#include "parse/parselo.h"
3837
#include "render/3d.h"
@@ -635,9 +634,7 @@ void gr_close()
635634
if ( !Gr_inited ) {
636635
return;
637636
}
638-
639-
palette_flush();
640-
637+
641638
font::close();
642639

643640
switch (gr_screen.mode) {
@@ -703,18 +700,13 @@ void gr_set_palette_internal( const char *name, ubyte * palette, int restrict_fo
703700
if (palette) {
704701
memmove(palette, Gr_current_palette, 768);
705702
}
706-
707-
// Update Palette Manager tables
708-
memmove( gr_palette, Gr_current_palette, 768 );
709-
palette_update(name, restrict_font_to_128);
710703
}
711704
}
712705

713706

714707
void gr_set_palette( const char *name, ubyte * palette, int restrict_font_to_128 )
715708
{
716709
char *p;
717-
palette_flush();
718710
strcpy_s( Gr_current_palette_name, name );
719711
p = strchr( Gr_current_palette_name, '.' );
720712
if ( p ) *p = 0;

code/graphics/opengl/gropengl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "nebula/neb.h"
3030
#include "osapi/osapi.h"
3131
#include "osapi/osregistry.h"
32-
#include "palman/palman.h"
3332
#include "render/3d.h"
3433
#include "popup/popup.h"
3534
#include "tracing/tracing.h"

code/graphics/opengl/gropengldraw.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "nebula/neb.h"
3434
#include "tracing/tracing.h"
3535
#include "osapi/osapi.h"
36-
#include "palman/palman.h"
3736
#include "render/3d.h"
3837
#include "localization/localize.h"
3938

code/jpgutils/jpgutils.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include "jpgutils/jpgutils.h"
3131
#include "cfile/cfile.h"
3232
#include "bmpman/bmpman.h"
33-
#include "palman/palman.h"
3433
#include "graphics/2d.h"
3534

3635

code/menuui/barracks.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,11 +1287,8 @@ void barracks_draw_pilot_pic()
12871287
if (Cur_pilot->callsign[0] && (Pic_number >= 0) && (Pic_number < Num_pilot_images)) {
12881288
if (Pilot_images[Pic_number] >= 0) {
12891289
// JAS: This code is hacked to allow the animation to use all 256 colors
1290-
extern int Palman_allow_any_color;
1291-
Palman_allow_any_color = 1;
12921290
gr_set_bitmap(Pilot_images[Pic_number]);
12931291
gr_bitmap(Barracks_image_coords[gr_screen.res][BARRACKS_X_COORD], Barracks_image_coords[gr_screen.res][BARRACKS_Y_COORD], GR_RESIZE_MENU);
1294-
Palman_allow_any_color = 0;
12951292

12961293
// print number of the current pic
12971294
char buf[40];
@@ -1312,11 +1309,8 @@ void barracks_draw_squad_pic()
13121309
if (Cur_pilot->callsign[0] && (Pic_squad_number >= 0) && (Pic_squad_number < Num_pilot_squad_images)) {
13131310
if (Pilot_squad_images[Pic_squad_number] >= 0) {
13141311
// JAS: This code is hacked to allow the animation to use all 256 colors
1315-
extern int Palman_allow_any_color;
1316-
Palman_allow_any_color = 1;
13171312
gr_set_bitmap(Pilot_squad_images[Pic_squad_number]);
13181313
gr_bitmap(Barracks_squad_coords[gr_screen.res][BARRACKS_X_COORD], Barracks_squad_coords[gr_screen.res][BARRACKS_Y_COORD], GR_RESIZE_MENU);
1319-
Palman_allow_any_color = 0;
13201314

13211315
// print number of current squad pic
13221316
if(Player_sel_mode != PLAYER_SELECT_MODE_SINGLE){

code/menuui/mainhallmenu.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "network/multi_voice.h"
3333
#include "network/multiui.h"
3434
#include "network/multiutil.h"
35-
#include "palman/palman.h"
3635
#include "parse/parselo.h"
3736
#include "scripting/scripting.h"
3837
#include "playerman/player.h"

code/missionui/missionscreencommon.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include "network/multimsgs.h"
4040
#include "network/multiteamselect.h"
4141
#include "network/multiutil.h"
42-
#include "palman/palman.h"
4342
#include "parse/sexp.h"
4443
#include "popup/popup.h"
4544
#include "render/3d.h"
@@ -441,9 +440,6 @@ void common_free_interface_palette()
441440
bm_release(InterfacePaletteBitmap);
442441
InterfacePaletteBitmap = -1;
443442
}
444-
445-
// restore the normal game palette
446-
palette_restore_palette();
447443
}
448444

449445
// Init timers used for flashing buttons

code/nebula/neb.cpp

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,7 @@ int neb2_skip_render(object *objp, float z_depth)
524524
if (!neb_skip_opt) {
525525
return 0;
526526
}
527-
528-
// lame rendering
529-
if (Neb2_render_mode == NEB2_RENDER_LAME) {
530-
return 0;
531-
}
532-
527+
533528
// get near and far fog values based upon object type and rendering mode
534529
neb2_get_adjusted_fog_values(&fog_near, &fog_far, objp);
535530

@@ -937,11 +932,6 @@ void neb2_render_player()
937932
neb2_regen();
938933
Neb2_regen = 0;
939934
}
940-
941-
// don't render in lame mode
942-
if ((Neb2_render_mode == NEB2_RENDER_LAME) || (Neb2_render_mode == NEB2_RENDER_NONE)) {
943-
return;
944-
}
945935

946936
memset(&p, 0, sizeof(p));
947937
memset(&ptemp, 0, sizeof(ptemp));
@@ -1294,14 +1284,6 @@ void neb2_get_pixel(int x, int y, int *r, int *g, int *b)
12941284
ubyte avg_count;
12951285
int xs, ys;
12961286

1297-
// if we're in lame rendering mode, return a constant value
1298-
if (Neb2_render_mode == NEB2_RENDER_LAME) {
1299-
*r = Neb2_background_color[0];
1300-
*g = Neb2_background_color[1];
1301-
*b = Neb2_background_color[2];
1302-
1303-
return;
1304-
}
13051287

13061288
// get the proper pixel index to be looking up
13071289
rv = gv = bv = 0;
@@ -1571,20 +1553,12 @@ DCF(neb2_mode, "Switches nebula render modes")
15711553
Neb2_render_mode = NEB2_RENDER_NONE;
15721554
break;
15731555

1574-
case NEB2_RENDER_POLY:
1575-
Neb2_render_mode = NEB2_RENDER_POLY;
1576-
break;
1577-
15781556
case NEB2_RENDER_POF:
15791557
Neb2_render_mode = NEB2_RENDER_POF;
15801558
stars_set_background_model(BACKGROUND_MODEL_FILENAME, "Eraseme3");
15811559
stars_set_background_orientation();
15821560
break;
15831561

1584-
case NEB2_RENDER_LAME:
1585-
Neb2_render_mode = NEB2_RENDER_LAME;
1586-
break;
1587-
15881562
case NEB2_RENDER_HTL:
15891563
Neb2_render_mode = NEB2_RENDER_HTL;
15901564
break;

0 commit comments

Comments
 (0)