Skip to content

Commit 5557ce5

Browse files
committed
.
1 parent df3d9d4 commit 5557ce5

17 files changed

Lines changed: 256 additions & 395 deletions

src/build_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ version_table_manager::version_table_manager()
199199

200200
compiled[LIB_SDL_MIXER] = format_version(SDL_MIXER_MAJOR_VERSION, SDL_MIXER_MINOR_VERSION, SDL_MIXER_MICRO_VERSION);
201201

202-
int linked_mix_version = Mix_Version();
202+
int linked_mix_version = MIX_Version();
203203
linked[LIB_SDL_MIXER] = format_version(SDL_VERSIONNUM_MAJOR(linked_mix_version), SDL_VERSIONNUM_MINOR(linked_mix_version), SDL_VERSIONNUM_MICRO(linked_mix_version));
204204

205205
names[LIB_SDL_MIXER] = "SDL_mixer";

src/controller_base.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void controller_base::long_touch_callback(int x, int y)
8282
if(!yes_actually_dragging
8383
&& (mouse_state & SDL_BUTTON_MASK(SDL_BUTTON_LEFT)) != 0)
8484
{
85-
show_menu(get_display().get_theme().context_menu(), { x_now, y_now }, true);
85+
show_menu(get_display().get_theme().context_menu(), { static_cast<int>(x_now), static_cast<int>(y_now) }, true);
8686
}
8787
}
8888

@@ -200,7 +200,7 @@ void controller_base::handle_event(const SDL_Event& event)
200200

201201
mh_base.mouse_press(event.button, is_browsing());
202202
if(mh_base.get_show_menu()) {
203-
show_menu(get_display().get_theme().context_menu(), { event.button.x, event.button.y }, true);
203+
show_menu(get_display().get_theme().context_menu(), { static_cast<int>(event.button.x), static_cast<int>(event.button.y) }, true);
204204
}
205205
break;
206206

@@ -225,8 +225,6 @@ void controller_base::handle_event(const SDL_Event& event)
225225
gui2::execute_timer(reinterpret_cast<std::size_t>(event.user.data1));
226226
break;
227227

228-
// TODO: Support finger specifically, like pan the map. For now, SDL's "shadow mouse" events will do.
229-
case SDL_MULTIGESTURE:
230228
default:
231229
break;
232230
}

src/draw.cpp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ void draw::line(int from_x, int from_y, int to_x, int to_y, const color_t& c)
216216
SDL_RenderLine(renderer(), from_x, from_y, to_x, to_y);
217217
}
218218

219-
void draw::points(const std::vector<::point>& points)
219+
void draw::points(const std::vector<SDL_FPoint>& points)
220220
{
221221
// We cannot decay vector<point> to SDL_Point* unless the two types are the same size.
222222
static_assert(sizeof(::point) == sizeof(SDL_Point));
@@ -249,27 +249,26 @@ void draw::circle(int cx, int cy, int r, uint8_t octants)
249249
int x = r;
250250
int y = 0;
251251

252-
std::vector<::point> points;
252+
std::vector<SDL_FPoint> points;
253253

254-
if(octants & 0x08) {
255-
points.push_back({static_cast<float>(cx + y), static_cast<float>(cy + x)});
256-
}
257-
if(octants & 0x01) {
258-
points.push_back({static_cast<float>(cx + y), static_cast<float>(cy - x)});
259-
}
260-
if(octants & 0x10) {
261-
points.push_back({static_cast<float>(cx - y), static_cast<float>(cy + x)});
262-
}
263-
if(octants & 0x80) {
264-
points.push_back({static_cast<float>(cx - y), static_cast<float>(cy - x)});
265-
}
254+
if(octants & 0x08) {
255+
points.push_back({static_cast<float>(cx + y), static_cast<float>(cy + x)});
256+
}
257+
if(octants & 0x01) {
258+
points.push_back({static_cast<float>(cx + y), static_cast<float>(cy - x)});
259+
}
260+
if(octants & 0x10) {
261+
points.push_back({static_cast<float>(cx - y), static_cast<float>(cy + x)});
262+
}
263+
if(octants & 0x80) {
264+
points.push_back({static_cast<float>(cx - y), static_cast<float>(cy - x)});
265+
}
266266

267-
d += 2 * y + 1;
268-
++y;
269-
if(d > 0) {
270-
d += -2 * x + 2;
271-
--x;
272-
}
267+
d += 2 * y + 1;
268+
++y;
269+
if(d > 0) {
270+
d += -2 * x + 2;
271+
--x;
273272
}
274273

275274
draw::points(points);

src/draw.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void line(int from_x, int from_y, int to_x, int to_y);
165165
void line(int from_x, int from_y, int to_x, int to_y, const color_t& c);
166166

167167
/** Draw a set of points. */
168-
void points(const std::vector<::point>& points);
168+
void points(const std::vector<SDL_FPoint>& points);
169169

170170
/** Draw a single point. */
171171
void point(int x, int y);

src/gui/core/event/handler.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -476,23 +476,6 @@ void sdl_event_handler::handle_event(const SDL_Event& event)
476476
}
477477
break;
478478

