Skip to content

Commit 69abdb0

Browse files
committed
Merge https://github.com/supertuxkart/stk-code into command-manager-prototype
2 parents 6933f1c + 374e756 commit 69abdb0

22 files changed

+134
-70
lines changed

CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ endif()
128128
if(UNIX AND NOT APPLE)
129129
option(USE_ASAN "Build with Leak/Address sanitizer" OFF)
130130
option(USE_TSAN "Build with Thread sanitizer" OFF)
131+
option(USE_USAN "Build with Undefined Behaviour sanitizer" OFF)
131132
option(USE_LIBBFD "Use libbfd for crash reporting and leak check" OFF)
132133
endif()
133134

@@ -139,6 +140,10 @@ if(USE_TSAN)
139140
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -fno-omit-frame-pointer")
140141
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread -fno-omit-frame-pointer")
141142
endif()
143+
if(USE_USAN)
144+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-omit-frame-pointer")
145+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-omit-frame-pointer")
146+
endif()
142147

143148
set(STK_SOURCE_DIR "src")
144149
set(STK_DATA_DIR "${PROJECT_SOURCE_DIR}/data")
@@ -811,6 +816,9 @@ if(UNIX AND NOT APPLE)
811816
if(USE_TSAN)
812817
target_link_libraries(supertuxkart "-fsanitize=thread")
813818
endif()
819+
if(USE_USAN)
820+
target_link_libraries(supertuxkart "-fsanitize=undefined")
821+
endif()
814822
endif()
815823

816824
if(BUILD_RECORDER)

data/skins/cartoon-coal/stkskin.xml

+5-6
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,24 @@ Here you can configure advanced theming rules for this skin
105105
h_inner_padding="0" v_inner_padding="-8" h_margin="0" v_margin="4" />
106106

107107
<!-- Stateless -->
108-
<!-- Provided by base theme
109108
<element type="squareFocusHaloBW" common="y" image="glass_square_focused_bw.png"
110109
left_border="6" right_border ="6" top_border="6" bottom_border="6"
111110
hborder_out_portion="1.0" />
112-
<element type="squareFocusHalo1" common="y" image="glass_square_focused_red.png"
111+
<element type="squareFocusHalo1" common="y" image="glass_square_focused_black.png"
113112
left_border="6" right_border ="6" top_border="6" bottom_border="6"
114113
hborder_out_portion="1.0" />
115114
<element type="squareFocusHalo2" common="y" image="glass_square_focused_cyan.png"
116115
left_border="6" right_border ="6" top_border="6" bottom_border="6"
117116
hborder_out_portion="1.0" />
118-
<element type="squareFocusHalo3" common="y" image="glass_square_focused_green.png"
117+
<element type="squareFocusHalo3" common="y" image="glass_square_focused_red.png"
119118
left_border="6" right_border ="6" top_border="6" bottom_border="6"
120119
hborder_out_portion="1.0" />
121-
<element type="squareFocusHalo4" common="y" image="glass_square_focused_yellow.png"
120+
<element type="squareFocusHalo4" common="y" image="glass_square_focused_green.png"
122121
left_border="6" right_border ="6" top_border="6" bottom_border="6"
123122
hborder_out_portion="1.0" />
124-
<element type="squareFocusHalo5" common="y" image="glass_square_focused_pink.png"
123+
<element type="squareFocusHalo5" common="y" image="glass_square_focused_yellow.png"
125124
left_border="6" right_border ="6" top_border="6" bottom_border="6"
126-
hborder_out_portion="1.0" />-->
125+
hborder_out_portion="1.0" />
127126

128127
<!-- Stateless. No splitting into 9 areas is done; the image is just resized. -->
129128
<element type="selectionHalo" image="bubble.png" />

data/skins/cartoon-desert/stkskin.xml

+3-4
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,10 @@ Here you can configure advanced theming rules for this skin
105105
h_inner_padding="0" v_inner_padding="-8" h_margin="0" v_margin="4" />
106106

