Skip to content

Commit 234776b

Browse files
AllyTallyInfoTeddy
authored andcommitted
Fix macOS build errors/warnings
1 parent 045ce3a commit 234776b

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

desktop_version/src/Editor.cpp

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ static void editormenurender(int tr, int tg, int tb)
246246
break;
247247
case Menu::ed_desc:
248248
{
249-
250249
const std::string input_text = key.keybuffer + ((ed.entframe < 2) ? "_" : " ");
251250

252251
if (ed.current_text_mode == TEXT_TITLE)
@@ -992,6 +991,8 @@ static void draw_cursor(void)
992991
// 2x3
993992
graphics.draw_rect(x, y, 16, 24, blue);
994993
break;
994+
default:
995+
break;
995996
}
996997
}
997998

@@ -1160,9 +1161,7 @@ static void draw_toolbox(const char* coords)
11601161
graphics.fill_rect(0, 208, 320, 240, graphics.getRGB(0, 0, 0));
11611162

11621163
// Draw all tools!
1163-
int tx = 6;
1164-
const int ty = 210;
1165-
const int tg = 32;
1164+
const int tool_gap = 32;
11661165

11671166
const int page = ed.current_tool / 10;
11681167
const int max_pages = SDL_ceil(NUM_EditorTools / 10);
@@ -1173,17 +1172,17 @@ static void draw_toolbox(const char* coords)
11731172
const int current_tool_id = i + (page * 10);
11741173

11751174
// First, draw the background
1176-
graphics.fill_rect(4 + (i * tg), 208, 20, 20, graphics.getRGB(32, 32, 32));
1175+
graphics.fill_rect(4 + (i * tool_gap), 208, 20, 20, graphics.getRGB(32, 32, 32));
11771176

11781177
// Draw the actual tool icon
1179-
ed.draw_tool((EditorTools)current_tool_id, 4 + (i * tg) + 2, 208 + 2);
1178+
ed.draw_tool((EditorTools)current_tool_id, 4 + (i * tool_gap) + 2, 208 + 2);
11801179

11811180
// Draw the tool outline...
1182-
graphics.draw_rect(4 + (i * tg), 208, 20, 20, (current_tool_id == ed.current_tool) ? graphics.getRGB(200, 200, 200) : graphics.getRGB(96, 96, 96));
1181+
graphics.draw_rect(4 + (i * tool_gap), 208, 20, 20, (current_tool_id == ed.current_tool) ? graphics.getRGB(200, 200, 200) : graphics.getRGB(96, 96, 96));
11831182

11841183
// ...and the hotkey
11851184
const int col = current_tool_id == ed.current_tool ? 255 : 164;
1186-
font::print(PR_FONT_8X8 | PR_BOR, 22 + i * tg - 4, 224 - 4, ed.tool_key_chars[current_tool_id], col, col, col);
1185+
font::print(PR_FONT_8X8 | PR_BOR, 22 + i * tool_gap - 4, 224 - 4, ed.tool_key_chars[current_tool_id], col, col, col);
11871186
}
11881187

11891188
// Draw the page number, limit is 1 digit, so the max is 9 pages
@@ -1368,6 +1367,8 @@ void editorclass::draw_tool(EditorTools tool, int x, int y)
13681367
case EditorTool_START_POINT:
13691368
graphics.draw_sprite(x, y, 184, graphics.col_crewcyan);
13701369
break;
1370+
default:
1371+
break;
13711372
}
13721373
}
13731374

@@ -1455,6 +1456,8 @@ void editorrender(void)
14551456

14561457
break;
14571458
}
1459+
default:
1460+
break;
14581461
}
14591462

14601463
break;
@@ -1547,6 +1550,8 @@ void editorrender(void)
15471550
graphics.drawmenu(tr, tg, tb, game.currentmenuname);
15481551
break;
15491552
}
1553+
default:
1554+
break;
15501555
}
15511556

15521557
draw_note();
@@ -1616,6 +1621,8 @@ void editorrenderfixed(void)
16161621
graphics.titlebg.bscroll = -2;
16171622
graphics.updatetowerbackground(graphics.titlebg);
16181623
break;
1624+
default:
1625+
break;
16191626
}
16201627

16211628
if (cl.getroomprop(ed.levx, ed.levy)->directmode == 1)
@@ -2131,7 +2138,8 @@ void editorclass::tool_place()
21312138
substate = EditorSubState_DRAW_BOX;
21322139
box_corner = BoxCorner_LAST;
21332140
box_type = BoxType_SCRIPT;
2134-
box_point = { tilex * 8, tiley * 8 };
2141+
box_point.x = tilex * 8;
2142+
box_point.y = tiley * 8;
21352143

21362144
lclickdelay = 1;
21372145
break;
@@ -2189,6 +2197,8 @@ void editorclass::tool_place()
21892197
add_entity(tilex + (levx * 40), tiley + (levy * 30), 16, 0);
21902198
lclickdelay = 1;
21912199
break;
2200+
default:
2201+
break;
21922202
}
21932203
}
21942204

@@ -2896,7 +2906,8 @@ void editorinput(void)
28962906
if (ed.box_corner == BoxCorner_FIRST)
28972907
{
28982908
ed.lclickdelay = 1;
2899-
ed.box_point = { ed.tilex * 8, ed.tiley * 8 };
2909+
ed.box_point.x = ed.tilex * 8;
2910+
ed.box_point.y = ed.tiley * 8;
29002911
ed.box_corner = BoxCorner_LAST;
29012912
}
29022913
else if (ed.box_corner == BoxCorner_LAST)
@@ -3031,6 +3042,8 @@ void editorinput(void)
30313042
input_submitted();
30323043
}
30333044
break;
3045+
default:
3046+
break;
30343047
}
30353048
break;
30363049

@@ -3134,6 +3147,8 @@ void editorinput(void)
31343147
input_submitted();
31353148
}
31363149
break;
3150+
default:
3151+
break;
31373152
}
31383153
break;
31393154

@@ -3312,6 +3327,8 @@ void editorinput(void)
33123327

33133328
break;
33143329
}
3330+
default:
3331+
break;
33153332
}
33163333
break;
33173334
}

0 commit comments

Comments
 (0)