479-
case SDL_MULTIGESTURE:
480-
{
481-
point c = video::game_canvas_size();
482-
touch_multi_gesture(
483-
point(event.mgesture.x * c.x, event.mgesture.y * c.y),
484-
event.mgesture.dTheta, event.mgesture.dDist,
485-
event.mgesture.numFingers
486-
);
487-
}
488-
break;
489-
490-
#if(defined(_X11) && !defined(__APPLE__)) || defined(_WIN32)
491-
case SDL_SYSWMEVENT:
492-
/* DO NOTHING */
493-
break;
494-
#endif
495-
496479
// Silently ignored events.
497480
case SDL_EVENT_KEY_UP:
498481
break;

src/gui/dialogs/editor/custom_tod.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ void custom_tod::color_slider_callback(COLOR_TYPE type)
274274

275275
void custom_tod::play_sound() {
276276
std::string sound_path = find_widget<text_box>("path_sound").get_value();
277-
sound::play_sound(sound_path, sound::SOUND_SOURCES);
277+
sound::play_sound(sound_path, sound_channels::type::sound_source_tag);
278278
}
279279

280280
void custom_tod::update_image(const std::string& id_stem) {

src/gui/dialogs/story_viewer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void story_viewer::display_part()
145145

146146
sound::stop_sound(VOICE_SOUND_SOURCE_ID);
147147
if(!current_part_->voice().empty()) {
148-
sound::play_sound_positioned(current_part_->voice(), VOICE_SOUND_SOURCE_ID, 0, 0);
148+
sound::play_sound_positioned(current_part_->voice(), 0, 0);
149149
}
150150

151151
config cfg;

src/hotkey/hotkey_item.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ hotkey_ptr create_hotkey(const std::string& id, const SDL_Event& event)
153153
}
154154
} break;
155155

156-
case SDL_MOUSEBUTTONUP: {
156+
case SDL_EVENT_MOUSE_BUTTON_UP: {
157157
auto mouse = std::make_shared<hotkey_mouse>();
158158
base = std::dynamic_pointer_cast<hotkey_base>(mouse);
159159
mouse->set_button(event.button.button);

src/mouse_handler_base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void mouse_handler_base::mouse_press(const SDL_MouseButtonEvent& event, const bo
187187
if (!mouse_button_event(event, SDL_BUTTON_LEFT, loc, true)) {
188188
left_click(event.x, event.y, browse);
189189
}
190-
} else if(event.sdown == false) {
190+
} else if(event.down == false) {
191191
minimap_scrolling_ = false;
192192

193193
if (!dragging_started_ && touch_timestamp != std::chrono::steady_clock::time_point{}) {

src/play_controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ void play_controller::init_side_end()
579579
if( did_tod_sound_this_turn_) {
580580
did_tod_sound_this_turn_ = true;
581581
const time_of_day& tod = gamestate().tod_manager_.get_time_of_day();
582-
sound::play_sound(tod.sounds, sound::SOUND_SOURCES);
582+
sound::play_sound(tod.sounds, sound_channels::type::sound_source_tag);
583583
}
584584
whiteboard_manager_->on_init_side();
585585
}

0 commit comments

Comments
 (0)