107107
<!-- Stateless -->
108-
<!-- Provided by base theme
109108
<element type="squareFocusHaloBW" common="y" image="glass_square_focused_bw.png"
110109
left_border="6" right_border ="6" top_border="6" bottom_border="6"
111110
hborder_out_portion="1.0" />
112-
<element type="squareFocusHalo1" common="y" image="glass_square_focused_red.png"
111+
<element type="squareFocusHalo1" common="y" image="glass_square_focused_yellow.png"
113112
left_border="6" right_border ="6" top_border="6" bottom_border="6"
114113
hborder_out_portion="1.0" />
115114
<element type="squareFocusHalo2" common="y" image="glass_square_focused_cyan.png"
@@ -118,12 +117,12 @@ Here you can configure advanced theming rules for this skin
118117
<element type="squareFocusHalo3" common="y" image="glass_square_focused_green.png"
119118
left_border="6" right_border ="6" top_border="6" bottom_border="6"
120119
hborder_out_portion="1.0" />
121-
<element type="squareFocusHalo4" common="y" image="glass_square_focused_yellow.png"
120+
<element type="squareFocusHalo4" common="y" image="glass_square_focused_red.png"
122121
left_border="6" right_border ="6" top_border="6" bottom_border="6"
123122
hborder_out_portion="1.0" />
124123
<element type="squareFocusHalo5" common="y" image="glass_square_focused_pink.png"
125124
left_border="6" right_border ="6" top_border="6" bottom_border="6"
126-
hborder_out_portion="1.0" />-->
125+
hborder_out_portion="1.0" />
127126

128127
<!-- Stateless. No splitting into 9 areas is done; the image is just resized. -->
129128
<element type="selectionHalo" image="bubble.png" />

data/skins/cartoon-forest/stkskin.xml

+5-6
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,24 @@ Here you can configure advanced theming rules for this skin
105105
h_inner_padding="0" v_inner_padding="-8" h_margin="0" v_margin="4" />
106106

107107
<!-- Stateless -->
108-
<!-- Provided by base theme
109108
<element type="squareFocusHaloBW" common="y" image="glass_square_focused_bw.png"
110109
left_border="6" right_border ="6" top_border="6" bottom_border="6"
111110
hborder_out_portion="1.0" />
112-
<element type="squareFocusHalo1" common="y" image="glass_square_focused_red.png"
111+
<element type="squareFocusHalo1" common="y" image="glass_square_focused_green.png"
113112
left_border="6" right_border ="6" top_border="6" bottom_border="6"
114113
hborder_out_portion="1.0" />
115-
<element type="squareFocusHalo2" common="y" image="glass_square_focused_cyan.png"
114+
<element type="squareFocusHalo2" common="y" image="glass_square_focused_yellow.png"
116115
left_border="6" right_border ="6" top_border="6" bottom_border="6"
117116
hborder_out_portion="1.0" />
118-
<element type="squareFocusHalo3" common="y" image="glass_square_focused_green.png"
117+
<element type="squareFocusHalo3" common="y" image="glass_square_focused_red.png"
119118
left_border="6" right_border ="6" top_border="6" bottom_border="6"
120119
hborder_out_portion="1.0" />
121-
<element type="squareFocusHalo4" common="y" image="glass_square_focused_yellow.png"
120+
<element type="squareFocusHalo4" common="y" image="glass_square_focused_cyan.png"
122121
left_border="6" right_border ="6" top_border="6" bottom_border="6"
123122
hborder_out_portion="1.0" />
124123
<element type="squareFocusHalo5" common="y" image="glass_square_focused_pink.png"
125124
left_border="6" right_border ="6" top_border="6" bottom_border="6"
126-
hborder_out_portion="1.0" />-->
125+
hborder_out_portion="1.0" />
127126

128127
<!-- Stateless. No splitting into 9 areas is done; the image is just resized. -->
129128
<element type="selectionHalo" image="bubble.png" />

data/skins/cartoon-ocean/stkskin.xml

+5-6
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,24 @@ Here you can configure advanced theming rules for this skin
105105
h_inner_padding="0" v_inner_padding="-8" h_margin="0" v_margin="4" />
106106

