Skip to content

Commit d6932b1

Browse files
author
dashodanger
authored
Merge pull request #695 from obsidian-level-maker/format-warning-fixes
Address compiler warnings; fix FLTK drop-down menu drawing
2 parents 1b7b5b0 + 9e7f25e commit d6932b1

File tree

8 files changed

+76
-286
lines changed

8 files changed

+76
-286
lines changed

libraries/steve/src/cfg/ItemDescription.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace steve {
77
struct ItemDescription {
8+
virtual ~ItemDescription(){};
89
std::string name;
910
bool blacklisted = false, whitelisted = false;
1011
float weight = 1.f;

modules/ctl_doom.lua

Lines changed: 0 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -324,224 +324,6 @@ OB_MODULES["doom_mon_control"] =
324324
},
325325
}
326326

327-
CTL_DOOM.ID24_MONSTERS =
328-
{
329-
id24_ghoul =
330-
{
331-
id = 3007,
332-
r = 16,
333-
h = 40,
334-
level = 1,
335-
prob = 140,
336-
health = 50,
337-
damage = 3,
338-
attack = "missile",
339-
density = 1.0,
340-
room_size = "any"
341-
},
342-
id24_banshee =
343-
{
344-
id = 3008,
345-
r = 20,
346-
h = 56,
347-
level = 1,
348-
prob = 140,
349-
health = 100,
350-
damage = 128,
351-
attack = "melee",
352-
density = 1.0,
353-
room_size = "any"
354-
},
355-
id24_mindweaver =
356-
{
357-
id = 3009,
358-
r = 64,
359-
h = 64,
360-
level = 1,
361-
prob = 140,
362-
health = 500,
363-
damage = 5.5,
364-
attack = "hitscan",
365-
density = 1.0,
366-
room_size = "any"
367-
},
368-
id24_shocktrooper =
369-
{
370-
id = 3010,
371-
r = 20,
372-
h = 56,
373-
level = 1,
374-
prob = 140,
375-
health = 100,
376-
damage = 10.7,
377-
attack = "missile",
378-
density = 1.0,
379-
room_size = "any"
380-
},
381-
id24_vassago =
382-
{
383-
id = 3011,
384-
r = 24,
385-
h = 64,
386-
level = 1,
387-
prob = 140,
388-
boss_type = "minor",
389-
boss_prob = 50,
390-
health = 1000,
391-
damage = 25,
392-
attack = "missile",
393-
density = 1.0,
394-
room_size = "any"
395-
},
396-
id24_tyrant =
397-
{
398-
id = 3012,
399-
r = 40,
400-
h = 110,
401-
level = 1,
402-
prob = 140,
403-
boss_type = "minor",
404-
boss_prob = 50,
405-
health = 1000,
406-
damage = 125,
407-
attack = "missile",
408-
density = 1.0,
409-
room_size = "any"
410-
},
411-
}
412-
413-
function CTL_DOOM.id24_monster_setup(self)
414-
415-
module_param_up(self)
416-
417-
table.merge_missing(GAME.MONSTERS, CTL_DOOM.ID24_MONSTERS)
418-
419-
for _,opt in pairs(self.options) do
420-
421-
local M = GAME.MONSTERS[string.sub(opt.name, 7)]
422-
423-
if M and PARAM[opt.name] ~= gui.gettext("Default") then
424-
M.prob = PARAM[opt.name] * 100
425-
M.density = M.prob * .006 + .1
426-
427-
-- allow Spectres to be controlled individually
428-
M.replaces = nil
429-
430-
-- loosen some of the normal restrictions
431-
M.skip_prob = nil
432-
M.crazy_prob = nil
433-
434-
if M.prob > 40 then
435-
M.level = 1
436-
M.weap_min_damage = nil
437-
end
438-
439-
if M.prob > 200 then
440-
M.boss_type = nil
441-
end
442-
end
443-
end
444-
445-
end
446-
447-
OB_MODULES["doom_mon_control_id24"] =
448-
{
449-
450-
name = "doom_mon_control_id24",
451-
452-
label = _("ID24 Monster Control"),
453-
454-
game = "doomish",
455-
where = "experimental",
456-
457-
hooks =
458-
{
459-
setup = CTL_DOOM.id24_monster_setup
460-
},
461-
462-
options =
463-
{
464-
{
465-
name = "float_id24_ghoul",
466-
label = _("Ghoul"),
467-
valuator = "slider",
468-
min = 0,
469-
max = 20,
470-
increment = .02,
471-
default = _("Default"),
472-
nan = _("Default"),
473-
tooltip = _("Control the amount of Ghouls."),
474-
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
475-
randomize_group="monsters",
476-
},
477-
{
478-
name = "float_id24_banshee",
479-
label = _("Banshee"),
480-
valuator = "slider",
481-
min = 0,
482-
max = 20,
483-
increment = .02,
484-
default = _("Default"),
485-
nan = _("Default"),
486-
tooltip = _("Control the amount of Banshees."),
487-
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
488-
randomize_group="monsters",
489-
},
490-
{
491-
name = "float_id24_mindweaver",
492-
label = _("Mindweaver"),
493-
valuator = "slider",
494-
min = 0,
495-
max = 20,
496-
increment = .02,
497-
default = _("Default"),
498-
nan = _("Default"),
499-
tooltip = _("Control the amount of Mindweavers."),
500-
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
501-
randomize_group="monsters",
502-
},
503-
{
504-
name = "float_id24_shocktrooper",
505-
label = _("Shocktrooper"),
506-
valuator = "slider",
507-
min = 0,
508-
max = 20,
509-
increment = .02,
510-
default = _("Default"),
511-
nan = _("Default"),
512-
tooltip = _("Control the amount of Shocktroopers."),
513-
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
514-
randomize_group="monsters",
515-
},
516-
{
517-
name = "float_id24_vassago",
518-
label = _("Vassago"),
519-
valuator = "slider",
520-
min = 0,
521-
max = 20,
522-
increment = .02,
523-
default = _("Default"),
524-
nan = _("Default"),
525-
tooltip = _("Control the amount of Vassago."),
526-
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
527-
randomize_group="monsters",
528-
},
529-
{
530-
name = "float_id24_tyrant",
531-
label = _("Tyrant"),
532-
valuator = "slider",
533-
min = 0,
534-
max = 20,
535-
increment = .02,
536-
default = _("Default"),
537-
nan = _("Default"),
538-
tooltip = _("Control the amount of Tyrants."),
539-
presets = _("0:0 (None at all),.02:0.02 (Scarce),.14:0.14 (Less),.5:0.5 (Plenty),1.2:1.2 (More),3:3 (Heaps),20:20 (INSANE)"),
540-
randomize_group="monsters",
541-
},
542-
},
543-
}
544-
545327
----------------------------------------------------------------
546328

