Skip to content

Commit

Permalink
I am born
Browse files Browse the repository at this point in the history
  • Loading branch information
TricksterGuy committed Dec 8, 2014
1 parent 56083d7 commit 0e12678
Show file tree
Hide file tree
Showing 36 changed files with 5,601 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@
*.exe
*.out
*.app

# Build directories from Cmake
build/
build-debug/
110 changes: 110 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
cmake_minimum_required (VERSION 2.6)
project (nin10kit)

set(CPACK_BINARY_DEB "ON")
set(CPACK_BINARY_RPM "ON")
set(CPACK_BINARY_TGZ "ON")
set(CPACK_BINARY_ZIP "ON")
set(CPACK_GENERATOR "DEB")
set(CPACK_NSIS_DISPLAY_NAME "nin10kit 1.0.0")
set(CPACK_NSIS_PACKAGE_NAME "nin10kit 1.0.0")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Tools for developing on Nintendo handheld systems")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "nin10kit 1.0.0")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "nin10kit 1.0.0")
set(CPACK_PACKAGE_VERSION "1.0.0")
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_SOURCE_GENERATOR "")
set(CPACK_SOURCE_TGZ "ON")

set(CPACK_DEBIAN_PACKAGE_NAME "nin10kit")
set(CPACK_DEBIAN_PACKAGE_VERSION "1.0")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Brandon Whitehead <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ".")

set(CPACK_PACKAGE_FILE_NAME "nin10kit-1.0.0")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARCH})

include(CPack)

option(ENABLE_DEBUG "Build debug version" OFF)

IF(ENABLE_DEBUG)
set(CMAKE_CXX_FLAGS "-g -Wall -std=c++11")
ELSE()
set(CMAKE_CXX_FLAGS "-O3 -s -Wall -std=c++11")
ENDIF(ENABLE_DEBUG)

# Source files definition
set(SRC_SHARED
shared/color.cpp
shared/cpercep.cpp
shared/dither.cpp
shared/exportfile.cpp
shared/fileutils.cpp
shared/headerfile.cpp
shared/histogram.cpp
shared/implementationfile.cpp
shared/Logger.cpp
shared/mediancut.cpp
shared/reductionhelper.cpp
shared/Scanner.cpp
shared/shared.cpp
)

set(SRC_NIN10KIT
cli/main.cpp
cli/3ds-exporter.cpp
cli/ds-exporter.cpp
cli/gba-exporter.cpp
cli/cmd-line-parser-helper.cpp
)

#set(SRC_NIN10KITGUI
#)

find_package(wxWidgets REQUIRED core base)
include(${wxWidgets_USE_FILE})
find_package(ImageMagick COMPONENTS Magick++ MagickWand MagickCore REQUIRED)

include_directories(${nin10kit_SOURCE_DIR}/shared)
include_directories(${ImageMagick_INCLUDE_DIRS})
link_directories(${nin10kit_SOURCE_DIR}/shared)

add_library(
shared_files
STATIC
${SRC_SHARED}
)

target_link_libraries(
shared_files
${ImageMagick_LIBRARIES}
)

add_executable(
nin10kit
${SRC_NIN10KIT}
)

target_link_libraries(
nin10kit
shared_files
${wxWidgets_LIBRARIES}
)

#add_executable(
# nin10gui
# ${SRC_NIN10GUI}
#)

#target_link_libraries(
# nin10gui
# shared_files
# ${wxWidgets_LIBRARIES}
#)

install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/nin10kit DESTINATION bin)
#install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/nin10gui DESTINATION bin)
17 changes: 17 additions & 0 deletions cli/3ds-exporter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <memory>
#include <vector>

#include "fileutils.hpp"
#include "reductionhelper.hpp"
#include "shared.hpp"

void Do3DSExport(const std::vector<Image32Bpp>& images, const std::vector<Image32Bpp>& tilesets)
{
// Add images to header and implementation files
for (const auto& image : images)
{
std::shared_ptr<Exportable> image_ptr(new Image32Bpp(image));
header.Add(image_ptr);
implementation.Add(image_ptr);
}
}
Loading

0 comments on commit 0e12678

Please sign in to comment.