diff --git a/source/games/duke/src/d_menu.cpp b/source/games/duke/src/d_menu.cpp index 4298d92d6..556ed4e4b 100644 --- a/source/games/duke/src/d_menu.cpp +++ b/source/games/duke/src/d_menu.cpp @@ -339,6 +339,22 @@ void GameInterface::DrawCenteredTextScreen(const DVector2 &origin, const char *t ::GameInterface::DrawCenteredTextScreen(origin, text, position, bg); } +static int GetPlayerColor(int color) +{ + return 0; +} + +void GameInterface::DrawPlayerSprite(const DVector2& origin, bool onteam) +{ + int color = TRANSLATION(Translation_Remap, playercolor2lookup(playercolor)); + int tile = isRR() ? 3845 + 36 - ((((8 - (totalclock >> 4))) & 7) * 5) : 1441 - ((((4 - (totalclock >> 4))) & 3) * 5); + auto tex = tileGetTexture(tile); + if (!tex) return; + double x = origin.X + 260, y = origin.Y + tex->GetDisplayHeight() * (isRR()? 0.25 : 0.5); + double scale = isRR() ? 0.375 : 0.75; + + DrawTexture(twod, tex, x, y, DTA_FullscreenScale, FSMode_ScaleToFit43, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DTA_TranslationIndex, color, DTA_ScaleX, scale, DTA_ScaleY, scale, TAG_DONE); +} void GameInterface::QuitToTitle() { diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index 9d2dfbfe8..36d7b4fd1 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -58,6 +58,7 @@ struct GameInterface : public ::GameInterface bool CheatAllowed(bool printmsg) override; void ExitFromMenu() override; ReservedSpace GetReservedScreenSpace(int viewsize) override; + void DrawPlayerSprite(const DVector2& origin, bool onteam); }; struct Dispatcher diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index cbabb00c8..6c3ed49fa 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -226,6 +226,7 @@ int enterlevel(MapRecord* mi, int gm); void donewgame(MapRecord* map, int sk); void startnewgame(MapRecord* map, int skill); void setlocalplayerinput(player_struct *pp); +int playercolor2lookup(int color); void PlayerColorChanged(void); void nonsharedkeys(void); void apply_seasick(player_struct* p, double scalefactor);