Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Conflicts:
	CMakeLists.txt
  • Loading branch information
peterix committed Apr 24, 2013
2 parents 69f28dd + 1f55f80 commit aa3b1bd
Show file tree
Hide file tree
Showing 118 changed files with 15,150 additions and 228 deletions.
61 changes: 34 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ include_directories (${CMAKE_SOURCE_DIR})

SET(PROJECT_SRCS
UserConfig.cpp
UserInterface.cpp
ColorList.cpp
c_imagelist.cpp
c_map_section.cpp
MapSection.cpp
c_minimap.cpp
c_tile.cpp
c_tileset.cpp
TileSet.cpp
DetailedTile.cpp
common.c
console.cpp
Expand Down Expand Up @@ -95,11 +96,12 @@ IF(UNIX)
ENDIF()
# windows
ELSE(UNIX)
FILE(DOWNLOAD http://dethware.org/dfhack/download/allegrow509b.tar.gz
${CMAKE_CURRENT_SOURCE_DIR}/allegrow509b.tar.gz
EXPECTED_MD5 55b7e37ece699f02192346883ba38677)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/allegrow509b.tar.gz
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

# FILE(DOWNLOAD http://dethware.org/dfhack/download/allegrow509b.tar.gz
# ${CMAKE_CURRENT_SOURCE_DIR}/allegrow509b.tar.gz
# EXPECTED_MD5 55b7e37ece699f02192346883ba38677)
# execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/allegrow509b.tar.gz
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
ADD_DEFINITIONS("-DALLEGRO_STATICLINK")
SET(PROJECT_LIBS
kernel32.lib
Expand All @@ -112,30 +114,35 @@ ELSE(UNIX)
uuid.lib
comdlg32.lib
advapi32.lib
allegro-static.lib
allegro_primitives-static.lib
allegro_font-static.lib
allegro_color-static.lib
allegro_dialog-static.lib
allegro_image-static.lib
allegro_ttf-static.lib
freetype-static.lib
allegro-5.0.7-monolith-static-md.lib
dumb-0.9.3-static-md.lib
freetype-2.4.8-static-md.lib
libFLAC-1.2.1-static-md.lib
libogg-1.2.1-static-md.lib
libvorbis-1.3.2-static-md.lib
libvorbisfile-1.3.2-static-md.lib
openal-1.14-static-md.lib
zlib-1.2.5-static-md.lib
winmm.lib
psapi.lib
opengl32.lib
glu32.lib
gdiplus.lib
shlwapi.lib
$(NOINHERIT)
)
include_directories (
${include_directories}
${CMAKE_CURRENT_SOURCE_DIR}/allegrow/include
)
LINK_DIRECTORIES(
${LINK_DIRECTORIES}
${CMAKE_CURRENT_SOURCE_DIR}/allegrow/lib
)
agui.lib
agui_allegro5.lib
$(NOINHERIT)
)
include_directories (
${include_directories}
${CMAKE_CURRENT_SOURCE_DIR}/allegro/include
${CMAKE_CURRENT_SOURCE_DIR}/agui/include
)
LINK_DIRECTORIES(
${LINK_DIRECTORIES}
${CMAKE_CURRENT_SOURCE_DIR}/allegro/lib
${CMAKE_CURRENT_SOURCE_DIR}/agui/lib
)
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)
Expand All @@ -158,5 +165,5 @@ install(DIRECTORY resources/
# install readme
install(FILES Readme.txt DESTINATION isoworld)
install(TARGETS isoworld
LIBRARY DESTINATION isoworld
RUNTIME DESTINATION isoworld)
LIBRARY DESTINATION ${DFHACK_LIBRARY_DESTINATION}
RUNTIME DESTINATION ${DFHACK_LIBRARY_DESTINATION})
6 changes: 6 additions & 0 deletions ColorList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ void ColorList::set_color(isoworldremote::BasicMaterial mat_type, int mat_subtyp
type = INORGANIC;
else if(mat_type == "WOOD")
type = WOOD;
else if(mat_type == "PLANT")
type = PLANT;
else return;
auto iter = std::find(name_list[type].begin(), name_list[type].end(), mat_subtype);
set_color(type, (int)(iter-name_list[type].begin()), color);
Expand All @@ -50,6 +52,9 @@ void ColorList::import_names(isoworldremote::RawNames * input) {
set_material_name(INORGANIC, input->inorganic(i), i);
}

for(int i = 0; i < input->organic_size(); i++) {
set_material_name(PLANT, input->organic(i), i);
}
for(int i = 0; i < input->organic_size(); i++) {
set_material_name(WOOD, input->organic(i), i);
}
Expand All @@ -64,6 +69,7 @@ void ColorList::import_colors(const char * filename) {
ALLEGRO_CONFIG_ENTRY * config_entry;
const char * section_string = al_get_first_config_section(color_config, &config_section);
while(section_string) {
log_printf("Adding %s material colors\n", section_string);
const char * material_string = al_get_first_config_entry(color_config, section_string, &config_entry);
while(material_string) {
const char * color_string = al_get_config_value(color_config, section_string, material_string);
Expand Down
Loading

0 comments on commit aa3b1bd

Please sign in to comment.