Skip to content

Commit

Permalink
Remove sokol_color; use uint8 RGBA vs. 4 floats
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Dec 13, 2024
1 parent 0da858e commit 4592e6f
Show file tree
Hide file tree
Showing 40 changed files with 671 additions and 1,786 deletions.
1 change: 0 additions & 1 deletion libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ add_subdirectory(m4p)
add_subdirectory(miniz)
add_subdirectory(pl_mpeg)
add_subdirectory(prns)
add_subdirectory(sokol)
add_subdirectory(stb)
add_subdirectory(tracy)
add_subdirectory(xxHash)
7 changes: 0 additions & 7 deletions libraries/sokol/CMakeLists.txt

This file was deleted.

3 changes: 0 additions & 3 deletions libraries/sokol/sokol_color.cc

This file was deleted.

1,151 changes: 0 additions & 1,151 deletions libraries/sokol/sokol_color.h

This file was deleted.

2 changes: 1 addition & 1 deletion source_files/ddf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ add_library(
ddf_weapon.cc
)

target_link_libraries(edge_ddf PRIVATE almostequals edge_epi HandmadeMath sokol_color stb)
target_link_libraries(edge_ddf PRIVATE almostequals edge_epi HandmadeMath stb)

target_include_directories(edge_ddf PRIVATE ../edge)

Expand Down
3 changes: 1 addition & 2 deletions source_files/ddf/ddf_game.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <string.h>

#include "ddf_local.h"
#include "sokol_color.h"

GameDefinitionContainer gamedefs;

Expand Down Expand Up @@ -773,7 +772,7 @@ void GameDefinition::Default()
special_music_ = 0;
lighting_ = kLightingModelDoomish;
description_.clear();
default_damage_flash_ = SG_RED_RGBA32;
default_damage_flash_ = kRGBARed;
}

// --> game definition container class
Expand Down
3 changes: 1 addition & 2 deletions source_files/ddf/ddf_image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include "ddf_local.h"
#include "epi_filesystem.h"
#include "sokol_color.h"

static ImageDefinition *dynamic_image;

Expand Down Expand Up @@ -378,7 +377,7 @@ void ImageDefinition::Default()
info_.clear();

type_ = kImageDataColor;
colour_ = SG_BLACK_RGBA32;
colour_ = kRGBABlack;
format_ = kLumpImageFormatStandard;

special_ = kImageSpecialNone;
Expand Down
3 changes: 1 addition & 2 deletions source_files/ddf/ddf_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "AlmostEquals.h"
#include "ddf_local.h"
#include "epi_str_util.h"
#include "sokol_color.h"

// -KM- 1999/01/29 Improved scrolling.
// Scrolling
Expand Down Expand Up @@ -1658,7 +1657,7 @@ void LineType::Default(void)
sector_effect_ = kSectorEffectTypeNone;
portal_effect_ = kPortalEffectTypeNone;
slope_type_ = kSlopeTypeNONE;
fx_color_ = SG_BLACK_RGBA32;
fx_color_ = kRGBABlack;

// lobo 2022
effectobject_ = nullptr;
Expand Down
3 changes: 1 addition & 2 deletions source_files/ddf/ddf_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "epi_str_compare.h"
#include "epi_str_util.h"
#include "p_action.h"
#include "sokol_color.h"
#include "stb_sprintf.h"

