Skip to content

Commit dcfbbfe

Browse files
Merge branch 'stable' into horde-limit-redo
2 parents 45f7242 + c7a80e0 commit dcfbbfe

Some content is hidden

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

71 files changed

+1182
-740
lines changed

CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
cmake_minimum_required(VERSION 3.13)
1616

17-
project(Odamex VERSION 10.4.0)
17+
project(Odamex VERSION 10.5.0)
1818

1919
include(CMakeDependentOption)
2020

@@ -54,8 +54,8 @@ cmake_dependent_option( ENABLE_PORTMIDI "Enable portmidi support" 1 BUILD_CLIENT
5454
cmake_dependent_option( USE_MINIUPNP "Build with UPnP support" 1 BUILD_SERVER 0 )
5555
cmake_dependent_option( USE_INTERNAL_MINIUPNP "Use internal MiniUPnP" 1 USE_MINIUPNP 0 )
5656

57-
set(PROJECT_COPYRIGHT "2006-2023")
58-
set(PROJECT_RC_VERSION "10,4,0,0")
57+
set(PROJECT_COPYRIGHT "2006-2024")
58+
set(PROJECT_RC_VERSION "10,5,0,0")
5959
set(PROJECT_COMPANY "The Odamex Team")
6060

6161
# Include early required commands for specific systems

README

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
===============================================================================
2-
Odamex v10.4.0 README
2+
Odamex v10.5.0 README
33
https://odamex.net
44
===============================================================================
55

Xbox/README.Xbox

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
===============================================================================
2-
Odamex v10.4.0 for Xbox
2+
Odamex v10.5.0 for Xbox
33
http://odamex.net/
44
Authored by:
55
Michael "Hyper_Eye" Wood

ag-odalaunch/res/Info.plist

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>10.4.0</string>
22+
<string>10.5.0</string>
2323
<key>CFBundleShortVersionString</key>
24-
<string>10.4.0</string>
24+
<string>10.5.0</string>
2525
<key>CFBundleGetInfoString</key>
26-
<string>Copyright © 2006-2023 The Odamex Team</string>
26+
<string>Copyright © 2006-2024 The Odamex Team</string>
2727
<key>CFBundleLongVersionString</key>
28-
<string>10.4.0</string>
28+
<string>10.5.0</string>
2929
<key>NSHumanReadableCopyright</key>
30-
<string>Copyright © 2006-2023 The Odamex Team</string>
30+
<string>Copyright © 2006-2024 The Odamex Team</string>
3131
<key>LSRequiresCarbon</key>
3232
<true/>
3333
</dict>

ci/centos.Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ WORKDIR odamex
44

55
COPY . .
66

7+
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
8+
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
9+
710
# Packages
811
RUN set -x && \
912
yum -y install epel-release gcc-c++ alsa-lib-devel libcurl-devel && \

client/src/am_map.cpp

+39-28
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ void AM_Drawer()
18321832

18331833
if (!(viewactive && am_overlay < 2) && !hu_font[0].empty())
18341834
{
1835-
char line[64 + 10];
1835+
std::string line;
18361836
const int time = level.time / TICRATE;
18371837

18381838
const int text_height = (W_ResolvePatchHandle(hu_font[0])->height() + 1) * CleanYfac;
@@ -1842,12 +1842,12 @@ void AM_Drawer()
18421842
{
18431843
if (am_showmonsters)
18441844
{
1845-
sprintf(line, TEXTCOLOR_RED "MONSTERS:" TEXTCOLOR_NORMAL " %d / %d",
1845+
StrFormat(line, TEXTCOLOR_RED "MONSTERS:" TEXTCOLOR_NORMAL " %d / %d",
18461846
level.killed_monsters,
18471847
(level.total_monsters + level.respawned_monsters));
18481848

18491849
int x, y;
1850-
const int text_width = V_StringWidth(line) * CleanXfac;
1850+
const int text_width = V_StringWidth(line.c_str()) * CleanXfac;
18511851

18521852
if (AM_OverlayAutomapVisible())
18531853
{
@@ -1860,17 +1860,17 @@ void AM_Drawer()
18601860
y = OV_Y - (text_height * 2) + 1;
18611861
}
18621862

1863-
screen->DrawTextClean(CR_GREY, x, y, line);
1863+
screen->DrawTextClean(CR_GREY, x, y, line.c_str());
18641864
}
18651865

18661866
if (am_showitems)
18671867
{
1868-
sprintf(line, TEXTCOLOR_RED "ITEMS:" TEXTCOLOR_NORMAL " %d / %d",
1868+
StrFormat(line, TEXTCOLOR_RED "ITEMS:" TEXTCOLOR_NORMAL " %d / %d",
18691869
level.found_items,
18701870
level.total_items);
18711871

18721872
int x, y;
1873-
const int text_width = V_StringWidth(line) * CleanXfac;
1873+
const int text_width = V_StringWidth(line.c_str()) * CleanXfac;
18741874

18751875
if (AM_OverlayAutomapVisible())
18761876
{
@@ -1883,15 +1883,15 @@ void AM_Drawer()
18831883
y = OV_Y - (text_height * 3) + 1;
18841884
}
18851885

1886-
screen->DrawTextClean(CR_GREY, x, y, line);
1886+
screen->DrawTextClean(CR_GREY, x, y, line.c_str());
18871887
}
18881888

18891889
if (am_showsecrets)
18901890
{
1891-
sprintf(line, TEXTCOLOR_RED "SECRETS:" TEXTCOLOR_NORMAL " %d / %d",
1891+
StrFormat(line, TEXTCOLOR_RED "SECRETS:" TEXTCOLOR_NORMAL " %d / %d",
18921892
level.found_secrets, level.total_secrets);
18931893
int x, y;
1894-
const int text_width = V_StringWidth(line) * CleanXfac;
1894+
const int text_width = V_StringWidth(line.c_str()) * CleanXfac;
18951895

18961896
if (AM_OverlayAutomapVisible())
18971897
{
@@ -1904,7 +1904,7 @@ void AM_Drawer()
19041904
y = OV_Y - (text_height * 2) + 1;
19051905
}
19061906

1907-
screen->DrawTextClean(CR_GREY, x, y, line);
1907+
screen->DrawTextClean(CR_GREY, x, y, line.c_str());
19081908
}
19091909
}
19101910

@@ -1931,11 +1931,10 @@ void AM_Drawer()
19311931
break;
19321932
}
19331933

1934-
strncpy(line, GStrings.getIndex(firstmap + level.levelnum - mapoffset),
1935-
ARRAY_LENGTH(line) - 1);
1934+
line += GStrings.getIndex(firstmap + level.levelnum - mapoffset);
19361935

19371936
int x, y;
1938-
const int text_width = V_StringWidth(line) * CleanXfac;
1937+
const int text_width = V_StringWidth(line.c_str()) * CleanXfac;
19391938

19401939
if (AM_OverlayAutomapVisible())
19411940
{
@@ -1948,23 +1947,35 @@ void AM_Drawer()
19481947
y = OV_Y - (text_height * 1) + 1;
19491948
}
19501949

1951-
screen->DrawTextClean(CR_RED, x, y, line);
1950+
screen->DrawTextClean(CR_RED, x, y, line.c_str());
19521951
}
19531952
else
19541953
{
1955-
strcpy(line, TEXTCOLOR_RED);
1956-
int pos = strlen(line);
1957-
for (int i = 0; i < 8 && level.mapname[i]; i++, pos++)
1958-
line[pos] = level.mapname[i];
1954+
if (level.clearlabel)
1955+
{
1956+
line.clear();
1957+
}
1958+
else
1959+
{
1960+
line = TEXTCOLOR_RED;
1961+
1962+
// use user provided label if one exists
1963+
if (!level.label.empty())
1964+
{
1965+
line += level.label + TEXTCOLOR_NORMAL;
1966+
}
1967+
else
1968+
{
1969+
for (int i = 0; i < 8 && level.mapname[i]; i++)
1970+
line += level.mapname[i];
1971+
line += ":" TEXTCOLOR_NORMAL " ";
1972+
}
1973+
}
19591974

1960-
line[pos++] = ':';
1961-
strcpy(line + pos, TEXTCOLOR_NORMAL);
1962-
pos = strlen(line);
1963-
line[pos++] = ' ';
1964-
strcpy(&line[pos], level.level_name);
1975+
line += level.level_name;
19651976

19661977
int x, y;
1967-
const int text_width = V_StringWidth(line) * CleanXfac;
1978+
const int text_width = V_StringWidth(line.c_str()) * CleanXfac;
19681979

19691980
if (AM_OverlayAutomapVisible())
19701981
{
@@ -1977,16 +1988,16 @@ void AM_Drawer()
19771988
y = OV_Y - (text_height * 1) + 1;
19781989
}
19791990

1980-
screen->DrawTextClean(CR_GREY, x, y, line);
1991+
screen->DrawTextClean(CR_GREY, x, y, line.c_str());
19811992
}
19821993

19831994
if (am_showtime)
19841995
{
1985-
sprintf(line, " %02d:%02d:%02d", time / 3600, (time % 3600) / 60,
1996+
StrFormat(line, " %02d:%02d:%02d", time / 3600, (time % 3600) / 60,
19861997
time % 60); // Time
19871998

19881999
int x, y;
1989-
const int text_width = V_StringWidth(line) * CleanXfac;
2000+
const int text_width = V_StringWidth(line.c_str()) * CleanXfac;
19902001

19912002
if (AM_OverlayAutomapVisible())
19922003
{
@@ -1999,7 +2010,7 @@ void AM_Drawer()
19992010
y = OV_Y - (text_height * 1) + 1;
20002011
}
20012012

2002-
screen->DrawTextClean(CR_GREY, x, y, line);
2013+
screen->DrawTextClean(CR_GREY, x, y, line.c_str());
20032014
}
20042015
}
20052016
}

client/src/cl_download.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,15 @@ static void TickCheck()
277277
::dlstate.checkfilename = StdStringToLower(::dlstate.checkfilename);
278278
}
279279

280-
// Now we have the full URL.
281-
fullurl += ::dlstate.checkfilename;
282-
283280
// Create the check transfer.
284281
::dlstate.check = new OTransferCheck(CheckDone, CheckError);
282+
283+
std::string safeFileName =
284+
::dlstate.check->escapeFileName(::dlstate.checkfilename.c_str());
285+
286+
// Now we have the full URL.
287+
fullurl += safeFileName;
288+
285289
::dlstate.check->setURL(fullurl.c_str());
286290
if (!::dlstate.check->start())
287291
{

client/src/cl_level.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,19 @@ void G_DoLoadLevel (int position)
545545
// [ML] 5/11/06 - remove sky2 remenants
546546
// [SL] 2012-03-19 - Add sky2 back
547547
sky1texture = R_TextureNumForName (level.skypic.c_str());
548+
sky1scrolldelta = level.sky1ScrollDelta;
549+
sky1columnoffset = 0;
550+
sky2columnoffset = 0;
548551
if (!level.skypic2.empty())
549-
sky2texture = R_TextureNumForName (level.skypic2.c_str());
552+
{
553+
sky2texture = R_TextureNumForName(level.skypic2.c_str());
554+
sky2scrolldelta = level.sky2ScrollDelta;
555+
}
550556
else
557+
{
551558
sky2texture = 0;
559+
sky2scrolldelta = 0;
560+
}
552561

553562
// [RH] Set up details about sky rendering
554563
R_InitSkyMap ();

client/src/m_menu.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1504,14 +1504,14 @@ static void M_PlayerSetupDrawer()
15041504
R_BuildPlayerTranslation(0, player_color);
15051505
V_ColorMap = translationref_t(translationtables, 0);
15061506

1507+
// Draw box surrounding fire and player:
1508+
screen->DrawPatchClean(W_CachePatch("M_PBOX"), 320 - 88 - 32 + 36,
1509+
PSetupDef.y + LINEHEIGHT * 3 + 22);
1510+
15071511
screen->DrawTranslatedPatchClean (W_CachePatch (sprframe->lump[0]),
15081512
320 - 52 - 32, PSetupDef.y + LINEHEIGHT*3 + 46);
15091513
}
15101514

1511-
// Draw box surrounding fire and player:
1512-
screen->DrawPatchClean (W_CachePatch ("M_PBOX"),
1513-
320 - 88 - 32 + 36, PSetupDef.y + LINEHEIGHT*3 + 22);
1514-
15151515
// Draw team setting
15161516
{
15171517
const team_t team = D_TeamByName(cl_team.cstring());

client/src/otransfer.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,17 @@ void OTransferCheck::setURL(const std::string& src)
153153
curl_easy_setopt(m_curl, CURLOPT_URL, src.c_str());
154154
}
155155

156+
/**
157+
* @brief Escapes a filename and encodes it to be a legal URI
158+
*
159+
* @param filename Complete filename
160+
*/
161+
std::string OTransferCheck::escapeFileName(const std::string& filename)
162+
{
163+
// Let's escape the filename so we have a legal url to try
164+
return curl_easy_escape(m_curl, filename.c_str(), filename.length());
165+
}
166+
156167
/**
157168
* @brief Start the checking transfer.
158169
*

client/src/otransfer.h

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class OTransferCheck
8080
}
8181

8282
void setURL(const std::string& src);
83+
std::string escapeFileName(const std::string& src);
8384
bool start();
8485
void stop();
8586
bool tick();

client/src/r_interp.cpp

+2-10
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include "m_fixed.h"
2929
#include "r_state.h"
3030
#include "p_local.h"
31-
#include "cl_demo.h"
32-
3331

3432
typedef std::pair<fixed_t, unsigned int> fixed_uint_pair;
3533

@@ -38,8 +36,6 @@ static std::vector<fixed_uint_pair> saved_ceilingheight;
3836
static std::vector<fixed_uint_pair> prev_floorheight;
3937
static std::vector<fixed_uint_pair> saved_floorheight;
4038

41-
extern NetDemo netdemo;
42-
4339
//
4440
// R_InterpolationTicker
4541
//
@@ -167,15 +163,11 @@ void R_EndInterpolation()
167163
// render_lerp_amount will be FRACUNIT.
168164
//
169165

170-
void R_InterpolateCamera(fixed_t amount)
166+
void R_InterpolateCamera(fixed_t amount, bool use_localview)
171167
{
172168
if (gamestate == GS_LEVEL && camera)
173169
{
174-
player_t& consolePlayer = consoleplayer();
175-
176-
if (!::localview.skipangle && consolePlayer.id == displayplayer().id &&
177-
consolePlayer.health > 0 && !consolePlayer.mo->reactiontime &&
178-
(!netdemo.isPlaying() && !demoplayback))
170+
if (use_localview && !::localview.skipangle)
179171
{
180172
viewangle = camera->angle + ::localview.angle;
181173
}

client/src/r_main.cpp

+11-6
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@
3939
#include "i_video.h"
4040
#include "m_vectors.h"
4141
#include "am_map.h"
42+
#include "cl_demo.h"
43+
44+
extern NetDemo netdemo;
4245

4346
void R_BeginInterpolation(fixed_t amount);
4447
void R_EndInterpolation();
45-
void R_InterpolateCamera(fixed_t amount);
48+
void R_InterpolateCamera(fixed_t amount, bool use_localview);
4649

4750
#define DISTMAP 2
4851

@@ -770,6 +773,11 @@ void R_SetupFrame (player_t *player)
770773
if (!camera || !camera->subsector)
771774
return;
772775

776+
player_t &consolePlayer = consoleplayer();
777+
const bool use_localview =
778+
(consolePlayer.id == displayplayer().id && consolePlayer.health > 0 &&
779+
!consolePlayer.mo->reactiontime && !netdemo.isPlaying() && !demoplayback);
780+
773781
if (player->cheats & CF_CHASECAM)
774782
{
775783
// [RH] Use chasecam view
@@ -783,7 +791,7 @@ void R_SetupFrame (player_t *player)
783791
{
784792
if (render_lerp_amount < FRACUNIT)
785793
{
786-
R_InterpolateCamera(render_lerp_amount);
794+
R_InterpolateCamera(render_lerp_amount, use_localview);
787795
}
788796
else
789797
{
@@ -863,10 +871,7 @@ void R_SetupFrame (player_t *player)
863871
memset (scalelightfixed, 0, MAXLIGHTSCALE*sizeof(*scalelightfixed));
864872
}
865873

866-
player_t& consolePlayer = consoleplayer();
867-
868-
if (!::localview.skippitch && consolePlayer.id == displayplayer().id &&
869-
consolePlayer.health > 0 && !consolePlayer.mo->reactiontime)
874+
if (use_localview && !::localview.skippitch)
870875
{
871876
R_ViewShear(clamp(camera->pitch - ::localview.pitch, -ANG(32), ANG(56)));
872877
}

0 commit comments

Comments
 (0)