...
 
Commits (16)
......@@ -160,7 +160,7 @@ code/build/*
code/build-2010/*
build/*
install/*
build_vc*
build_*
code/nel/tools/build_gamedata/configuration/buildsite.py
code/build_mac
code/build_linux32
......
......@@ -12,20 +12,26 @@ jobs:
sudo apt-get install gcc-8 g++-8 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 60
sudo apt-get install libmysqlclient-dev -y
sudo apt-get install bison autoconf automake -y
sudo apt-get install libpng12-dev libjpeg62-dev -y
sudo apt-get install libpng12-dev -y
sudo apt-get install libjpeg-dev -y
sudo apt-get install libgif-dev libfreetype6-dev -y
sudo apt-get install freeglut3-dev -y
sudo apt-get install liblua5.1-dev libluabind-dev libcpptest-dev -y
sudo apt-get install libogg-dev libvorbis-dev libopenal-dev -y
sudo apt-get install libgif-dev libfreetype6-dev -y
sudo apt-get install libavcodec-dev libavformat-dev libavdevice-dev libswscale-dev libpostproc-dev -y
sudo apt-get install libmysqlclient-dev -y
sudo apt-get install libxml2-dev -y
sudo apt-get install libcurl4-openssl-dev -y
sudo apt-get install libcurl4-openssl-dev libssl-dev -y
sudo apt-get install libsquish-dev -y
sudo apt-get install liblzma-dev -y
sudo apt-get install libgsf-1-dev -y
displayName: 'Dependencies'
- script: |
mkdir build
cmake --version
cd build
cmake -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=OFF ../code
cmake -DWITH_STATIC=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=ON -DWITH_LIBGSF=ON ../code
cat CMakeCache.txt
displayName: 'CMake'
- script: |
......
# - Try to find GLib2
# Once done this will define
#
# GLIB2_FOUND - system has GLib2
# GLIB2_INCLUDE_DIRS - the GLib2 include directory
# GLIB2_LIBRARIES - Link these to use GLib2
#
# HAVE_GLIB_GREGEX_H glib has gregex.h header and
# supports g_regex_match_simple
#
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
# Copyright (c) 2006 Philippe Bernery <philippe.bernery@gmail.com>
# Copyright (c) 2007 Daniel Gollub <dgollub@suse.de>
# Copyright (c) 2007 Alban Browaeys <prahal@yahoo.com>
# Copyright (c) 2008 Michael Bell <michael.bell@web.de>
# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@googlemail.com>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
IF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
# in cache already
SET(GLIB2_FOUND TRUE)
ELSE (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
INCLUDE(FindPkgConfig)
## Glib
IF ( GLIB2_FIND_REQUIRED )
SET( _pkgconfig_REQUIRED "REQUIRED" )
ELSE ( GLIB2_FIND_REQUIRED )
SET( _pkgconfig_REQUIRED "" )
ENDIF ( GLIB2_FIND_REQUIRED )
IF ( GLIB2_MIN_VERSION )
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} )
ELSE ( GLIB2_MIN_VERSION )
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 )
ENDIF ( GLIB2_MIN_VERSION )
IF ( PKG_CONFIG_FOUND )
IF ( GLIB2_FOUND )
SET ( GLIB2_CORE_FOUND TRUE )
ELSE ( GLIB2_FOUND )
SET ( GLIB2_CORE_FOUND FALSE )
ENDIF ( GLIB2_FOUND )
ENDIF ( PKG_CONFIG_FOUND )
# Look for glib2 include dir and libraries w/o pkgconfig
IF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
FIND_PATH(
_glibconfig_include_DIR
NAMES
glibconfig.h
PATHS
/opt/gnome/lib64
/opt/gnome/lib
/opt/lib/
/opt/local/lib
/sw/lib/
/usr/lib64
/usr/lib
/usr/local/include
${CMAKE_LIBRARY_PATH}
PATH_SUFFIXES
glib-2.0/include
)
FIND_PATH(
_glib2_include_DIR
NAMES
glib.h
PATHS
/opt/gnome/include
/opt/local/include
/sw/include
/usr/include
/usr/local/include
PATH_SUFFIXES
glib-2.0
)
#MESSAGE(STATUS "Glib headers: ${_glib2_include_DIR}")
FIND_LIBRARY(
_glib2_link_DIR
NAMES
glib-2.0
glib
PATHS
/opt/gnome/lib
/opt/local/lib
/sw/lib
/usr/lib
/usr/local/lib
)
IF ( _glib2_include_DIR AND _glib2_link_DIR )
SET ( _glib2_FOUND TRUE )
ENDIF ( _glib2_include_DIR AND _glib2_link_DIR )
IF ( _glib2_FOUND )
SET ( GLIB2_INCLUDE_DIRS ${_glib2_include_DIR} ${_glibconfig_include_DIR} )
SET ( GLIB2_LIBRARIES ${_glib2_link_DIR} )
SET ( GLIB2_CORE_FOUND TRUE )
ELSE ( _glib2_FOUND )
SET ( GLIB2_CORE_FOUND FALSE )
ENDIF ( _glib2_FOUND )
# Handle dependencies
# libintl
IF ( NOT LIBINTL_FOUND )
FIND_PATH(LIBINTL_INCLUDE_DIR
NAMES
libintl.h
PATHS
/opt/gnome/include
/opt/local/include
/sw/include
/usr/include
/usr/local/include
)
FIND_LIBRARY(LIBINTL_LIBRARY
NAMES
intl
PATHS
/opt/gnome/lib
/opt/local/lib
/sw/lib
/usr/local/lib
/usr/lib
)
IF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
SET (LIBINTL_FOUND TRUE)
ENDIF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
ENDIF ( NOT LIBINTL_FOUND )
# libiconv
IF ( NOT LIBICONV_FOUND )
FIND_PATH(LIBICONV_INCLUDE_DIR
NAMES
iconv.h
PATHS
/opt/gnome/include
/opt/local/include
/opt/local/include
/sw/include
/sw/include
/usr/local/include
/usr/include
PATH_SUFFIXES
glib-2.0
)
FIND_LIBRARY(LIBICONV_LIBRARY
NAMES
iconv
PATHS
/opt/gnome/lib
/opt/local/lib
/sw/lib
/usr/lib
/usr/local/lib
)
IF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
SET (LIBICONV_FOUND TRUE)
ENDIF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
ENDIF ( NOT LIBICONV_FOUND )
IF (LIBINTL_FOUND)
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBINTL_LIBRARY})
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBINTL_INCLUDE_DIR})
ENDIF (LIBINTL_FOUND)
IF (LIBICONV_FOUND)
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBICONV_LIBRARY})
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBICONV_INCLUDE_DIR})
ENDIF (LIBICONV_FOUND)
ENDIF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
##
IF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
SET (GLIB2_FOUND TRUE)
ENDIF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
IF (GLIB2_FOUND)
IF (NOT GLIB2_FIND_QUIETLY)
MESSAGE (STATUS "Found GLib2: ${GLIB2_LIBRARIES} ${GLIB2_INCLUDE_DIRS}")
ENDIF (NOT GLIB2_FIND_QUIETLY)
ELSE (GLIB2_FOUND)
IF (GLIB2_FIND_REQUIRED)
MESSAGE (SEND_ERROR "Could not find GLib2")
ENDIF (GLIB2_FIND_REQUIRED)
ENDIF (GLIB2_FOUND)
# show the GLIB2_INCLUDE_DIRS and GLIB2_LIBRARIES variables only in the advanced view
MARK_AS_ADVANCED(GLIB2_INCLUDE_DIRS GLIB2_LIBRARIES)
MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR LIBICONV_LIBRARY)
MARK_AS_ADVANCED(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARY)
ENDIF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS)
IF ( GLIB2_FOUND )
# Check if system has a newer version of glib
# which supports g_regex_match_simple
INCLUDE( CheckIncludeFiles )
SET( CMAKE_REQUIRED_INCLUDES ${GLIB2_INCLUDE_DIRS} )
CHECK_INCLUDE_FILES ( glib/gregex.h HAVE_GLIB_GREGEX_H )
# Reset CMAKE_REQUIRED_INCLUDES
SET( CMAKE_REQUIRED_INCLUDES "" )
ENDIF( GLIB2_FOUND )
# - Try to find GObject2
# Find GObject2 headers, libraries and the answer to all questions.
#
# GOBJECT2_FOUND True if GOBJECT2 got found
# GOBJECT2_INCLUDE_DIRS Location of GOBJECT2 headers
# GOBJECT2_LIBRARIES List of libraries to use GOBJECT2
#
# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@googlemail.com>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
INCLUDE( FindPkgConfig )
IF ( GOBJECT2_FIND_REQUIRED )
SET( _pkgconfig_REQUIRED "REQUIRED" )
ELSE( GOBJECT2_FIND_REQUIRED )
SET( _pkgconfig_REQUIRED "" )
ENDIF ( GOBJECT2_FIND_REQUIRED )
IF ( GOBJECT2_MIN_VERSION )
PKG_SEARCH_MODULE( GOBJECT2 ${_pkgconfig_REQUIRED} gobject-2.0>=${GOBJECT2_MIN_VERSION} )
ELSE ( GOBJECT2_MIN_VERSION )
PKG_SEARCH_MODULE( GOBJECT2 ${_pkgconfig_REQUIRED} gobject-2.0 )
ENDIF ( GOBJECT2_MIN_VERSION )
IF( NOT GOBJECT2_FOUND AND NOT PKG_CONFIG_FOUND )
FIND_PATH( GOBJECT2_INCLUDE_DIRS gobject/gobject.h PATH_SUFFIXES glib-2.0)
FIND_LIBRARY( GOBJECT2_LIBRARIES gobject-2.0 )
# Report results
IF ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )
SET( GOBJECT2_FOUND 1 )
IF ( NOT GOBJECT2_FIND_QUIETLY )
MESSAGE( STATUS "Found GOBJECT2: ${GOBJECT2_LIBRARIES}" )
ENDIF ( NOT GOBJECT2_FIND_QUIETLY )
ELSE ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )
IF ( GOBJECT2_FIND_REQUIRED )
MESSAGE( SEND_ERROR "Could NOT find GOBJECT2" )
ELSE ( GOBJECT2_FIND_REQUIRED )
IF ( NOT GOBJECT2_FIND_QUIETLY )
MESSAGE( STATUS "Could NOT find GOBJECT2" )
ENDIF ( NOT GOBJECT2_FIND_QUIETLY )
ENDIF ( GOBJECT2_FIND_REQUIRED )
ENDIF ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )
ENDIF( NOT GOBJECT2_FOUND AND NOT PKG_CONFIG_FOUND )
MARK_AS_ADVANCED( GOBJECT2_LIBRARIES GOBJECT2_INCLUDE_DIRS )
# - Try to find libGSF
#
# Once done this will define
#
# LIBGSF_FOUND - System has LibGSF
# LIBGSF_INCLUDE_DIR - The LibGSF include directory
# LIBGSF_LIBRARIES - The libraries needed to use LibGSF
# LIBGSF_DEFINITIONS - Compiler switches required for using LibGSF
# LIBGSF_GSF_EXECUTABLE - The archive utility
# LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE - The office files thumbnailer for the GNOME desktop
# LIBGSF_GSFVBADUMP_EXECUTABLE - The utility to extract Visual Basic for Applications macros
# Copyright (c) 2009, Pau Garcia i Quiles <pgquiles@elpauer.org>
# Based off FindLibXml2.cmake from CMake 2.6.4 by Alexander Neundorf <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
IF (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES)
# in cache already
SET(LIBGSF_FIND_QUIETLY TRUE)
ENDIF (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES)
IF (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_LIBGSF libgsf-1)
SET(LIBGSF_DEFINITIONS ${PC_LIBGSF_CFLAGS_OTHER})
ENDIF (NOT WIN32)
FIND_PATH(LIBGSF_INCLUDE_DIR gsf/gsf.h
HINTS
${PC_LIBGSF_INCLUDEDIR}
${PC_LIBGSF_INCLUDE_DIRS}
PATH_SUFFIXES libgsf-1
)
FIND_LIBRARY(LIBGSF_LIBRARIES NAMES gsf-1 libgsf-1
HINTS
${PC_LIBGSF_LIBDIR}
${PC_LIBGSF_LIBRARY_DIRS}
)
FIND_PROGRAM(LIBGSF_GSF_EXECUTABLE gsf)
FIND_PROGRAM(LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE gsf-office-thumbnailer)
FIND_PROGRAM(LIBGSF_GSFVBADUMP_EXECUTABLE gsf-vba-dump)
INCLUDE(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBGSF_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGSF DEFAULT_MSG LIBGSF_LIBRARIES LIBGSF_INCLUDE_DIR)
MARK_AS_ADVANCED(LIBGSF_INCLUDE_DIR LIBGSF_LIBRARIES LIBGSF_GSF_EXECUTABLE LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE LIBGSF_GSFVBADUMP_EXECUTABLE )
......@@ -299,6 +299,27 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
SEPARATE_ARGUMENTS(PCH_FLAGS)
ENDMACRO()
MACRO(GET_PDB_FILENAME _out_filename _target)
# determine output directory based on target type
GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
IF(${_targetType} STREQUAL EXECUTABLE)
SET(_targetOutput ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
ELSEIF(${_targetType} STREQUAL STATIC_LIBRARY)
SET(_targetOutput ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
ELSE()
SET(_targetOutput ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
ENDIF()
# determine target postfix
STRING(TOUPPER "${CMAKE_BUILD_TYPE}_POSTFIX" _postfix_var_name)
GET_TARGET_PROPERTY(_targetPostfix ${_target} ${_postfix_var_name})
IF(${_targetPostfix} MATCHES NOTFOUND)
SET(_targetPostfix "")
ENDIF()
SET(${_out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb")
ENDMACRO(GET_PDB_FILENAME)
MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS _includes)
IF(CMAKE_CXX_COMPILER_ARG1)
# remove leading space in compiler argument
......@@ -308,7 +329,7 @@ MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS _includes)
ENDIF()
IF(MSVC)
GET_INTERMEDIATE_PDB_FULLPATH(${_PCH_current_target} _PDB_FILE)
GET_PDB_FILENAME(_PDB_FILE ${_PCH_current_target})
SET(PCH_TEMP_CONTENT)
......
......@@ -247,6 +247,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
OPTION(WITH_INSTALL_LIBRARIES "Install development files." ON )
OPTION(WITH_ASSIMP "Use assimp exporter" OFF)
OPTION(WITH_LIBGSF "Use libgsf for max file library" OFF)
###
# GUI toolkits
......
......@@ -21,8 +21,12 @@
#undef NL_DONT_USE_EXTERNAL_CODE
#ifndef NL_DONT_USE_EXTERNAL_CODE
#include <ft2build.h>
#include FT_FREETYPE_H
// forward declarations to avoid including freetype.h in headers
typedef int FT_Error;
typedef struct FT_LibraryRec_ *FT_Library;
typedef struct FT_FaceRec_* FT_Face;
#else // NL_DONT_USE_EXTERNAL_CODE
#endif // NL_DONT_USE_EXTERNAL_CODE
......
......@@ -23,6 +23,7 @@
namespace NLMISC
{
class IStream;
// ***************************************************************************
/**
......@@ -52,6 +53,13 @@ public:
//CClassId& operator=(const CClassId &o) { Uid = o.Uid; return *this;}
operator uint64() const {return Uid;}
inline uint32 a() const { return (uint32)(Uid >> 32); }
inline uint32 b() const { return (uint32)(Uid & 0xFFFFFFFFL); }
inline void setA(uint32 a) { Uid = ((uint64)a<<32) | (Uid & 0xFFFFFFFFL); }
inline void setB(uint32 b) { Uid = (Uid & 0xFFFFFFFF00000000L) | b; }
void serial(NLMISC::IStream &s);
std::string toString() const;
};
/**
......
......@@ -461,33 +461,6 @@ CFontGenerator::CFontGenerator (const std::string &fontFileName, const std::stri
SetTextAlign (hdcDib, TA_TOP | TA_LEFT | TA_NOUPDATECP);
SetBkColor (hdcDib, RGB (0,0,0));
SetTextColor (hdcDib, RGB (255, 255, 255));
/*FT_Error error;
if (!_LibraryInit)
{
error = FT_Init_FreeType (&_Library);
if (error)
{
nlerror ("FT_Init_FreeType() failed: %s", getFT2Error(error));
}
_LibraryInit = true;
}
error = FT_New_Face (_Library, fontFileName.c_str (), 0, &_Face);
if (error)
{
nlerror ("FT_New_Face() failed with file '%s': %s", fontFileName.c_str(), getFT2Error(error));
}
if (!fontExFileName.empty())
{
error = FT_Attach_File (_Face, fontExFileName.c_str ());
if (error)
{
nlwarning ("FT_Attach_File() failed with file '%s': %s", fontExFileName.c_str(), getFT2Error(error));
}
}*/
}
CFontGenerator::~CFontGenerator ()
......@@ -499,28 +472,6 @@ CFontGenerator::~CFontGenerator ()
void CFontGenerator::getSizes (ucchar c, uint32 size, uint32 &width, uint32 &height)
{
/* FT_Error error;
error = FT_Set_Pixel_Sizes (_Face, size, size);
if (error)
{
nlerror ("FT_Set_Pixel_Sizes() failed: %s", getFT2Error(error));
}
// retrieve glyph index from character code
FT_UInt glyph_index = FT_Get_Char_Index (_Face, c);
// load glyph image into the slot (erase previous one)
error = FT_Load_Glyph (_Face, glyph_index, FT_LOAD_DEFAULT);
if (error)
{
nlerror ("FT_Load_Glyph() failed: %s", getFT2Error(error));
}
// convert 24.6 fixed point into integer
width = _Face->glyph->metrics.width >> 6;
height = _Face->glyph->metrics.height >> 6;
*/
}
HFONT hFont = NULL;
......@@ -528,57 +479,6 @@ uint32 CurrentFontSize = 0;
uint8 *CFontGenerator::getBitmap (ucchar c, uint32 size, bool embolden, bool oblique, uint32 &width, uint32 &height, uint32 &pitch, sint32 &left, sint32 &top, sint32 &advx, uint32 &glyphIndex)
{
/* FT_Error error;
error = FT_Set_Pixel_Sizes (_Face, size, size);
if (error)
{
nlerror ("FT_Set_Pixel_Sizes() failed: %s", getFT2Error(error));
}
// retrieve glyph index from character code
FT_UInt glyph_index = FT_Get_Char_Index (_Face, c);
// load glyph image into the slot (erase previous one)
error = FT_Load_Glyph (_Face, glyph_index, FT_LOAD_DEFAULT);
if (error)
{
nlerror ("FT_Load_Glyph() failed: %s", getFT2Error(error));
}
if (size == 0)
{
width = 0;
height = 0;
pitch = 0;
left = 0;
top = 0;
advx = 0;
glyphIndex = glyph_index;
return NULL;
}
// convert to an anti-aliased bitmap
error = FT_Render_Glyph (_Face->glyph, ft_render_mode_normal);
if (error)
{
nlerror ("FT_Render_Glyph() failed: %s", getFT2Error(error));
}
width = _Face->glyph->bitmap.width;
height = _Face->glyph->bitmap.rows;
pitch = _Face->glyph->bitmap.pitch;
left = _Face->glyph->bitmap_left;
top = _Face->glyph->bitmap_top;
advx = _Face->glyph->advance.x >> 6;
glyphIndex = glyph_index;
return (uint8 *) _Face->glyph->bitmap.buffer;
*/
if (size == 0)
{
width = 0;
......@@ -705,12 +605,6 @@ uint8 *CFontGenerator::getBitmap (ucchar c, uint32 size, bool embolden, bool obl
advx = point.x;
WORD ag = 0;
/*uint t = GetGlyphIndices (hdcDib, &cc, 1, &ag, 0);
if (t == GDI_ERROR)
{
nlstop;
}
*/
glyphIndex = ag;
top = -_top;
......@@ -742,27 +636,12 @@ uint8 *CFontGenerator::getBitmap (ucchar c, uint32 size, bool embolden, bool obl
void CFontGenerator::getKerning (ucchar left, ucchar right, sint32 &kernx)
{
/* if (!FT_HAS_KERNING(_Face))
{
kernx = 0;
}
else
{
FT_Vector kerning;
FT_Error error = FT_Get_Kerning (_Face, left, right, ft_kerning_default, &kerning);
if (error)
{
nlerror ("FT_Get_Kerning() failed: %s", getFT2Error(error));
}
kernx = kerning.x;
}*/
}
uint32 CFontGenerator::getCharIndex (ucchar c)
{
// return FT_Get_Char_Index (_Face, c);
return 0;
}
......
......@@ -18,7 +18,10 @@
#include "nel/misc/class_id.h"
#include <sstream>
#include <iomanip>
#include "nel/misc/stream.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
......@@ -30,6 +33,39 @@ namespace NLMISC
const CClassId CClassId::Null(0);
void CClassId::serial(NLMISC::IStream &s)
{
// s.serial(Uid);
// Backwards.
uint32 va = a();
uint32 vb = b();
s.serial(va);
s.serial(vb);
setA(va);
setB(vb);
}
std::string CClassId::toString() const
{
std::stringstream ss;
ss << "(0x";
{
std::stringstream ss1;
ss1 << std::hex << std::setfill('0');
ss1 << std::setw(8) << a();
ss << ss1.str();
}
ss << ", 0x";
{
std::stringstream ss1;
ss1 << std::hex << std::setfill('0');
ss1 << std::setw(8) << b();
ss << ss1.str();
}
ss << ")";
return ss.str();
}
}
......@@ -6,6 +6,12 @@ IF(WITH_NEL_TOOLS)
mesh_utils
mesh_export)
ENDIF()
IF(WITH_LIBGSF)
SUBDIRS(
pipeline_max
pipeline_max_dump
pipeline_max_rewrite_assets)
ENDIF()
SUBDIRS(
anim_builder
animation_set_builder
......@@ -34,6 +40,7 @@ IF(WITH_NEL_TOOLS)
ENDIF()
SUBDIRS(
build_interface
unbuild_interface
get_neighbors
textures_optimizer
textures_tool
......
FILE(GLOB SRC *.cpp *.h)
SOURCE_GROUP("" FILES ${SRC})
ADD_EXECUTABLE(build_interface ${SRC})
TARGET_LINK_LIBRARIES(build_interface nelmisc)
......
FIND_PACKAGE(LIBGSF)
IF (NOT (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES))
MESSAGE(FATAL_ERROR "LIBGSF not found!")
ENDIF (NOT (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES))
FIND_PACKAGE(GOBJECT2)
if (NOT GOBJECT2_FOUND)
MESSAGE(FATAL_ERROR "GOBJECT2 not found!")
ENDIF (NOT GOBJECT2_FOUND)
FIND_PACKAGE(GLIB2)
if (NOT GLIB2_FOUND)
MESSAGE(FATAL_ERROR "GLIB2 not found!")
ENDIF (NOT GLIB2_FOUND)
INCLUDE_DIRECTORIES(${GLIB2_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${LIBGSF_INCLUDE_DIR})
FILE(GLOB SRCS *.cpp builtin/*.cpp builtin/storage/*.cpp update1/*.cpp epoly/*.cpp)
FILE(GLOB HDRS *.h builtin/*.h builtin/storage/*.h update1/*.h epoly/*.h)
NL_TARGET_LIB(pipeline_max
${SRCS}
${HDRS}
)
TARGET_LINK_LIBRARIES(pipeline_max
${LIBGSF_LIBRARIES}
${GLIB2_LIBRARIES}
${GOBJECT2_LIBRARIES}
nelmisc
)
SET_TARGET_PROPERTIES(pipeline_max PROPERTIES LINK_INTERFACE_LIBRARIES "")
NL_DEFAULT_PROPS(pipeline_max "NeL, Tools, 3D: Pipeline Max (Library)")
NL_ADD_LIB_SUFFIX(pipeline_max)
NL_ADD_RUNTIME_FLAGS(pipeline_max)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS pipeline_max LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
/**
* \file animatable.cpp
* \brief CAnimatable
* \date 2012-08-22 08:52GMT
* \author Jan Boon (Kaetemi)
* CAnimatable
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "animatable.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
#include "storage/app_data.h"
using namespace std;
// using namespace NLMISC;
#define PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID 0x2140
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CAnimatable::CAnimatable(CScene *scene) : CSceneClass(scene), m_AppData(NULL)
{
}
CAnimatable::~CAnimatable()
{
if (!m_ChunksOwnsPointers)
{
delete m_Unknown2140;
m_Unknown2140 = NULL;
delete m_AppData;
m_AppData = NULL;
}
}
const ucstring CAnimatable::DisplayName = ucstring("Animatable");
const char *CAnimatable::InternalName = "Animatable";
const char *CAnimatable::InternalNameUnknown = "AnimatableUnknown";
const NLMISC::CClassId CAnimatable::ClassId = NLMISC::CClassId(0x3101497b, 0x24af711b); /* Not official, please correct */
const TSClassId CAnimatable::SuperClassId = 0x77a60fbd; /* Not official, please correct */
const CAnimatableClassDesc AnimatableClassDesc(&DllPluginDescBuiltin);
const CAnimatableSuperClassDesc AnimatableSuperClassDesc(&AnimatableClassDesc);
void CAnimatable::parse(uint16 version, uint filter)
{
CSceneClass::parse(version);
if (!m_ChunksOwnsPointers)
{
m_Unknown2140 = getChunk(PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID);
if (m_Unknown2140)
{
// nldebug("Found unknown 0x2140");
// TODO: Put std::cout code here
}
m_AppData = static_cast<STORAGE::CAppData *>(getChunk(PMBS_APP_DATA_CHUNK_ID));
}
}
void CAnimatable::clean()
{
CSceneClass::clean();
if (m_AppData) m_AppData->clean();
}
void CAnimatable::build(uint16 version, uint filter)
{
CSceneClass::build(version);
if (m_Unknown2140)
{
putChunk(PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID, m_Unknown2140);
}
if (m_AppData)
{
if (m_AppData->entries().size() == 0)
{
// Discard appdata if it has no entries
delete m_AppData;
m_AppData = NULL;
}
else
{
putChunk(PMBS_APP_DATA_CHUNK_ID, m_AppData);
}
}
}
void CAnimatable::disown()
{
m_Unknown2140 = NULL;
m_AppData = NULL;
CSceneClass::disown();
}
void CAnimatable::init()
{
CSceneClass::init();
}
bool CAnimatable::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CSceneClass::inherits(classId);
}
const ISceneClassDesc *CAnimatable::classDesc() const
{
return &AnimatableClassDesc;
}
void CAnimatable::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CSceneClass::toStringLocal(ostream, pad);
if (m_AppData && m_AppData->entries().size() != 0)
{
ostream << "\n" << pad << "AppData: ";
m_AppData->toString(ostream, pad + "\t");
}
}
STORAGE::CAppData *CAnimatable::appData()
{
if (m_ChunksOwnsPointers) { nlerror("Not parsed"); return NULL; }
if (!m_AppData)
{
m_AppData = new STORAGE::CAppData();
m_AppData->init();
}
return m_AppData;
}
IStorageObject *CAnimatable::createChunkById(uint16 id, bool container)
{
switch (id)
{
case PMBS_APP_DATA_CHUNK_ID:
return new STORAGE::CAppData;
}
return CSceneClass::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */
/**
* \file animatable.h
* \brief CAnimatable
* \date 2012-08-22 08:52GMT
* \author Jan Boon (Kaetemi)
* CAnimatable
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_ANIMATABLE_H
#define PIPELINE_ANIMATABLE_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "../scene.h"
#include "../scene_class.h"
#include "../super_class_desc.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
namespace STORAGE {
class CAppData;
}
/**
* \brief CAnimatable
* \date 2012-08-22 08:52GMT
* \author Jan Boon (Kaetemi)
* This scene class owns the AppData chunk
*/
class CAnimatable : public CSceneClass
{
public:
CAnimatable(CScene *scene);
virtual ~CAnimatable();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
// public
STORAGE::CAppData *appData();
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
private:
IStorageObject *m_Unknown2140;
STORAGE::CAppData *m_AppData;
}; /* class CAnimatable */
typedef CSceneClassDesc<CAnimatable> CAnimatableClassDesc;
extern const CAnimatableClassDesc AnimatableClassDesc;
typedef CSuperClassDesc<CAnimatable> CAnimatableSuperClassDesc;
extern const CAnimatableSuperClassDesc AnimatableSuperClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_ANIMATABLE_H */
/* end of file */
/**
* \file base_object.cpp
* \brief CBaseObject
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CBaseObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "base_object.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CBaseObject::CBaseObject(CScene *scene) : CReferenceTarget(scene)
{
}
CBaseObject::~CBaseObject()
{
}
const ucstring CBaseObject::DisplayName = ucstring("BaseObject");
const char *CBaseObject::InternalName = "BaseObject";
// const char *CBaseObject::InternalNameUnknown = "BaseObjectUnknown";
const NLMISC::CClassId CBaseObject::ClassId = NLMISC::CClassId(0x71c8167a, 0x5a9f57b2); /* Not official, please correct */
const TSClassId CBaseObject::SuperClassId = CReferenceTarget::SuperClassId;
const CBaseObjectClassDesc BaseObjectClassDesc(&DllPluginDescBuiltin);
// const CBaseObjectSuperClassDesc BaseObjectSuperClassDesc(&BaseObjectClassDesc);
void CBaseObject::parse(uint16 version, uint filter)
{
CReferenceTarget::parse(version);
}
void CBaseObject::clean()
{
CReferenceTarget::clean();
}
void CBaseObject::build(uint16 version, uint filter)
{
CReferenceTarget::build(version);
}
void CBaseObject::disown()
{
CReferenceTarget::disown();
}
void CBaseObject::init()
{
CReferenceTarget::init();
}
bool CBaseObject::inherits(const NLMISC::CClassId classId) const
{
if (classId == classDesc()->classId()) return true;
return CReferenceTarget::inherits(classId);
}
const ISceneClassDesc *CBaseObject::classDesc() const
{
return &BaseObjectClassDesc;
}
void CBaseObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const
{
CReferenceTarget::toStringLocal(ostream, pad);
}
IStorageObject *CBaseObject::createChunkById(uint16 id, bool container)
{
return CReferenceTarget::createChunkById(id, container);
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */
/**
* \file base_object.h
* \brief CBaseObject
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CBaseObject
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_BASE_OBJECT_H
#define PIPELINE_BASE_OBJECT_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "reference_target.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CBaseObject
* \date 2012-08-22 08:53GMT
* \author Jan Boon (Kaetemi)
* CBaseObject
*/
class CBaseObject : public CReferenceTarget
{
public:
CBaseObject(CScene *scene);
virtual ~CBaseObject();
// class desc
static const ucstring DisplayName;
static const char *InternalName;
// static const char *InternalNameUnknown;
static const NLMISC::CClassId ClassId;
static const TSClassId SuperClassId;
// inherited
virtual void parse(uint16 version, uint filter = 0);
virtual void clean();
virtual void build(uint16 version, uint filter = 0);
virtual void disown();
virtual void init();
virtual bool inherits(const NLMISC::CClassId classId) const;
virtual const ISceneClassDesc *classDesc() const;
virtual void toStringLocal(std::ostream &ostream, const std::string &pad = "", uint filter = 0) const;
protected:
// inherited
virtual IStorageObject *createChunkById(uint16 id, bool container);
}; /* class CBaseObject */
typedef CSceneClassDesc<CBaseObject> CBaseObjectClassDesc;
extern const CBaseObjectClassDesc BaseObjectClassDesc;
// typedef CSuperClassDesc<CBaseObject> CBaseObjectSuperClassDesc;
// extern const CBaseObjectSuperClassDesc BaseObjectSuperClassDesc;
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_BASE_OBJECT_H */
/* end of file */
/**
* \file bitmap_tex.cpp
* \brief CBitmapTex
* \date 2012-08-22 08:56GMT
* \author Jan Boon (Kaetemi)
* CBitmapTex
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include <nel/misc/types_nl.h>
#include "bitmap_tex.h"
// STL includes
// NeL includes
// #include <nel/misc/debug.h>
// Project includes
using namespace std;
// using namespace NLMISC;
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
CBitmapTex::CBitmapTex(CScene *scene) : CTexmap(scene)
{
}
CBitmapTex::~CBitmapTex()
{
}
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
/* end of file */
/**
* \file bitmap_tex.h
* \brief CBitmapTex
* \date 2012-08-22 08:56GMT
* \author Jan Boon (Kaetemi)
* CBitmapTex
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_BITMAP_TEX_H
#define PIPELINE_BITMAP_TEX_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
#include "texmap.h"
namespace PIPELINE {
namespace MAX {
namespace BUILTIN {
/**
* \brief CBitmapTex
* \date 2012-08-22 08:56GMT
* \author Jan Boon (Kaetemi)
* CBitmapTex
*/
class CBitmapTex : public CTexmap
{
public:
CBitmapTex(CScene *scene);
virtual ~CBitmapTex();
}; /* class CBitmapTex */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_BITMAP_TEX_H */
/* end of file */
This diff is collapsed.
/**
* \file builtin.h
* \brief CBuiltin
* \date 2012-08-22 09:42GMT
* \author Jan Boon (Kaetemi)
* CBuiltin
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with RYZOM CORE PIPELINE. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef PIPELINE_BUILTIN_H
#define PIPELINE_BUILTIN_H
#include <nel/misc/types_nl.h>
// STL includes
// NeL includes
// Project includes
namespace PIPELINE {
namespace MAX {
class CSceneClassRegistry;
namespace BUILTIN {
/**
* \brief CBuiltin
* \date 2012-08-22 09:42GMT
* \author Jan Boon (Kaetemi)
* CBuiltin
*/
class CBuiltin
{
public:
static void registerClasses(CSceneClassRegistry *registry);
private:
CBuiltin();
virtual ~CBuiltin();
}; /* class CBuiltin */
} /* namespace BUILTIN */
} /* namespace MAX */
} /* namespace PIPELINE */
#endif /* #ifndef PIPELINE_BUILTIN_H */
/* end of file */
/**
* \file editable_patch.cpp
* \brief CEditablePatch
* \date 2012-08-26 12:12GMT
* \author Jan Boon (Kaetemi)
* CEditablePatch
*/
/*
* Copyright (C) 2012 by authors
*
* This file is part of RYZOM CORE PIPELINE.
* RYZOM CORE PIPELINE is free software: you can redistribute it
* and/or modify it under the terms of the GNU Affero General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* RYZOM CORE PIPELINE is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty