Skip to content

Commit

Permalink
clean up more warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLubar committed Jan 28, 2020
1 parent 4901f74 commit c2dad13
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ ELSE(UNIX)
SET(PROJECT_SRCS ${PROJECT_SRCS} IsoWorld.rc)
ENDIF(UNIX)
# Tell CMake the source won't be available until build time.
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../proto/isoworldremote.pb.cc PROPERTIES GENERATED 1)

SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../proto/isoworldremote.pb.cc PROPERTIES GENERATED 1 COMPILE_FLAGS "-Wno-misleading-indentation")
SET(PROJECT_SRCS ${PROJECT_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/../proto/isoworldremote.pb.cc)


Expand Down
4 changes: 2 additions & 2 deletions TileSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void TileSet::load_ini(ALLEGRO_PATH * path)
if(al_open_directory(fs_dir))
{
ALLEGRO_FS_ENTRY * fs_tile;
while(fs_tile = al_read_directory(fs_dir))
while((fs_tile = al_read_directory(fs_dir)))
{
ALLEGRO_PATH * tile_path = al_create_path(al_get_fs_entry_name(fs_tile));
if(strcmp(al_get_path_extension(tile_path), ".ini") == 0)
Expand Down Expand Up @@ -166,4 +166,4 @@ ALLEGRO_COLOR TileSet::get_palette_color(int x, int y)
if(x >= palette.size()) x = palette.size()-1;
if(y >= palette[x].size()) y = palette[x].size()-1;
return palette[x][y];
}
}
4 changes: 1 addition & 3 deletions console.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#pragma once

#include "allegro5/allegro_native_dialog.h"
#include "console.h"
#include <stdio.h>
Expand Down Expand Up @@ -63,4 +61,4 @@ void DisplayErr(const char *format, ...)
al_show_native_message_box(al_get_current_display(), "Error", "ERROR", al_cstr(buf), NULL, ALLEGRO_MESSAGEBOX_ERROR);

al_ustr_free(buf);
}
}
16 changes: 6 additions & 10 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ s_maplist::s_maplist(void)

void saveScreenshot(){
//get filename
char filename[20] ={0};
char filename[32] ={0};
FILE* fp;
int index = 1;
//search for the first screenshot# that does not exist already
Expand Down Expand Up @@ -112,8 +112,7 @@ static AsyncDialog *spawn_async_file_dialog(ALLEGRO_DISPLAY *display,
AsyncDialog *data = (AsyncDialog*)malloc(sizeof *data);

data->file_dialog = al_create_native_file_dialog(
initial_path, "Choose files", NULL,
NULL);
initial_path, "Choose files", NULL, 0);
al_init_user_event_source(&data->event_source);
data->display = display;
data->thread = al_create_thread(async_file_dialog_thread_func, data);
Expand Down Expand Up @@ -439,7 +438,7 @@ static void show_files_list(ALLEGRO_FILECHOOSER *dialog,
const ALLEGRO_FONT *font, ALLEGRO_COLOR info)
{
int count = al_get_native_file_dialog_count(dialog);
if (count = 0) return;
if (count == 0) return;

populate_filenames(al_get_native_file_dialog_path(dialog, 0), &path_list);

Expand Down Expand Up @@ -569,9 +568,6 @@ int main(void)
int mapmove_start_x = 0;
int mapmove_start_y = 0;

ALLEGRO_COLOR unselected = al_map_rgb(255,255,255);
ALLEGRO_COLOR selected = al_map_rgb(128,128,128);

ALLEGRO_KEYBOARD_STATE keys;
while (1) {
float h = al_get_display_height(display);
Expand Down Expand Up @@ -825,9 +821,9 @@ EXIT_LOOP: ;
if(user_config.debugmode)
{
test_map.draw_debug_info();
al_draw_textf(user_config.font, cur_dialog ? inactive : active, 0, y, ALLEGRO_ALIGN_LEFT, "Drawtime: %dms", test_map.draw_time);
al_draw_textf(user_config.font, cur_dialog ? inactive : active, 0, y + al_get_font_line_height(user_config.font), ALLEGRO_ALIGN_LEFT, "Load Time: %dms", test_map.load_time);
al_draw_textf(user_config.font, cur_dialog ? inactive : active, 0, y + al_get_font_line_height(user_config.font)*2, ALLEGRO_ALIGN_LEFT, "Fetch Time: %dms", test_map.tile_fetch_time);
al_draw_textf(user_config.font, cur_dialog ? inactive : active, 0, y, ALLEGRO_ALIGN_LEFT, "Drawtime: %dms", int(test_map.draw_time));
al_draw_textf(user_config.font, cur_dialog ? inactive : active, 0, y + al_get_font_line_height(user_config.font), ALLEGRO_ALIGN_LEFT, "Load Time: %dms", int(test_map.load_time));
al_draw_textf(user_config.font, cur_dialog ? inactive : active, 0, y + al_get_font_line_height(user_config.font)*2, ALLEGRO_ALIGN_LEFT, "Fetch Time: %dms", int(test_map.tile_fetch_time));
}
gui->logic();
render_gui();
Expand Down

0 comments on commit c2dad13

Please sign in to comment.