547329
CTL_DOOM.WEAPON_PREF_CHOICES =

source/csg_bsp.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,7 +1796,7 @@ static void MarkGapsWithEntities()
17961796
}
17971797

17981798
// ignore map models
1799-
if (!(E->props.getStr("model")).empty())
1799+
if (!E->props.getStr("model").empty())
18001800
{
18011801
continue;
18021802
}
@@ -1919,7 +1919,7 @@ static void SpreadReachability(void)
19191919
{
19201920
gap_c *G = R->gaps[k];
19211921

1922-
if (!(G->bottom->t.face.getStr("reachable")).empty() || !(G->top->b.face.getStr("reachable")).empty())
1922+
if (!G->bottom->t.face.getStr("reachable").empty() || !G->top->b.face.getStr("reachable").empty())
19231923
{
19241924
G->reachable = true;
19251925
}

source/csg_doom.cc

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,12 @@ static void MakeSector(region_c *R)
931931
S->c_h = S->f_h;
932932
}
933933

934-
S->f_tex = f_face->getStr("tex", dummy_plane_tex);
935-
S->c_tex = c_face->getStr("tex", dummy_plane_tex);
934+
S->f_tex = f_face->getStr("tex");
935+
if (S->f_tex.empty())
936+
S->f_tex = dummy_plane_tex;
937+
S->c_tex = c_face->getStr("tex");
938+
if (S->c_tex.empty())
939+
S->c_tex = dummy_plane_tex;
936940