107107
<!-- Stateless -->
108-
<!-- Provided by base theme
109108
<element type="squareFocusHaloBW" common="y" image="glass_square_focused_bw.png"
110109
left_border="6" right_border ="6" top_border="6" bottom_border="6"
111110
hborder_out_portion="1.0" />
112-
<element type="squareFocusHalo1" common="y" image="glass_square_focused_red.png"
111+
<element type="squareFocusHalo1" common="y" image="glass_square_focused_cyan.png"
113112
left_border="6" right_border ="6" top_border="6" bottom_border="6"
114113
hborder_out_portion="1.0" />
115-
<element type="squareFocusHalo2" common="y" image="glass_square_focused_cyan.png"
114+
<element type="squareFocusHalo2" common="y" image="glass_square_focused_yellow.png"
116115
left_border="6" right_border ="6" top_border="6" bottom_border="6"
117116
hborder_out_portion="1.0" />
118-
<element type="squareFocusHalo3" common="y" image="glass_square_focused_green.png"
117+
<element type="squareFocusHalo3" common="y" image="glass_square_focused_red.png"
119118
left_border="6" right_border ="6" top_border="6" bottom_border="6"
120119
hborder_out_portion="1.0" />
121-
<element type="squareFocusHalo4" common="y" image="glass_square_focused_yellow.png"
120+
<element type="squareFocusHalo4" common="y" image="glass_square_focused_green.png"
122121
left_border="6" right_border ="6" top_border="6" bottom_border="6"
123122
hborder_out_portion="1.0" />
124123
<element type="squareFocusHalo5" common="y" image="glass_square_focused_pink.png"
125124
left_border="6" right_border ="6" top_border="6" bottom_border="6"
126-
hborder_out_portion="1.0" />-->
125+
hborder_out_portion="1.0" />
127126

128127
<!-- Stateless. No splitting into 9 areas is done; the image is just resized. -->
129128
<element type="selectionHalo" image="bubble.png" />

data/skins/cartoon-ruby/stkskin.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ Here you can configure advanced theming rules for this skin
105105
h_inner_padding="0" v_inner_padding="-8" h_margin="0" v_margin="4" />
106106

107107
<!-- Stateless -->
108-
<!-- Provided by base theme
108+
109109
<element type="squareFocusHaloBW" common="y" image="glass_square_focused_bw.png"
110110
left_border="6" right_border ="6" top_border="6" bottom_border="6"
111111
hborder_out_portion="1.0" />
112-
<element type="squareFocusHalo1" common="y" image="glass_square_focused_red.png"
112+
<element type="squareFocusHalo1" common="y" image="glass_square_focused_pink.png"
113113
left_border="6" right_border ="6" top_border="6" bottom_border="6"
114114
hborder_out_portion="1.0" />
115115
<element type="squareFocusHalo2" common="y" image="glass_square_focused_cyan.png"
@@ -121,9 +121,9 @@ Here you can configure advanced theming rules for this skin
121121
<element type="squareFocusHalo4" common="y" image="glass_square_focused_yellow.png"
122122
left_border="6" right_border ="6" top_border="6" bottom_border="6"
123123
hborder_out_portion="1.0" />
124-
<element type="squareFocusHalo5" common="y" image="glass_square_focused_pink.png"
124+
<element type="squareFocusHalo5" common="y" image="glass_square_focused_red.png"
125125
left_border="6" right_border ="6" top_border="6" bottom_border="6"
126-
hborder_out_portion="1.0" />-->
126+
hborder_out_portion="1.0" />
127127

128128
<!-- Stateless. No splitting into 9 areas is done; the image is just resized. -->
129129
<element type="selectionHalo" image="bubble.png" />