void ReadRADScript(const std::string &_data, const std::string &source);
Expand Down Expand Up @@ -1949,7 +1948,7 @@ void DynamicLightDefinition::Default()
{
type_ = kDynamicLightTypeNone;
radius_ = 32;
colour_ = SG_WHITE_RGBA32;
colour_ = kRGBAWhite;
height_ = 0.5f;
leaky_ = false;
shape_ = "DLIGHT_EXP";
Expand Down
1 change: 0 additions & 1 deletion source_files/edge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ set (EDGE_LINK_LIBRARIES
miniz
pl_mpeg
prns
sokol_color
stb
xxhash
)
Expand Down
15 changes: 7 additions & 8 deletions source_files/edge/am_map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include "r_draw.h"
#include "r_gldefs.h"
#include "r_modes.h"
#include "sokol_color.h"

EDGE_DEFINE_CONSOLE_VARIABLE(automap_debug_bsp, "0", kConsoleVariableFlagNone)
EDGE_DEFINE_CONSOLE_VARIABLE(automap_debug_collisions, "0", kConsoleVariableFlagNone)
Expand Down Expand Up @@ -654,7 +653,7 @@ std::string Aux2StringReplaceAll(std::string str, const std::string &from, const
}

// Lobo 2023: draw some key info in the middle of a line
static void DrawKeyOnLine(AutomapLine *ml, int theKey, RGBAColor rgb = SG_WHITE_RGBA32)
static void DrawKeyOnLine(AutomapLine *ml, int theKey, RGBAColor rgb = kRGBAWhite)
{
if (hide_lines)
return;
Expand Down Expand Up @@ -887,12 +886,12 @@ static void AutomapWalkSeg(Seg *seg)
{
if (line->special->keys_ & kDoorKeyStrictlyAllKeys)
{
DrawMLineDoor(&l, SG_PURPLE_RGBA32); // purple
DrawMLineDoor(&l, kRGBAPurple); // purple
DrawKeyOnLine(&l, kDoorKeyStrictlyAllKeys);
}
else if (line->special->keys_ & kDoorKeyBlueCard || line->special->keys_ & kDoorKeyBlueSkull)
{
DrawMLineDoor(&l, SG_BLUE_RGBA32); // blue
DrawMLineDoor(&l, kRGBABlue); // blue
if (line->special->keys_ & (kDoorKeyBlueSkull | kDoorKeyBlueCard))
{
DrawKeyOnLine(&l, kDoorKeyBlueCard);
Expand All @@ -905,7 +904,7 @@ static void AutomapWalkSeg(Seg *seg)
}
else if (line->special->keys_ & kDoorKeyYellowCard || line->special->keys_ & kDoorKeyYellowSkull)
{
DrawMLineDoor(&l, SG_YELLOW_RGBA32); // yellow
DrawMLineDoor(&l, kRGBAYellow); // yellow
if (line->special->keys_ & (kDoorKeyYellowSkull | kDoorKeyYellowCard))
{
DrawKeyOnLine(&l, kDoorKeyYellowCard);
Expand All @@ -918,7 +917,7 @@ static void AutomapWalkSeg(Seg *seg)
}
else if (line->special->keys_ & kDoorKeyRedCard || line->special->keys_ & kDoorKeyRedSkull)
{
DrawMLineDoor(&l, SG_RED_RGBA32); // red
DrawMLineDoor(&l, kRGBARed); // red
if (line->special->keys_ & (kDoorKeyRedSkull | kDoorKeyRedCard))
{
DrawKeyOnLine(&l, kDoorKeyRedCard);
Expand All @@ -931,7 +930,7 @@ static void AutomapWalkSeg(Seg *seg)
}
else if (line->special->keys_ & kDoorKeyGreenCard || line->special->keys_ & kDoorKeyGreenSkull)
{
DrawMLineDoor(&l, SG_GREEN_RGBA32); // green
DrawMLineDoor(&l, kRGBAGreen); // green
if (line->special->keys_ & (kDoorKeyGreenSkull | kDoorKeyGreenCard))
{
DrawKeyOnLine(&l, kDoorKeyGreenCard);
Expand All @@ -944,7 +943,7 @@ static void AutomapWalkSeg(Seg *seg)
}
else
{
DrawMLineDoor(&l, SG_PURPLE_RGBA32); // purple
DrawMLineDoor(&l, kRGBAPurple); // purple
}
return;
}
Expand Down
Loading

0 comments on commit 4592e6f

Please sign in to comment.