937941
int f_mark = f_face->getInt("mark");
938942
int c_mark = c_face->getInt("mark");
@@ -1243,7 +1247,9 @@ static sidedef_c *MakeSidedef(linedef_c *L, sector_c *sec, sector_c *back, snag_
12431247
}
12441248
else
12451249
{
1246-
SD->mid = lower->face.getStr("tex", dummy_tex);
1250+
SD->mid = lower->face.getStr("tex");
1251+
if (SD->mid.empty())
1252+
SD->mid = dummy_tex;
12471253

12481254
int ox = lower->face.getInt("u1", IVAL_NONE);
12491255
int oy = lower->face.getInt("v1", IVAL_NONE);
@@ -1281,7 +1287,7 @@ static sidedef_c *MakeSidedef(linedef_c *L, sector_c *sec, sector_c *back, snag_
12811287

12821288
if (rail)
12831289
{
1284-
std::string rail_tex = rail->face.getStr("tex", "");
1290+
std::string rail_tex = rail->face.getStr("tex");
12851291

12861292
if (!rail_tex.empty())
12871293
{
@@ -1352,8 +1358,12 @@ static sidedef_c *MakeSidedef(linedef_c *L, sector_c *sec, sector_c *back, snag_
13521358
upper = u_brush->verts[0];
13531359
}
13541360

1355-
SD->lower = lower->face.getStr("tex", dummy_tex);
1356-
SD->upper = upper->face.getStr("tex", dummy_tex);
1361+
SD->lower = lower->face.getStr("tex");
1362+
if (SD->lower.empty())
1363+
SD->lower = dummy_tex;
1364+
SD->upper = upper->face.getStr("tex");
1365+
if (SD->upper.empty())
1366+
SD->upper = dummy_tex;
13571367
}
13581368

13591369
SD->y_offset = NormalizeYOffset(SD->y_offset);
@@ -1399,7 +1409,7 @@ static csg_property_set_c *FindTrigger(snag_c *S, sector_c *front, sector_c *bac
13991409
continue;
14001410
}
14011411

1402-
if ((V->face.getStr("special")).empty())
1412+
if (V->face.getStr("special").empty())
14031413
{
14041414
continue;
14051415
}
@@ -1497,7 +1507,7 @@ static brush_vert_c *FindRail(const snag_c *S, const region_c *R, const region_c
14971507
continue;
14981508
}
14991509

1500-
if (!(V->face.getStr("tex", "")).empty())
1510+
if (!V->face.getStr("tex").empty())
15011511
{
15021512
return V; // found it!
15031513
}
@@ -2537,12 +2547,18 @@ static void SolidExtraFloor(sector_c *sec, gap_c *gap1, gap_c *gap2)
25372547
EF->top_h = OBSIDIAN_I_ROUND(gap2->bottom->t.z);
25382548
EF->bottom_h = OBSIDIAN_I_ROUND(gap1->top->b.z);
25392549

2540-
EF->top = gap2->bottom->t.face.getStr("tex", dummy_plane_tex);
2541-
EF->bottom = gap1->top->b.face.getStr("tex", dummy_plane_tex);
2550+
EF->top = gap2->bottom->t.face.getStr("tex");
2551+
if (EF->top.empty())
2552+
EF->top = dummy_plane_tex;
2553+
EF->bottom = gap1->top->b.face.getStr("tex");
2554+
if (EF->bottom.empty())
2555+
EF->bottom = dummy_plane_tex;
25422556

25432557
brush_vert_c *V = gap2->bottom->verts[0];
25442558

2545-
EF->wall = V->face.getStr("tex", dummy_wall_tex);
2559+
EF->wall = V->face.getStr("tex");
2560+
if (EF->wall.empty())
2561+
EF->wall = dummy_wall_tex;
25462562
}
25472563

25482564
static void LiquidExtraFloor(sector_c *sec, csg_brush_c *liquid)
@@ -2573,12 +2589,16 @@ static void LiquidExtraFloor(sector_c *sec, csg_brush_c *liquid)
25732589
EF->top_h = EF->bottom_h + 128; // not significant
25742590
}
25752591

2576-
EF->top = liquid->t.face.getStr("tex", dummy_plane_tex);
2592+
EF->top = liquid->t.face.getStr("tex");
2593+
if (EF->top.empty())
2594+
EF->top = dummy_plane_tex;
25772595
EF->bottom = EF->top;
25782596

25792597
brush_vert_c *V = liquid->verts[0];
25802598

2581-
EF->wall = V->face.getStr("tex", dummy_wall_tex);
2599+
EF->wall = V->face.getStr("tex");
2600+
if (EF->wall.empty())
2601+
EF->wall = dummy_wall_tex;
25822602
}
25832603

25842604
static void ExtraFloors(sector_c *S, region_c *R)
@@ -2982,7 +3002,7 @@ static void WriteLinedefs()
29823002
static void AddThing_FraggleScript(int x, int y, int z, csg_entity_c *E, int type, int angle, int options)
29833003
{
29843004
// this is set in the Lua code (raw_add_entity)
2985-
std::string fs_name = E->props.getStr("fs_name", "");
3005+
std::string fs_name = E->props.getStr("fs_name");
29863006

29873007
if (fs_name.empty())
29883008
{

0 commit comments

Comments
 (0)