Skip to content

Commit b671392

Browse files
committed
For the nolok kart, use dedicated nitro textures
1 parent 0334c6c commit b671392

3 files changed

Lines changed: 80 additions & 7 deletions

File tree

data/gfx/nitro-nolok.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0"?>
2+
<particles emitter="box" box_x="0.05" box_y="0.05" box_z="0.05">
3+
4+
<spreading angle="2" />
5+
6+
<velocity x="0.0"
7+
y="0.0"
8+
z="-0.003" />
9+
10+
<material file="nitro-particle-nolok.png" />
11+
12+
<!-- Amount of particles emitted per second -->
13+
<rate min="600"
14+
max="800" />
15+
16+
<!-- Minimal and maximal lifetime of a particle, in milliseconds. -->
17+
<lifetime min="85"
18+
max="120" />
19+
20+
<!-- Size of the particles -->
21+
<size min="0.1"
22+
max="0.25"
23+
x-increase-factor="1.2"
24+
y-increase-factor="1.2"
25+
/>
26+
27+
<color min="255 255 255"
28+
max="255 255 255" />
29+
30+
</particles>

data/gfx/nitro-smoke-nolok.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0"?>
2+
<particles emitter="box" box_x="0.35" box_y="0.2" box_z="0.2">
3+
4+
<spreading angle="30" />
5+
6+
<velocity x="0.0"
7+
y="0.0"
8+
z="-0.006" />
9+
10+
<material file="smoke_nitro_nolok.png" />
11+
12+
<!-- Amount of particles emitted per second -->
13+
<rate min="500"
14+
max="800" />
15+
16+
<!-- Minimal and maximal lifetime of a particle, in milliseconds. -->
17+
<lifetime min="100"
18+
max="150" />
19+
20+
<!-- Size of the particles -->
21+
<size min="0.20"
22+
max="0.40" />
23+
24+
<color min="255 255 255"
25+
max="255 255 255" />
26+
27+
</particles>

src/karts/kart_gfx.cpp

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,25 @@ KartGFX::KartGFX(const AbstractKart *kart, bool is_day)
5454
scene::ISceneNode *node = m_kart->getNode();
5555
// Create nitro light
5656
core::vector3df location(0.0f, 0.5f, -0.5f*length - 0.05f);
57+
58+
bool is_nolok = m_kart->getIdent() == "nolok";
59+
5760
#ifndef SERVER_ONLY
5861
if (!GUIEngine::isNoGraphics() && supportsLight())
5962
{
60-
m_nitro_light = irr_driver->addLight(location, /*force*/ 0.4f,
61-
/*radius*/ 5.0f, 0.0f, 0.4f, 1.0f,
62-
false, node);
63+
if (is_nolok)
64+
{
65+
m_nitro_light = irr_driver->addLight(location, /*force*/ 0.4f,
66+
/*radius*/ 5.0f, 1.0f, 0.0f, 0.4f,
67+
false, node);
68+
}
69+
else
70+
{
71+
m_nitro_light = irr_driver->addLight(location, /*force*/ 0.4f,
72+
/*radius*/ 5.0f, 0.0f, 0.4f, 1.0f,
73+
false, node);
74+
}
75+
6376
m_nitro_light->setVisible(false);
6477
#ifdef DEBUG
6578
m_nitro_light->setName( ("nitro emitter (" + m_kart->getIdent()
@@ -107,12 +120,15 @@ KartGFX::KartGFX(const AbstractKart *kart, bool is_day)
107120
if (!km->hasNitroEmitters())
108121
rear_nitro_right = rear_nitro_left = rear_nitro_center;
109122

123+
const char *nitro_xml = is_nolok ? "nitro-nolok.xml" : "nitro.xml";
124+
const char *nitro_smoke_xml = is_nolok ? "nitro-smoke-nolok.xml" : "nitro-smoke.xml";
125+
110126
// Create all effects. Note that they must be created
111127
// in the order of KartGFXType.
112-
addEffect(KGFX_NITRO1, "nitro.xml", rear_nitro_right, true );
113-
addEffect(KGFX_NITRO2, "nitro.xml", rear_nitro_left, true );
114-
addEffect(KGFX_NITROSMOKE1, "nitro-smoke.xml", rear_nitro_left, false);
115-
addEffect(KGFX_NITROSMOKE2, "nitro-smoke.xml", rear_nitro_right, false);
128+
addEffect(KGFX_NITRO1, nitro_xml, rear_nitro_right, true );
129+
addEffect(KGFX_NITRO2, nitro_xml, rear_nitro_left, true );
130+
addEffect(KGFX_NITROSMOKE1, nitro_smoke_xml, rear_nitro_left, false);
131+
addEffect(KGFX_NITROSMOKE2, nitro_smoke_xml, rear_nitro_right, false);
116132
addEffect(KGFX_ZIPPER, "zipper_fire.xml", rear_center, true );
117133
addEffect(KGFX_TERRAIN, "smoke.xml", Vec3(0, 0, 0), false);
118134
addEffect(KGFX_SKID1L, "skid1.xml", rear_left, true );

0 commit comments

Comments
 (0)