lib/irrlicht/include/irrXML.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,13 @@ namespace io
371371
struct xmlChar
372372
{
373373
T c;
374-
xmlChar<T>() {}
375-
xmlChar<T>(char in) : c(static_cast<T>(in)) {}
376-
xmlChar<T>(wchar_t in) : c(static_cast<T>(in)) {}
377-
explicit xmlChar<T>(unsigned char in) : c(static_cast<T>(in)) {}
378-
explicit xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {}
379-
explicit xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {}
380-
explicit xmlChar<T>(unsigned long in) : c(static_cast<T>(in)) {}
374+
xmlChar() {}
375+
xmlChar(char in) : c(static_cast<T>(in)) {}
376+
xmlChar(wchar_t in) : c(static_cast<T>(in)) {}
377+
explicit xmlChar(unsigned char in) : c(static_cast<T>(in)) {}
378+
explicit xmlChar(unsigned short in) : c(static_cast<T>(in)) {}
379+
explicit xmlChar(unsigned int in) : c(static_cast<T>(in)) {}
380+
explicit xmlChar(unsigned long in) : c(static_cast<T>(in)) {}
381381
operator T() const { return c; }
382382
void operator=(int t) { c=static_cast<T>(t); }
383383
};

lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <stdlib.h>
1919
#include "SIrrCreationParameters.h"
2020
#include "COpenGLExtensionHandler.h"
21+
#include "COGLES2Driver.h"
2122

2223
#include "guiengine/engine.hpp"
2324
#include "ge_main.hpp"
@@ -240,6 +241,12 @@ CIrrDeviceSDL::~CIrrDeviceSDL()
240241
irr::video::COpenGLExtensionHandler* h = dynamic_cast<irr::video::COpenGLExtensionHandler*>(VideoDriver);
241242
if (h)
242243
h->clearGLExtensions();
244+
#endif
245+
#ifdef _IRR_COMPILE_WITH_OGLES2_
246+
irr::video::COGLES2Driver* es2 = dynamic_cast<irr::video::COGLES2Driver*>(VideoDriver);
247+
if (es2) {
248+
es2->cleanUp();
249+
}
243250
#endif
244251
GE::GEVulkanDriver* gevk = dynamic_cast<GE::GEVulkanDriver*>(VideoDriver);
245252
if (gevk)

lib/irrlicht/source/Irrlicht/COGLES2Driver.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ namespace video
122122
//! destructor
123123
COGLES2Driver::~COGLES2Driver()
124124
{
125-
deleteMaterialRenders();
126-
delete MaterialRenderer2D;
127-
deleteAllTextures();
125+
cleanUp();
128126

129127
if (BridgeCalls)
130128
delete BridgeCalls;

lib/irrlicht/source/Irrlicht/COGLES2Driver.h

+10
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ namespace irr
4848
#include "EDriverFeatures.h"
4949
#include "fast_atof.h"
5050
#include "COGLES2ExtensionHandler.h"
51+
#include "COGLES2Renderer2D.h"
5152

5253
class ContextManagerEGL;
5354

@@ -397,6 +398,15 @@ namespace video
397398
ContextManagerEGL* getEGLContext() {return EglContext;}
398399
#endif
399400

401+
void cleanUp() {
402+
deleteMaterialRenders();
403+
if (MaterialRenderer2D) {
404+
delete MaterialRenderer2D;
405+
MaterialRenderer2D = NULL;
406+
}
407+
deleteAllTextures();
408+
}
409+
400410
private:
401411
// Bridge calls.
402412
COGLES2CallBridge* BridgeCalls;

src/graphics/explosion.hpp

+7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ using namespace irr;
3232

3333
class Vec3;
3434
class SFXBase;
35+
36+
#ifndef SERVER_ONLY
3537
class ParticleEmitter;
38+
#endif
3639

3740
/**
3841
* \ingroup graphics
@@ -42,7 +45,11 @@ class Explosion : public HitSFX
4245
private:
4346
int m_remaining_ticks;
4447
int m_emission_frames;
48+
49+
#ifndef SERVER_ONLY
4550
ParticleEmitter* m_emitter;
51+
#endif
52+
4653
int m_explosion_ticks;
4754

4855

src/graphics/particle_emitter.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// along with this program; if not, write to the Free Software
1717
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1818

19+
#ifndef SERVER_ONLY
20+
1921
#ifndef HEADER_SMOKE_HPP
2022
#define HEADER_SMOKE_HPP
2123

@@ -100,6 +102,8 @@ class ParticleEmitter : public NoCopy
100102

101103
bool randomizeInitialY() const { return m_randomize_initial_y; }
102104
};
103-
#endif
105+
#endif // HEADER_SMOKE_HPP
106+
107+
#endif // !SERVER_ONLY
104108

105109

src/karts/controller/local_player_controller.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ LocalPlayerController::~LocalPlayerController()
107107
void LocalPlayerController::initParticleEmitter()
108108
{
109109
// Attach Particle System
110+
#ifndef SERVER_ONLY
110111
m_sky_particles_emitter = nullptr;
111112
Track *track = Track::getCurrentTrack();
112-
#ifndef SERVER_ONLY
113113
if (!GUIEngine::isNoGraphics() &&
114114
UserConfigParams::m_particles_effects > 1 &&
115115
track->getSkyParticles() != NULL)

src/karts/controller/local_player_controller.hpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@
2525
#include <memory>
2626

2727
class AbstractKart;
28-
class ParticleEmitter;
2928
class SFXBase;
3029
class SFXBuffer;
3130
class btTransform;
3231

32+
#ifndef SERVER_ONLY
33+
class ParticleEmitter;
34+
#endif
35+
3336
/** PlayerKart manages control events from the player and moves
3437
* them to the Kart
3538
*
@@ -46,7 +49,9 @@ class LocalPlayerController : public PlayerController
4649
bool m_has_started;
4750
bool m_is_above_nitro_target;
4851

52+
#ifndef SERVER_ONLY
4953
std::unique_ptr<ParticleEmitter> m_sky_particles_emitter;
54+
#endif
5055

5156
/** The index of the camera attached to the kart for this controller. The
5257
* camera object is managed in the Camera class, so no need to free it. */

src/karts/kart.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ Kart::Kart (const std::string& ident, unsigned int world_kart_id,
127127
m_initial_position = position;
128128
m_race_result = false;
129129
m_wheel_box = NULL;
130+
#ifndef SERVER_ONLY
130131
m_collision_particles = NULL;
132+
#endif
131133
m_controller = NULL;
132134
m_saved_controller = NULL;
133135
m_consumption_per_tick = stk_config->ticks2Time(1) *
@@ -283,7 +285,9 @@ Kart::~Kart()
283285
m_nitro_sound ->deleteSFX();
284286
if(m_terrain_sound) m_terrain_sound->deleteSFX();
285287
if(m_previous_terrain_sound) m_previous_terrain_sound->deleteSFX();
288+
#ifndef SERVER_ONLY
286289
if(m_collision_particles) delete m_collision_particles;
290+
#endif
287291

288292
if (m_wheel_box) m_wheel_box->remove();
289293

@@ -3283,7 +3287,10 @@ void Kart::updateGraphics(float dt)
32833287
// Update particle effects (creation rate, and emitter size
32843288
// depending on speed)
32853289
m_kart_gfx->update(dt);
3290+
3291+
#ifndef SERVER_ONLY
32863292
if (m_collision_particles) m_collision_particles->update(dt);
3293+
#endif
32873294

32883295
// --------------------------------------------------------
32893296
float nitro_frac = 0;

src/karts/kart.hpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class ItemState;
4646
class KartGFX;
4747
class KartRewinder;
4848
class MaxSpeed;
49-
class ParticleEmitter;
5049
class ParticleKind;
5150
class SFXBase;
5251
class Shadow;
@@ -56,6 +55,10 @@ class SlipStream;
5655
class Stars;
5756
class TerrainInfo;
5857

58+
#ifndef SERVER_ONLY
59+
class ParticleEmitter;
60+
#endif
61+
5962
/** The main kart class. All type of karts are of this object, but with
6063
* different controllers. The controllers are what turn a kart into a
6164
* player kart (i.e. the controller handle input), or an AI kart (the
@@ -155,8 +158,10 @@ class Kart : public AbstractKart
155158
};
156159
std::unique_ptr<btCompoundShape, btCompoundShapeDeleter> m_kart_chassis;
157160

161+
#ifndef SERVER_ONLY
158162
/** For collisions */
159163
ParticleEmitter *m_collision_particles;
164+
#endif
160165

161166
/** The main controller of this object, used for driving. This
162167
* controller is used to run the kart. It will be replaced

0 commit comments

Comments
 (0)