mirror of
https://github.com/simtactics/niotso.git
synced 2025-03-15 08:11:22 +00:00
work in progress, cleaned up the directories and split them up into folder which make more sense, Still need to compile libvitaboy and all the tools
This commit is contained in:
parent
66ce473514
commit
948bd8474c
1786 changed files with 571812 additions and 15332 deletions
177
CMakeLists.txt
177
CMakeLists.txt
|
@ -1,158 +1,57 @@
|
|||
#########################################
|
||||
#### CMake generator file for Niotso ####
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
project(Niotso)
|
||||
set(CMAKE_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_ROOT_DIR})
|
||||
|
||||
enable_language(ASM)
|
||||
set(CMAKE_C_COMPILER "gcc")
|
||||
set(CMAKE_CXX_COMPILER "gcc")
|
||||
set(CMAKE_ASM_COMPILER "gcc")
|
||||
|
||||
project(Niotso)
|
||||
include(ConfigureTarget)
|
||||
|
||||
# Installation directory
|
||||
if(WIN32)
|
||||
set(CMAKE_INSTALL_PREFIX "c:/Program Files (x86)/Maxis/The Sims Online/Niotso" CACHE FILEPATH "Installation directory")
|
||||
else()
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/bin" CACHE FILEPATH "Installation directory")
|
||||
endif()
|
||||
|
||||
# Build type
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build configurations: Release Debug Release-MakeProfile Release-UseProfile")
|
||||
else()
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build configurations: Release Debug")
|
||||
endif()
|
||||
#########################################
|
||||
#### Options
|
||||
option(BUILD_SHARED_LIBS "Build using shared libraries" ON) # default cmake
|
||||
option(NIOTSO_BUILD_EXAMPLES "Build the render demos" OFF)
|
||||
option(NIOTSO_BUILD_TOOLS "Build niotso tools" ON)
|
||||
|
||||
if(WIN32)
|
||||
set(64BIT 0)
|
||||
set(DIST_NAME "windows" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
# TODO-jip: this is terrible for release
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
set(DIST_NAME "mac" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
||||
elseif(UNIX)
|
||||
set(DIST_NAME "linux" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
||||
else()
|
||||
set(64BIT 1)
|
||||
set(DIST_NAME "unknown" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
||||
endif()
|
||||
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
# Base options
|
||||
set(CFLAGS "-Wall -Wextra -Wabi -pedantic -mmmx -msse -msse2 -msse3 -fvisibility=hidden")
|
||||
set(LDFLAGS "-static-libgcc")
|
||||
set(RCFLAGS "")
|
||||
|
||||
set(CFLAGS_LANG_C "-ansi")
|
||||
set(CFLAGS_LANG_CPP "-fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-threadsafe-statics -D__STDC_LIMIT_MACROS")
|
||||
|
||||
if(64BIT)
|
||||
set(CFLAGS "-m64 ${CFLAGS}")
|
||||
set(LDFLAGS "-m64 ${LDFLAGS}")
|
||||
set(RCFLAGS "${RCFLAGS} -F pe-x86-64")
|
||||
else()
|
||||
set(CFLAGS "-m32 ${CFLAGS}")
|
||||
set(LDFLAGS "-m32 ${LDFLAGS}")
|
||||
set(RCFLAGS "${RCFLAGS} -F pe-i386")
|
||||
endif()
|
||||
|
||||
####
|
||||
## [Profiles]
|
||||
|
||||
if(NOT (CMAKE_BUILD_TYPE MATCHES "Debug"))
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Release-MakeProfile")
|
||||
set(CFLAGS "${CFLAGS} -fprofile-generate")
|
||||
set(LDFLAGS "${LDFLAGS} -lgcov")
|
||||
elseif(CMAKE_BUILD_TYPE MATCHES "Release-UseProfile")
|
||||
set(CFLAGS "${CFLAGS} -fprofile-use")
|
||||
endif()
|
||||
|
||||
# Size
|
||||
set(CFLAGS_SIZE "${CFLAGS} -Os -g0 -fomit-frame-pointer -mfpmath=both -msahf -malign-double -mpc32 -ffast-math -fmerge-all-constants -funsafe-loop-optimizations -fsched-pressure -mstringop-strategy=rep_byte -fno-stack-protector")
|
||||
set(LDFLAGS_SIZE "${LDFLAGS} -s -fwhole-program -flto -fno-stack-protector")
|
||||
|
||||
# Speed
|
||||
set(CFLAGS_SPEED "${CFLAGS} -O3 -g0 -fomit-frame-pointer -mfpmath=both -msahf -malign-double -mpc32 -ffast-math -fmerge-all-constants -funsafe-loop-optimizations -fsched-pressure -fno-stack-protector -fmodulo-sched -fmodulo-sched-allow-regmoves -fgcse-sm -fgcse-las -fsched-spec-load -fsched-spec-load-dangerous -fsched-stalled-insns=0 -fsched-stalled-insns-dep -fsched2-use-superblocks -fipa-pta -fipa-matrix-reorg -ftree-loop-linear -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity -floop-parallelize-all -ftree-loop-distribution -ftree-loop-im -ftree-loop-ivcanon -fivopts -fvect-cost-model -fvariable-expansion-in-unroller -fbranch-target-load-optimize -maccumulate-outgoing-args -flto")
|
||||
set(LDFLAGS_SPEED "${LDFLAGS} -s -fwhole-program -flto -fno-stack-protector")
|
||||
else()
|
||||
# Debug
|
||||
set(CFLAGS_DEBUG "${CFLAGS} -O0 -g3 -fstack-protector-all -D_FORTIFY_SOURCE=2 -DDEBUG")
|
||||
set(LDFLAGS_DEBUG "${LDFLAGS} -fstack-protector-all")
|
||||
set(CFLAGS_SIZE "${CFLAGS_DEBUG}")
|
||||
set(LDFLAGS_SIZE "${LDFLAGS_DEBUG}")
|
||||
set(CFLAGS_SPEED "${CFLAGS_DEBUG}")
|
||||
set(LDFLAGS_SPEED "${LDFLAGS_DEBUG}")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CFLAGS_LANG_C} ${CFLAGS_SIZE}")
|
||||
set(CMAKE_CXX_FLAGS "${CFLAGS_LANG_CPP} ${CFLAGS_SIZE}")
|
||||
if(64BIT)
|
||||
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic")
|
||||
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fpic")
|
||||
set(CMAKE_SHARED_LIBRARY_ASM_FLAGS "-fpic")
|
||||
else()
|
||||
set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
|
||||
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
|
||||
set(CMAKE_SHARED_LIBRARY_ASM_FLAGS "")
|
||||
endif()
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-shared ${LDFLAGS} ${LDFLAGS_SIZE}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${LDFLAGS} ${LDFLAGS_SIZE}")
|
||||
set(CMAKE_RC_FLAGS "${RCFLAGS}")
|
||||
set(CMAKE_ASM_FLAGS "${CFLAGS}")
|
||||
|
||||
if(WIN32)
|
||||
set(DIST_NAME "windows" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
||||
elseif(APPLE)
|
||||
set(DIST_NAME "mac" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
||||
elseif(UNIX)
|
||||
set(DIST_NAME "linux" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
||||
else()
|
||||
set(DIST_NAME "unknown" CACHE STRING "Output folder name for the _dist folder (no start or end slash)")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/_dist/${DIST_NAME}") (-flto means our archive files should not be redistributed)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/_dist/${DIST_NAME}")
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/_dist/${DIST_NAME}")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/_dist/${DIST_NAME}")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/_dist/${DIST_NAME}")
|
||||
|
||||
if(WIN32)
|
||||
set(FREETYPE_INCLUDE ${CMAKE_SOURCE_DIR}/_deps/freetype/include ${CMAKE_SOURCE_DIR}/_deps/freetype/include/freetype/config)
|
||||
set(LIBJPEGTURBO_INCLUDE ${CMAKE_SOURCE_DIR}/_deps/libjpeg-turbo)
|
||||
set(LIBMPG123_INCLUDE ${CMAKE_SOURCE_DIR}/_deps/libmpg123)
|
||||
set(LIBPNG_INCLUDE ${CMAKE_SOURCE_DIR}/_deps/libpng)
|
||||
set(LIBPQ_INCLUDE ${CMAKE_SOURCE_DIR}/_deps/libpq ${CMAKE_SOURCE_DIR}/_deps/libpq/include ${CMAKE_SOURCE_DIR}/_deps/libpq/include/port/win32 ${CMAKE_SOURCE_DIR}/_deps/libpq/include/port)
|
||||
set(ZLIB_INCLUDE ${CMAKE_SOURCE_DIR}/_deps/zlib)
|
||||
#########################################
|
||||
#### Dependencies
|
||||
add_subdirectory(deps)
|
||||
|
||||
add_subdirectory(_deps/freetype)
|
||||
add_subdirectory(_deps/libjpeg-turbo)
|
||||
add_subdirectory(_deps/libmpg123)
|
||||
add_subdirectory(_deps/libpng)
|
||||
add_subdirectory(_deps/libpq)
|
||||
add_subdirectory(_deps/zlib)
|
||||
#########################################
|
||||
#### Project
|
||||
add_subdirectory(niotso)
|
||||
|
||||
set(FREETYPE_LINK freetype_shared)
|
||||
set(LIBJPEG_LINK jpegturbo_static)
|
||||
set(LIBMPG123_LINK libmpg123_static)
|
||||
set(LIBPNG_LINK libpng_static)
|
||||
set(LIBPQ_LINK libpq_shared)
|
||||
set(ZLIB_LINK zlib_static)
|
||||
else()
|
||||
set(FREETYPE_LINK freetype)
|
||||
set(LIBJPEG_LINK jpeg)
|
||||
set(LIBMPG123_LINK mpg123)
|
||||
set(LIBPNG_LINK png)
|
||||
set(LIBPQ_LINK pq)
|
||||
set(ZLIB_LINK z)
|
||||
if(NIOTSO_BUILD_TOOLS)
|
||||
add_subdirectory(tools)
|
||||
endif()
|
||||
|
||||
set(FILEHANDLER_INCLUDE ${CMAKE_SOURCE_DIR}/Libraries/FileHandler)
|
||||
set(LIBGLDEMO_INCLUDE ${CMAKE_SOURCE_DIR}/Libraries/libgldemo)
|
||||
set(LIBVITABOY_INCLUDE ${CMAKE_SOURCE_DIR}/Libraries/libvitaboy)
|
||||
|
||||
if(WIN32)
|
||||
set(GLDEMO_EXE WIN32)
|
||||
set(GLDEMO_LINK mingw32 libgldemo_static opengl32 glu32)
|
||||
else()
|
||||
set(GLDEMO_EXE "")
|
||||
set(GLDEMO_LINK libgldemo_static Xxf86vm rt Xext X11 GL GLU)
|
||||
if(NIOTSO_BUILD_EXAMPLES)
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
|
||||
add_subdirectory(Client)
|
||||
add_subdirectory(Libraries)
|
||||
add_subdirectory(Server)
|
||||
add_subdirectory(Tools)
|
||||
#########################################
|
||||
#### Unset Options
|
||||
unset(BUILD_SHARED_LIBS CACHE)
|
||||
unset(NIOTSO_BUILD_EXAMPLES CACHE)
|
||||
unset(NIOTSO_BUILD_TOOLS CACHE)
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Audio/Audio.hpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "windows/xaudio2.hpp"
|
||||
#ifdef PlaySound //defined by the Windows API
|
||||
#undef PlaySound
|
||||
#endif
|
||||
|
||||
struct PlayableSound_t {
|
||||
bool Playing;
|
||||
uint8_t * Data;
|
||||
IXAudio2SourceVoice* pSourceVoice;
|
||||
};
|
||||
|
||||
namespace Audio {
|
||||
int Initialize();
|
||||
PlayableSound_t * LoadSound(const Sound_t * Sound);
|
||||
bool PlaySound(PlayableSound_t * Sound);
|
||||
bool StopSound(PlayableSound_t * Sound);
|
||||
void DeleteSound(PlayableSound_t * Sound);
|
||||
void Shutdown();
|
||||
}
|
|
@ -1,125 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Audio/Startup.cpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../EngineInterface.hpp"
|
||||
|
||||
namespace Audio {
|
||||
|
||||
IXAudio2 *pXAudio2 = NULL;
|
||||
IXAudio2MasteringVoice *MasterVoice = NULL;
|
||||
|
||||
int Initialize(){
|
||||
HRESULT result;
|
||||
|
||||
result = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE | COINIT_SPEED_OVER_MEMORY);
|
||||
if(result != S_OK){
|
||||
MessageBox(Window::hWnd, "Failed to initialize Microsoft COM.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_AUDIO_INIT_COM;
|
||||
}
|
||||
|
||||
result = XAudio2Create(&pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR);
|
||||
if(result != S_OK){
|
||||
MessageBox(Window::hWnd, "Failed to initialize XAudio2. Please download the latest DirectX runtime for your system.",
|
||||
NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_AUDIO_INIT_XAUDIO2;
|
||||
}
|
||||
|
||||
result = pXAudio2->CreateMasteringVoice(&MasterVoice, 2, 44100, 0, 0, NULL);
|
||||
if(result != S_OK){
|
||||
MessageBox(Window::hWnd, "Failed to create the mastering voice for XAudio2.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_AUDIO_CREATE_VOICE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
PlayableSound_t * LoadSound(const Sound_t * Sound){
|
||||
const WAVEFORMATEX wfx = {
|
||||
WAVE_FORMAT_PCM, //wFormatTag
|
||||
Sound->Channels, //nChannels
|
||||
Sound->SamplingRate, //nSamplesPerSec
|
||||
((Sound->Channels * Sound->BitDepth) >> 3) * Sound->SamplingRate, //nAvgBytesPerSec
|
||||
((Sound->Channels * Sound->BitDepth) >> 3), //nBlockAlign
|
||||
Sound->BitDepth, //wBitsPerSample
|
||||
0 //cbSize
|
||||
};
|
||||
|
||||
const XAUDIO2_BUFFER buffer = {
|
||||
0, //Flags
|
||||
Sound->Duration * wfx.nBlockAlign, //AudioBytes
|
||||
Sound->Data, //pAudioData
|
||||
0, //PlayBegin
|
||||
0, //PlayLength
|
||||
0, //LoopBegin
|
||||
0, //LoopLength
|
||||
XAUDIO2_LOOP_INFINITE, //LoopCount
|
||||
NULL, //pContext
|
||||
};
|
||||
|
||||
IXAudio2SourceVoice* pSourceVoice;
|
||||
if(FAILED(pXAudio2->CreateSourceVoice(&pSourceVoice, &wfx)))
|
||||
return NULL;
|
||||
if(FAILED(pSourceVoice->SubmitSourceBuffer(&buffer)))
|
||||
return NULL;
|
||||
|
||||
PlayableSound_t * PlayableSound = (PlayableSound_t*) malloc(sizeof(PlayableSound_t));
|
||||
if(!PlayableSound)
|
||||
return NULL;
|
||||
PlayableSound->pSourceVoice = pSourceVoice;
|
||||
PlayableSound->Playing = false;
|
||||
PlayableSound->Data = Sound->Data;
|
||||
return PlayableSound;
|
||||
}
|
||||
|
||||
bool PlaySound(PlayableSound_t * Sound){
|
||||
if(!Sound->Playing && !FAILED(Sound->pSourceVoice->Start(0))){
|
||||
Sound->Playing = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool StopSound(PlayableSound_t * Sound){
|
||||
int success = false;
|
||||
if(Sound->Playing && !FAILED(Sound->pSourceVoice->Stop(0)))
|
||||
success = true;
|
||||
Sound->Playing = false;
|
||||
return success;
|
||||
}
|
||||
|
||||
void DeleteSound(PlayableSound_t * Sound){
|
||||
StopSound(Sound);
|
||||
//Sound->pSourceVoice->Release();
|
||||
}
|
||||
|
||||
void Shutdown(){
|
||||
if(MasterVoice){
|
||||
MasterVoice->DestroyVoice();
|
||||
MasterVoice = NULL;
|
||||
}
|
||||
if(pXAudio2){
|
||||
pXAudio2->Release();
|
||||
pXAudio2 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
#include <initguid.h>
|
||||
|
||||
DEFINE_GUID(CLSID_XAudio2, 0xe21a7345, 0xeb21, 0x468e, 0xbe, 0x50, 0x80, 0x4d, 0xb9, 0x7c, 0xf7, 0x08);
|
||||
DEFINE_GUID(CLSID_XAudio2_Debug, 0xf7a76c21, 0x53d4, 0x46bb, 0xac, 0x53, 0x8b, 0x45, 0x9c, 0xae, 0x46, 0xbd);
|
||||
DEFINE_GUID(IID_IXAudio2, 0x8bcf1f58, 0x9fe7, 0x4583, 0x8a, 0xc6, 0xe2, 0xad, 0xc4, 0x65, 0xc8, 0xbb);
|
|
@ -1,271 +0,0 @@
|
|||
/*
|
||||
xaudio2.hpp (2010-08-14)
|
||||
author: OV2
|
||||
|
||||
ruby-specific header to provide mingw-friendly xaudio2 interfaces
|
||||
*/
|
||||
|
||||
#include <unknwn.h>
|
||||
#include <mmreg.h>
|
||||
|
||||
DEFINE_GUID(CLSID_XAudio2, 0xe21a7345, 0xeb21, 0x468e, 0xbe, 0x50, 0x80, 0x4d, 0xb9, 0x7c, 0xf7, 0x08);
|
||||
DEFINE_GUID(CLSID_XAudio2_Debug, 0xf7a76c21, 0x53d4, 0x46bb, 0xac, 0x53, 0x8b, 0x45, 0x9c, 0xae, 0x46, 0xbd);
|
||||
DEFINE_GUID(IID_IXAudio2, 0x8bcf1f58, 0x9fe7, 0x4583, 0x8a, 0xc6, 0xe2, 0xad, 0xc4, 0x65, 0xc8, 0xbb);
|
||||
|
||||
DECLARE_INTERFACE(IXAudio2Voice);
|
||||
|
||||
#define XAUDIO2_COMMIT_NOW 0
|
||||
#define XAUDIO2_DEFAULT_CHANNELS 0
|
||||
#define XAUDIO2_DEFAULT_SAMPLERATE 0
|
||||
#define XAUDIO2_DEFAULT_FREQ_RATIO 4.0f
|
||||
#define XAUDIO2_DEBUG_ENGINE 0x0001
|
||||
#define XAUDIO2_LOOP_INFINITE 255
|
||||
#define XAUDIO2_VOICE_NOSRC 0x0004
|
||||
|
||||
enum XAUDIO2_DEVICE_ROLE
|
||||
{
|
||||
NotDefaultDevice = 0x0,
|
||||
DefaultConsoleDevice = 0x1,
|
||||
DefaultMultimediaDevice = 0x2,
|
||||
DefaultCommunicationsDevice = 0x4,
|
||||
DefaultGameDevice = 0x8,
|
||||
GlobalDefaultDevice = 0xf,
|
||||
InvalidDeviceRole = ~GlobalDefaultDevice
|
||||
};
|
||||
|
||||
struct XAUDIO2_DEVICE_DETAILS
|
||||
{
|
||||
WCHAR DeviceID[256];
|
||||
WCHAR DisplayName[256];
|
||||
XAUDIO2_DEVICE_ROLE Role;
|
||||
WAVEFORMATEXTENSIBLE OutputFormat;
|
||||
};
|
||||
|
||||
struct XAUDIO2_VOICE_DETAILS
|
||||
{
|
||||
UINT32 CreationFlags;
|
||||
UINT32 InputChannels;
|
||||
UINT32 InputSampleRate;
|
||||
};
|
||||
|
||||
typedef enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER
|
||||
{
|
||||
Processor1 = 0x00000001,
|
||||
Processor2 = 0x00000002,
|
||||
Processor3 = 0x00000004,
|
||||
Processor4 = 0x00000008,
|
||||
Processor5 = 0x00000010,
|
||||
Processor6 = 0x00000020,
|
||||
Processor7 = 0x00000040,
|
||||
Processor8 = 0x00000080,
|
||||
Processor9 = 0x00000100,
|
||||
Processor10 = 0x00000200,
|
||||
Processor11 = 0x00000400,
|
||||
Processor12 = 0x00000800,
|
||||
Processor13 = 0x00001000,
|
||||
Processor14 = 0x00002000,
|
||||
Processor15 = 0x00004000,
|
||||
Processor16 = 0x00008000,
|
||||
Processor17 = 0x00010000,
|
||||
Processor18 = 0x00020000,
|
||||
Processor19 = 0x00040000,
|
||||
Processor20 = 0x00080000,
|
||||
Processor21 = 0x00100000,
|
||||
Processor22 = 0x00200000,
|
||||
Processor23 = 0x00400000,
|
||||
Processor24 = 0x00800000,
|
||||
Processor25 = 0x01000000,
|
||||
Processor26 = 0x02000000,
|
||||
Processor27 = 0x04000000,
|
||||
Processor28 = 0x08000000,
|
||||
Processor29 = 0x10000000,
|
||||
Processor30 = 0x20000000,
|
||||
Processor31 = 0x40000000,
|
||||
Processor32 = 0x80000000,
|
||||
XAUDIO2_ANY_PROCESSOR = 0xffffffff,
|
||||
XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR
|
||||
} XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER, XAUDIO2_PROCESSOR;
|
||||
|
||||
struct XAUDIO2_VOICE_SENDS
|
||||
{
|
||||
UINT32 OutputCount;
|
||||
IXAudio2Voice* *pOutputVoices;
|
||||
};
|
||||
|
||||
struct XAUDIO2_EFFECT_DESCRIPTOR
|
||||
{
|
||||
IUnknown *pEffect;
|
||||
BOOL InitialState;
|
||||
UINT32 OutputChannels;
|
||||
};
|
||||
|
||||
struct XAUDIO2_EFFECT_CHAIN
|
||||
{
|
||||
UINT32 EffectCount;
|
||||
const XAUDIO2_EFFECT_DESCRIPTOR *pEffectDescriptors;
|
||||
};
|
||||
|
||||
enum XAUDIO2_FILTER_TYPE
|
||||
{
|
||||
LowPassFilter,
|
||||
BandPassFilter,
|
||||
HighPassFilter
|
||||
};
|
||||
|
||||
struct XAUDIO2_FILTER_PARAMETERS
|
||||
{
|
||||
XAUDIO2_FILTER_TYPE Type;
|
||||
float Frequency;
|
||||
float OneOverQ;
|
||||
};
|
||||
|
||||
struct XAUDIO2_BUFFER
|
||||
{
|
||||
UINT32 Flags;
|
||||
UINT32 AudioBytes;
|
||||
const BYTE *pAudioData;
|
||||
UINT32 PlayBegin;
|
||||
UINT32 PlayLength;
|
||||
UINT32 LoopBegin;
|
||||
UINT32 LoopLength;
|
||||
UINT32 LoopCount;
|
||||
void *pContext;
|
||||
};
|
||||
|
||||
struct XAUDIO2_BUFFER_WMA
|
||||
{
|
||||
const UINT32 *pDecodedPacketCumulativeBytes;
|
||||
UINT32 PacketCount;
|
||||
};
|
||||
|
||||
struct XAUDIO2_VOICE_STATE
|
||||
{
|
||||
void *pCurrentBufferContext;
|
||||
UINT32 BuffersQueued;
|
||||
UINT64 SamplesPlayed;
|
||||
};
|
||||
|
||||
struct XAUDIO2_PERFORMANCE_DATA
|
||||
{
|
||||
UINT64 AudioCyclesSinceLastQuery;
|
||||
UINT64 TotalCyclesSinceLastQuery;
|
||||
UINT32 MinimumCyclesPerQuantum;
|
||||
UINT32 MaximumCyclesPerQuantum;
|
||||
UINT32 MemoryUsageInBytes;
|
||||
UINT32 CurrentLatencyInSamples;
|
||||
UINT32 GlitchesSinceEngineStarted;
|
||||
UINT32 ActiveSourceVoiceCount;
|
||||
UINT32 TotalSourceVoiceCount;
|
||||
UINT32 ActiveSubmixVoiceCount;
|
||||
UINT32 TotalSubmixVoiceCount;
|
||||
UINT32 ActiveXmaSourceVoices;
|
||||
UINT32 ActiveXmaStreams;
|
||||
};
|
||||
|
||||
struct XAUDIO2_DEBUG_CONFIGURATION
|
||||
{
|
||||
UINT32 TraceMask;
|
||||
UINT32 BreakMask;
|
||||
BOOL LogThreadID;
|
||||
BOOL LogFileline;
|
||||
BOOL LogFunctionName;
|
||||
BOOL LogTiming;
|
||||
};
|
||||
|
||||
DECLARE_INTERFACE(IXAudio2EngineCallback)
|
||||
{
|
||||
STDMETHOD_(void, OnProcessingPassStart) (void);
|
||||
STDMETHOD_(void, OnProcessingPassEnd) (void);
|
||||
STDMETHOD_(void, OnCriticalError) (HRESULT Error);
|
||||
};
|
||||
|
||||
DECLARE_INTERFACE(IXAudio2VoiceCallback)
|
||||
{
|
||||
STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32 BytesRequired);
|
||||
STDMETHOD_(void, OnVoiceProcessingPassEnd) (void);
|
||||
STDMETHOD_(void, OnStreamEnd) (void);
|
||||
STDMETHOD_(void, OnBufferStart) (void *pBufferContext);
|
||||
STDMETHOD_(void, OnBufferEnd) (void *pBufferContext);
|
||||
STDMETHOD_(void, OnLoopEnd) (void *pBufferContext);
|
||||
STDMETHOD_(void, OnVoiceError) (void *pBufferContext, HRESULT Error);
|
||||
};
|
||||
|
||||
DECLARE_INTERFACE(IXAudio2Voice)
|
||||
{
|
||||
STDMETHOD_(void, GetVoiceDetails) (XAUDIO2_VOICE_DETAILS *pVoiceDetails);
|
||||
STDMETHOD(SetOutputVoices) (const XAUDIO2_VOICE_SENDS *pSendList);
|
||||
STDMETHOD(SetEffectChain) (const XAUDIO2_EFFECT_CHAIN *pEffectChain);
|
||||
STDMETHOD(EnableEffect) (UINT32 EffectIndex, UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD(DisableEffect) (UINT32 EffectIndex, UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD_(void, GetEffectState) (UINT32 EffectIndex, BOOL *pEnabled);
|
||||
STDMETHOD(SetEffectParameters) (UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize,
|
||||
UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD(GetEffectParameters) (UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize);
|
||||
STDMETHOD(SetFilterParameters) (const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD_(void, GetFilterParameters) (XAUDIO2_FILTER_PARAMETERS *pParameters);
|
||||
STDMETHOD(SetVolume) (float Volume, UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD_(void, GetVolume) (float *pVolume);
|
||||
STDMETHOD(SetChannelVolumes) (UINT32 Channels, const float *pVolumes, UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD_(void, GetChannelVolumes) (UINT32 Channels, float *pVolumes);
|
||||
STDMETHOD(SetOutputMatrix) (IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels,
|
||||
const float *pLevelMatrix, UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD_(void, GetOutputMatrix) (IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels,
|
||||
UINT32 DestinationChannels, float *pLevelMatrix);
|
||||
STDMETHOD_(void, DestroyVoice) (void);
|
||||
};
|
||||
|
||||
DECLARE_INTERFACE_(IXAudio2MasteringVoice, IXAudio2Voice){};
|
||||
|
||||
DECLARE_INTERFACE_(IXAudio2SubmixVoice, IXAudio2Voice){};
|
||||
|
||||
DECLARE_INTERFACE_(IXAudio2SourceVoice, IXAudio2Voice)
|
||||
{
|
||||
STDMETHOD(Start) (UINT32 Flags, UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD(Stop) (UINT32 Flags, UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD(SubmitSourceBuffer) (const XAUDIO2_BUFFER *pBuffer, const XAUDIO2_BUFFER_WMA *pBufferWMA = NULL);
|
||||
STDMETHOD(FlushSourceBuffers) (void);
|
||||
STDMETHOD(Discontinuity) (void);
|
||||
STDMETHOD(ExitLoop) (UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD_(void, GetState) (XAUDIO2_VOICE_STATE *pVoiceState);
|
||||
STDMETHOD(SetFrequencyRatio) (float Ratio, UINT32 OperationSet = XAUDIO2_COMMIT_NOW);
|
||||
STDMETHOD_(void, GetFrequencyRatio) (float *pRatio);
|
||||
};
|
||||
|
||||
DECLARE_INTERFACE_(IXAudio2, IUnknown)
|
||||
{
|
||||
STDMETHOD(GetDeviceCount) (UINT32 *pCount);
|
||||
STDMETHOD(GetDeviceDetails) (UINT32 Index, XAUDIO2_DEVICE_DETAILS *pDeviceDetails);
|
||||
STDMETHOD(Initialize) (UINT32 Flags = 0, XAUDIO2_PROCESSOR XAudio2Processor = XAUDIO2_DEFAULT_PROCESSOR);
|
||||
STDMETHOD(RegisterForCallbacks) (IXAudio2EngineCallback *pCallback);
|
||||
STDMETHOD_(void, UnregisterForCallbacks) (IXAudio2EngineCallback *pCallback);
|
||||
STDMETHOD(CreateSourceVoice) (IXAudio2SourceVoice* *ppSourceVoice, const WAVEFORMATEX *pSourceFormat, UINT32 Flags = 0,
|
||||
float MaxFrequencyRatio = XAUDIO2_DEFAULT_FREQ_RATIO, IXAudio2VoiceCallback *pCallback = NULL,
|
||||
const XAUDIO2_VOICE_SENDS *pSendList = NULL, const XAUDIO2_EFFECT_CHAIN *pEffectChain = NULL);
|
||||
STDMETHOD(CreateSubmixVoice) (IXAudio2SubmixVoice* *ppSubmixVoice, UINT32 InputChannels, UINT32 InputSampleRate,
|
||||
UINT32 Flags = 0, UINT32 ProcessingStage = 0, const XAUDIO2_VOICE_SENDS *pSendList = NULL,
|
||||
const XAUDIO2_EFFECT_CHAIN *pEffectChain = NULL);
|
||||
STDMETHOD(CreateMasteringVoice) (IXAudio2MasteringVoice* *ppMasteringVoice,
|
||||
UINT32 InputChannels = XAUDIO2_DEFAULT_CHANNELS, UINT32 InputSampleRate = XAUDIO2_DEFAULT_SAMPLERATE,
|
||||
UINT32 Flags = 0, UINT32 DeviceIndex = 0, const XAUDIO2_EFFECT_CHAIN *pEffectChain = NULL);
|
||||
STDMETHOD(StartEngine) (void);
|
||||
STDMETHOD_(void, StopEngine) (void);
|
||||
STDMETHOD(CommitChanges) (UINT32 OperationSet);
|
||||
STDMETHOD_(void, GetPerformanceData) (XAUDIO2_PERFORMANCE_DATA *pPerfData);
|
||||
STDMETHOD_(void, SetDebugConfiguration) (const XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration, void *pReserved = NULL);
|
||||
};
|
||||
|
||||
inline HRESULT XAudio2Create(IXAudio2* *ppXAudio2, UINT32 Flags = 0,
|
||||
XAUDIO2_PROCESSOR XAudio2Processor = XAUDIO2_DEFAULT_PROCESSOR)
|
||||
{
|
||||
IXAudio2 *pXAudio2;
|
||||
HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? CLSID_XAudio2_Debug : CLSID_XAudio2, NULL,
|
||||
CLSCTX_INPROC_SERVER, IID_IXAudio2, (void**)&pXAudio2);
|
||||
if(SUCCEEDED(hr)){
|
||||
hr = pXAudio2->Initialize(Flags, XAudio2Processor);
|
||||
if(SUCCEEDED(hr))
|
||||
*ppXAudio2 = pXAudio2;
|
||||
else
|
||||
pXAudio2->Release();
|
||||
}
|
||||
return hr;
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
Technical Preview 1
|
||||
* Initial release
|
|
@ -1,22 +0,0 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
project(NiotsoClient)
|
||||
|
||||
include_directories(${FILEHANDLER_INCLUDE} ${FREETYPE_INCLUDE})
|
||||
|
||||
if(WIN32)
|
||||
set(NIOTSOCLIENT_SOURCES
|
||||
Client.cpp
|
||||
Audio/Startup.cpp
|
||||
Audio/windows/XAudio2.cpp
|
||||
Graphics/Font.cpp
|
||||
Graphics/Startup.cpp
|
||||
Graphics/Viewport.cpp
|
||||
Resources/Resource.rc
|
||||
Scene/LoginScreen/LoginScreen.cpp
|
||||
System/System.cpp
|
||||
Window/Window.cpp
|
||||
)
|
||||
add_executable(TSO WIN32 ${NIOTSOCLIENT_SOURCES})
|
||||
target_link_libraries(TSO ole32 opengl32)
|
||||
target_link_libraries(TSO FileHandler_shared ${FREETYPE_LINK})
|
||||
endif()
|
642
Client/COPYING
642
Client/COPYING
|
@ -1,642 +0,0 @@
|
|||
IMPORTANT:
|
||||
Niotso is distributed under the terms of the GNU GPLv3.
|
||||
|
||||
While this license does permit others to compile, distribute, change,
|
||||
and distribute changes to Niotso, in reality, many of these freedoms
|
||||
cannot legally be enacted by anybody.
|
||||
|
||||
Specifically, if you make changes to Niotso such that it significantly
|
||||
changes the "game experience as presented to the player", it cannot
|
||||
be distributed to others. You also may not distribute a version of
|
||||
Niotso that has stripped the EA or Maxis trademarked names or logos
|
||||
anywhere from the game. Personal use of these modifications is okay.
|
||||
|
||||
These restrictions are not enforced by us, but may potentially be used
|
||||
by EA in attempt to take down your game.
|
||||
|
||||
If you have any questions, you may visit
|
||||
<http://wiki.niotso.org/Niotso/Legal_Summary>
|
||||
|
||||
---
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
|
@ -1,133 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Client.cpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "EngineInterface.hpp"
|
||||
|
||||
static void Shutdown();
|
||||
Scene * CurrentScene;
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
/* MinGW bonus feature; saves 66 kB in the binary :) */
|
||||
/* */ void* __CRTDECL operator new(unsigned size){return malloc(size);}
|
||||
/* */ void __CRTDECL operator delete(void *ptr){free(ptr);}
|
||||
/* */ extern "C" void __CRTDECL __cxa_pure_virtual(){}
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
|
||||
{
|
||||
int result;
|
||||
|
||||
//Disallow multiple instances of the game from running
|
||||
CreateMutex(NULL, TRUE, "Global\\TSO_NIOTSO_MUTEX");
|
||||
if(GetLastError() == ERROR_ALREADY_EXISTS){
|
||||
HWND hWnd = FindWindow("TSO_NIOTSO", "The Sims Online");
|
||||
if(hWnd != NULL){
|
||||
ShowWindow(hWnd, SW_RESTORE);
|
||||
SetForegroundWindow(hWnd);
|
||||
SetFocus(hWnd);
|
||||
}
|
||||
return ERROR_INIT_ANOTHERINSTRUNNING;
|
||||
}
|
||||
|
||||
Window::Width = 800;
|
||||
Window::Height = 600;
|
||||
Window::Fullscreen = false;
|
||||
System::hInst = hInstance;
|
||||
|
||||
result = Window::Initialize();
|
||||
if(result != 0){
|
||||
Shutdown();
|
||||
return ERROR_INIT | ERROR_INIT_WINDOW | result;
|
||||
}
|
||||
|
||||
result = System::Initialize();
|
||||
if(result != 0){
|
||||
Shutdown();
|
||||
return ERROR_INIT | ERROR_INIT_SYSTEM | result;
|
||||
}
|
||||
|
||||
result = Graphics::Initialize();
|
||||
if(result != 0){
|
||||
Shutdown();
|
||||
return ERROR_INIT | ERROR_INIT_GRAPHICS | result;
|
||||
}
|
||||
|
||||
result = Audio::Initialize();
|
||||
if(result != 0){
|
||||
Shutdown();
|
||||
return ERROR_INIT | ERROR_INIT_AUDIO | result;
|
||||
}
|
||||
|
||||
CurrentScene = new LoginScreen();
|
||||
if(CurrentScene == NULL || System::SceneFailed){
|
||||
Shutdown();
|
||||
return ERROR_INIT | ERROR_INIT_LOGIC | ERROR_LOGIC_CREATE_SCENE;
|
||||
}
|
||||
|
||||
ShowWindow(Window::hWnd, SW_SHOW);
|
||||
SetForegroundWindow(Window::hWnd);
|
||||
SetFocus(Window::hWnd);
|
||||
|
||||
LARGE_INTEGER PreviousTime;
|
||||
QueryPerformanceCounter(&PreviousTime);
|
||||
|
||||
while(true){
|
||||
LARGE_INTEGER CurrentTime;
|
||||
QueryPerformanceCounter(&CurrentTime);
|
||||
float TimeDelta = (float)(CurrentTime.QuadPart-PreviousTime.QuadPart)/System::ClockFreq.QuadPart;
|
||||
PreviousTime = CurrentTime;
|
||||
if(TimeDelta < 0 || TimeDelta >= 5) //Safe-guard in case of system delay
|
||||
continue;
|
||||
|
||||
memcpy(&System::UserInput, (const void*) &System::UserInput_v, sizeof(System::UserInput_t));
|
||||
|
||||
int result = CurrentScene->RunFor(TimeDelta);
|
||||
if(result == System::SHUTDOWN)
|
||||
break;
|
||||
if(result > 0){
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
CurrentScene->Render();
|
||||
SwapBuffers(Graphics::hDC);
|
||||
}
|
||||
|
||||
//Sleep for the remainder of the frame
|
||||
PreviousTime.QuadPart = CurrentTime.QuadPart;
|
||||
QueryPerformanceCounter(&CurrentTime);
|
||||
float SleepDuration =
|
||||
(System::FramePeriod - (float)(CurrentTime.QuadPart-PreviousTime.QuadPart)/System::ClockFreq.QuadPart) * 1000;
|
||||
if(SleepDuration > 1 && SleepDuration < 100) Sleep((unsigned) SleepDuration);
|
||||
}
|
||||
|
||||
ShowWindow(Window::hWnd, SW_HIDE);
|
||||
delete CurrentScene;
|
||||
|
||||
Shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void Shutdown()
|
||||
{
|
||||
Audio::Shutdown();
|
||||
Graphics::Shutdown();
|
||||
System::Shutdown();
|
||||
Window::Shutdown();
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
EngineInterface.hpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
//Compiler/platform constants
|
||||
#ifdef _WIN32
|
||||
#define WINVER 0x0502
|
||||
#define _WIN32_WINNT 0x0502
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
//Standard libraries
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
//Codebase libraries
|
||||
#include "FileHandler.hpp"
|
||||
#include "ft2build.h"
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
//Macro definitions
|
||||
#ifndef min
|
||||
#define min(x,y) ((x)<(y)?(x):(y))
|
||||
#endif
|
||||
#ifndef max
|
||||
#define max(x,y) ((x)>(y)?(x):(y))
|
||||
#endif
|
||||
|
||||
//Codebase version, branding, linker resources
|
||||
#include "version.h"
|
||||
#include "Resources/Resource.h"
|
||||
|
||||
//Components
|
||||
#include "Audio/Audio.hpp"
|
||||
#include "Graphics/Graphics.hpp"
|
||||
#include "System/System.hpp"
|
||||
#include "Window/Window.hpp"
|
||||
|
||||
#include "Scene/Scene.hpp"
|
|
@ -1,179 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Graphics/Font.cpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../EngineInterface.hpp"
|
||||
|
||||
namespace Graphics {
|
||||
|
||||
FT_Library FreeTypeLibrary;
|
||||
FT_Face FontFace;
|
||||
|
||||
static void FindStringSize(const wchar_t * String, unsigned * width, unsigned * height, int * xoffset, int * yoffset, int font){
|
||||
int x = 0, y = 0;
|
||||
int lowestx = 0, lowesty = 0, highestx = 0, highesty = 0;
|
||||
|
||||
for(wchar_t letter=*String; letter!='\0'; letter=*(++String)){
|
||||
int error = FT_Load_Char(FontFace, letter, FT_LOAD_RENDER);
|
||||
if(error) continue;
|
||||
|
||||
int bottomx = x + FontFace->glyph->bitmap_left;
|
||||
int bottomy = y + FontFace->glyph->bitmap_top - FontFace->glyph->bitmap.rows;
|
||||
if(bottomx < lowestx) lowestx = bottomx;
|
||||
if(bottomy < lowesty) lowesty = bottomy;
|
||||
|
||||
int topx = x + FontFace->glyph->bitmap_left + FontFace->glyph->bitmap.width;
|
||||
int topy = y + FontFace->glyph->bitmap_top;
|
||||
if(topx > highestx) highestx = topx;
|
||||
if(topy > highesty) highesty = topy;
|
||||
|
||||
x += FontFace->glyph->advance.x >> 6;
|
||||
y += FontFace->glyph->advance.y >> 6;
|
||||
}
|
||||
|
||||
*width = highestx-lowestx, *height = highesty-lowesty;
|
||||
*xoffset = -lowestx, *yoffset = -lowesty;
|
||||
}
|
||||
|
||||
void DrawText(Image_t * Image, const wchar_t * String, int x, int y, unsigned width, unsigned height,
|
||||
TextAlignment Alignment, int font, COLORREF Color){
|
||||
//x, y, width, height form the bounding rectangle into which the text should be drawn.
|
||||
//(x,y) defines the offset to the top-left of the rectangle from the top left of the background.
|
||||
//The destination image must be stored in bottom-up order.
|
||||
|
||||
if(x >= (signed)Image->Width || y >= (signed)Image->Height) return;
|
||||
|
||||
//(stringx,stringy) will refer to the top-left of the string in bottom-up coordinates
|
||||
int stringx, stringy;
|
||||
unsigned StringWidth, StringHeight;
|
||||
FindStringSize(String, &StringWidth, &StringHeight, &stringx, &stringy, font);
|
||||
|
||||
//Horizontal alignment
|
||||
if(Alignment < 2) stringx = x; //Left
|
||||
else if(Alignment < 4) stringx = x+(width-StringWidth+1)/2; //Middle
|
||||
else stringx = x+width-StringWidth; //Right
|
||||
//Vertical alignment
|
||||
if(!(Alignment&1)) stringy = y; //Top
|
||||
else stringy = y+(height-StringHeight+1)/2; //Middle
|
||||
stringy = Image->Height-stringy-StringHeight;
|
||||
|
||||
//Now that we've done the alignment, we can crop the bounding box within the limits of the background image
|
||||
if(x < 0){ Image->Width += x; x = 0; }
|
||||
if(y < 0){ Image->Height += y; y = 0; }
|
||||
if(width > Image->Width) width = Image->Width;
|
||||
if(height > Image->Height) height = Image->Height;
|
||||
|
||||
for(wchar_t letter=*String; letter!='\0'; letter=*(++String)){
|
||||
int error = FT_Load_Char(FontFace, letter, FT_LOAD_RENDER);
|
||||
if(error) continue;
|
||||
|
||||
int cWidth = FontFace->glyph->bitmap.width, cHeight = FontFace->glyph->bitmap.rows;
|
||||
if(cWidth && cHeight){
|
||||
uint8_t * cRender; /* Convert to Bottom-up */
|
||||
uint8_t * OriginalRender = FontFace->glyph->bitmap.buffer;
|
||||
if(FontFace->glyph->bitmap.pitch > 0){
|
||||
cRender = (uint8_t *) malloc(cWidth * cHeight);
|
||||
for(int i=0; i<cHeight; i++)
|
||||
memcpy(cRender + i*cWidth, OriginalRender + (cHeight-i-1)*cWidth, cWidth);
|
||||
}else cRender = OriginalRender;
|
||||
|
||||
stringx += FontFace->glyph->bitmap_left;
|
||||
stringy += FontFace->glyph->bitmap_top-cHeight;
|
||||
for(int i=max(-stringy, 0); i<cHeight && (unsigned)stringy+i < height; i++){
|
||||
for(int j=max(-stringx, 0); j<cWidth && (unsigned)stringx+j < width; j++){
|
||||
int value = cRender[i*cWidth + j];
|
||||
uint8_t *ptr = Image->Data + 3*((stringy+i)*width + (stringx+j));
|
||||
|
||||
int originalcolor;
|
||||
originalcolor = *ptr;
|
||||
*ptr++ = (uint8_t) (originalcolor + (int)((GetBValue(Color)-originalcolor)*2*value+255)/510);
|
||||
originalcolor = *ptr;
|
||||
*ptr++ = (uint8_t) (originalcolor + (int)((GetGValue(Color)-originalcolor)*2*value+255)/510);
|
||||
originalcolor = *ptr;
|
||||
*ptr++ = (uint8_t) (originalcolor + (int)((GetRValue(Color)-originalcolor)*2*value+255)/510);
|
||||
}
|
||||
}
|
||||
stringx -= FontFace->glyph->bitmap_left;
|
||||
stringy -= FontFace->glyph->bitmap_top-cHeight;
|
||||
|
||||
if(FontFace->glyph->bitmap.pitch > 0) free(cRender);
|
||||
}
|
||||
stringx += FontFace->glyph->advance.x >> 6;
|
||||
stringy += FontFace->glyph->advance.y >> 6;
|
||||
}
|
||||
}
|
||||
|
||||
Image_t * StringImage(const wchar_t * String, int font, COLORREF Color){
|
||||
Image_t * Image = (Image_t*) malloc(sizeof(Image_t));
|
||||
if(Image == NULL) return NULL;
|
||||
|
||||
unsigned StringWidth, StringHeight;
|
||||
int stringx, stringy;
|
||||
FindStringSize(String, &StringWidth, &StringHeight, &stringx, &stringy, font);
|
||||
|
||||
Image->Data = (uint8_t*) malloc(4 * StringWidth * StringHeight);
|
||||
if(Image->Data == NULL){
|
||||
free(Image);
|
||||
return NULL;
|
||||
}
|
||||
for(unsigned i=0; i<4*StringWidth*StringHeight;){
|
||||
Image->Data[i++] = GetBValue(Color);
|
||||
Image->Data[i++] = GetGValue(Color);
|
||||
Image->Data[i++] = GetRValue(Color);
|
||||
Image->Data[i++] = 0;
|
||||
}
|
||||
|
||||
for(wchar_t letter=*String; letter!='\0'; letter=*(++String)){
|
||||
int error = FT_Load_Char(FontFace, letter, FT_LOAD_RENDER);
|
||||
if(error) continue;
|
||||
|
||||
int cWidth = FontFace->glyph->bitmap.width, cHeight = FontFace->glyph->bitmap.rows;
|
||||
if(cWidth && cHeight){
|
||||
uint8_t * cRender; /* Convert to Bottom-up */
|
||||
uint8_t * OriginalRender = FontFace->glyph->bitmap.buffer;
|
||||
if(FontFace->glyph->bitmap.pitch > 0){
|
||||
cRender = (uint8_t *) malloc(cWidth * cHeight);
|
||||
for(int i=0; i<cHeight; i++)
|
||||
memcpy(cRender + i*cWidth, OriginalRender + (cHeight-i-1)*cWidth, cWidth);
|
||||
}else cRender = OriginalRender;
|
||||
|
||||
stringx += FontFace->glyph->bitmap_left;
|
||||
stringy += FontFace->glyph->bitmap_top-cHeight;
|
||||
for(int i=0; i<cHeight; i++){
|
||||
for(int j=0; j<cWidth; j++){
|
||||
uint8_t *ptr = Image->Data + 4*((stringy+i)*StringWidth + (stringx+j));
|
||||
ptr[3] = cRender[i*cWidth + j];
|
||||
}
|
||||
}
|
||||
stringx -= FontFace->glyph->bitmap_left;
|
||||
stringy -= FontFace->glyph->bitmap_top-cHeight;
|
||||
|
||||
if(FontFace->glyph->bitmap.pitch > 0) free(cRender);
|
||||
}
|
||||
stringx += FontFace->glyph->advance.x >> 6;
|
||||
stringy += FontFace->glyph->advance.y >> 6;
|
||||
}
|
||||
|
||||
Image->Width = StringWidth;
|
||||
Image->Height = StringHeight;
|
||||
Image->Format = FIMG_BGRA32;
|
||||
return Image;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Graphics/Graphics.hpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <gl/gl.h>
|
||||
#include <gl/glext.h>
|
||||
|
||||
//Graphics/Startup.cpp
|
||||
namespace Graphics {
|
||||
int Initialize();
|
||||
void Shutdown();
|
||||
extern HDC hDC;
|
||||
extern HGLRC hRC;
|
||||
|
||||
int InitGL();
|
||||
void ResizeViewport(unsigned width, unsigned height);
|
||||
|
||||
enum TextAlignment {
|
||||
ALIGN_LEFT_TOP,
|
||||
ALIGN_LEFT_CENTER,
|
||||
ALIGN_CENTER_TOP,
|
||||
ALIGN_CENTER_CENTER,
|
||||
ALIGN_RIGHT_TOP,
|
||||
ALIGN_RIGHT_CENTER
|
||||
};
|
||||
|
||||
//Font.cpp
|
||||
extern FT_Library FreeTypeLibrary;
|
||||
extern FT_Face FontFace;
|
||||
void DrawText(Image_t * Image, const wchar_t * String, int x, int y, unsigned width, unsigned height,
|
||||
TextAlignment Alignment, int font, COLORREF Color);
|
||||
Image_t * StringImage(const wchar_t * String, int font, COLORREF Color);
|
||||
}
|
|
@ -1,121 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Graphics/Startup.cpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../EngineInterface.hpp"
|
||||
|
||||
namespace Graphics {
|
||||
|
||||
HDC hDC;
|
||||
HGLRC hRC;
|
||||
|
||||
int Initialize(){
|
||||
hDC = GetDC(Window::hWnd);
|
||||
if(hDC == NULL){
|
||||
MessageBox(Window::hWnd, "Failed to obtain the device context.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_GRAPHICS_OBTAIN_DC;
|
||||
}
|
||||
|
||||
const PIXELFORMATDESCRIPTOR pfd = {
|
||||
sizeof(PIXELFORMATDESCRIPTOR), 1, //Size and version
|
||||
PFD_DRAW_TO_WINDOW | //dwFlags
|
||||
PFD_SUPPORT_OPENGL |
|
||||
PFD_DOUBLEBUFFER,
|
||||
PFD_TYPE_RGBA, //iPixelType
|
||||
24, //cColorBits
|
||||
0, 0, 0, 0, 0, 0, 0, 0, //R,G,B,A bits
|
||||
0, 0, 0, 0, 0, //Accumulation buffer bits
|
||||
16, //cDepthBits
|
||||
0, //cStencilBits
|
||||
0, //cAuxBuffers
|
||||
PFD_MAIN_PLANE, //iLayerType
|
||||
0, //Reserved
|
||||
0, 0, 0 //Masks
|
||||
};
|
||||
|
||||
unsigned PixelFormat = ChoosePixelFormat(hDC, &pfd);
|
||||
if(!PixelFormat){
|
||||
MessageBox(Window::hWnd, "Failed to find a suitable pixel format for the device context.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_GRAPHICS_FIND_PIXELFORMAT;
|
||||
}
|
||||
|
||||
if(!SetPixelFormat(hDC, PixelFormat, &pfd)){
|
||||
MessageBox(Window::hWnd, "Failed to set the pixel format for the device context.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_GRAPHICS_SET_PIXELFORMAT;
|
||||
}
|
||||
|
||||
hRC = wglCreateContext(hDC);
|
||||
if(!hRC){
|
||||
MessageBox(Window::hWnd, "Failed to create an OpenGL rendering context.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_GRAPHICS_CREATE_GLRC;
|
||||
}
|
||||
|
||||
if(!wglMakeCurrent(hDC, hRC)){
|
||||
MessageBox(Window::hWnd, "Failed to activate the OpenGL device context.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_GRAPHICS_ACTIVATE_GLRC;
|
||||
}
|
||||
|
||||
BOOL (WINAPI *wglSwapIntervalEXT)(int) = (BOOL (WINAPI *)(int)) wglGetProcAddress("wglSwapIntervalEXT");
|
||||
if(wglSwapIntervalEXT) wglSwapIntervalEXT(1);
|
||||
int (WINAPI *wglGetSwapIntervalEXT)(void) = (int (WINAPI *)(void)) wglGetProcAddress("wglGetSwapIntervalEXT");
|
||||
if(wglGetSwapIntervalEXT) wglGetSwapIntervalEXT(); //Seems necessary on some cards
|
||||
|
||||
int result = InitGL();
|
||||
if(result != 0){
|
||||
Shutdown();
|
||||
return ERROR_GRAPHICS_INIT_GLSCENE | result;
|
||||
}
|
||||
|
||||
ResizeViewport(Window::Width, Window::Height);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int InitGL(){
|
||||
glShadeModel(GL_SMOOTH);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
glClearDepth(1.0f);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_RESCALE_NORMAL);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_BLEND);
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Shutdown(){
|
||||
if(Graphics::hRC){
|
||||
wglMakeCurrent(NULL, NULL);
|
||||
wglDeleteContext(Graphics::hRC);
|
||||
Graphics::hRC = NULL;
|
||||
}
|
||||
if(Graphics::hDC){
|
||||
ReleaseDC(Window::hWnd, Graphics::hDC);
|
||||
Graphics::hDC = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Graphics/Viewport.cpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../EngineInterface.hpp"
|
||||
|
||||
void Graphics::ResizeViewport(unsigned width, unsigned height){
|
||||
if(width == 0) width++;
|
||||
if(height == 0) height++;
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
||||
glOrtho(0, width, 0, height, 0.0, 1.0);
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
#define ID_VERSIONINFO 1
|
||||
#define IDI_TSO 2
|
|
@ -1,32 +0,0 @@
|
|||
#include <windows.h>
|
||||
#include "../version.h"
|
||||
#include "Resource.h"
|
||||
|
||||
IDI_TSO ICON "TSO.ico"
|
||||
|
||||
ID_VERSIONINFO VERSIONINFO
|
||||
FILEVERSION VERSION_A,VERSION_B,VERSION_C,VERSION_D
|
||||
PRODUCTVERSION VERSION_A,VERSION_B,VERSION_C,VERSION_D
|
||||
FILEOS 0x00040000L //Windows 32-bit+
|
||||
FILETYPE 1 //1 is exe, 2 is dll, and so on.
|
||||
//The list can be found at <http://msdn.microsoft.com/en-us/library/aa381058.aspx>
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Maxis™"
|
||||
VALUE "FileDescription", "The Sims Online"
|
||||
VALUE "FileVersion", VERSIONSTR
|
||||
VALUE "InternalName", "TSO_NIOTSO"
|
||||
VALUE "LegalCopyright", "Copyright © 2002-2005 Maxis™"
|
||||
VALUE "OriginalFilename", "TSO.exe"
|
||||
VALUE "ProductName", "The Sims Online"
|
||||
VALUE "ProductVersion", VERSIONSTR
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
Binary file not shown.
Before Width: | Height: | Size: 61 KiB |
|
@ -1,226 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Scene/LoginScreen/LoginScreen.cpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../EngineInterface.hpp"
|
||||
|
||||
static const wchar_t * const StatusStrings[] = {
|
||||
L"Extruding Terrain Web",
|
||||
L"Adjusting Emotional Weights",
|
||||
L"Calibrating Personality Matrix",
|
||||
|
||||
L"Calculating Domestic Coefficients",
|
||||
L"Readjusting Career Ladder",
|
||||
L"Accessing Money Supply",
|
||||
L"Hacking the Social Network",
|
||||
L"Tweaking Chaos Control",
|
||||
L"Downloading Reticulated Splines"
|
||||
};
|
||||
static const char * const images[] = {"eagames.bmp", "maxis.png", "setup.bmp"};
|
||||
|
||||
static const char * const sounds[] = {"loadloop.wav"};
|
||||
|
||||
LoginScreen::LoginScreen() : Scene(0){
|
||||
Screen = Screen_EAGames;
|
||||
Time = 0;
|
||||
ScrollPos = -1;
|
||||
memset(image, 0, IMG_COUNT * sizeof(Image_t *));
|
||||
memset(texture, 0, TEX_COUNT * sizeof(GLuint));
|
||||
memset(sound, 0, SND_COUNT * sizeof(PlayableSound_t *));
|
||||
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glGenTextures(TEX_COUNT, texture);
|
||||
|
||||
FT_Set_Char_Size(Graphics::FontFace, 0, 22*64, 0, 0);
|
||||
|
||||
for(int i=TEX_EAGAMES; i<=TEX_SETUP; i++){
|
||||
Image_t * Image = File::ReadImageFile(images[i]);
|
||||
if(!Image){
|
||||
const char * Message;
|
||||
switch(File::Error){
|
||||
case FERR_NOT_FOUND:
|
||||
Message = "%s does not exist.";
|
||||
break;
|
||||
case FERR_OPEN:
|
||||
Message = "%s could not be opened for reading.";
|
||||
break;
|
||||
case FERR_BLANK:
|
||||
case FERR_UNRECOGNIZED:
|
||||
case FERR_INVALIDDATA:
|
||||
Message = "%s is corrupt or invalid.";
|
||||
break;
|
||||
case FERR_MEMORY:
|
||||
Message = "Memory for %s could not be allocated.";
|
||||
break;
|
||||
default:
|
||||
Message = "%s could not be read.";
|
||||
}
|
||||
|
||||
char Buffer[1024];
|
||||
sprintf(Buffer, Message, images[i]);
|
||||
MessageBox(Window::hWnd, Buffer, NULL, MB_OK | MB_ICONERROR);
|
||||
EXIT_SCENE();
|
||||
}
|
||||
|
||||
if(i == TEX_MAXIS){
|
||||
Graphics::DrawText(Image, L"Maxis\x2122 is an Electronic Arts\x2122 brand.", 0, 600-146, 800, 146,
|
||||
Graphics::ALIGN_CENTER_CENTER, 0, RGB(0xef, 0xe3, 0x8c));
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, texture[i]);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, Image->Width, Image->Height, 0, GL_BGR, GL_UNSIGNED_BYTE, Image->Data);
|
||||
free(Image->Data);
|
||||
free(Image);
|
||||
}
|
||||
|
||||
image[IMG_COPYRIGHT] = Graphics::StringImage(L"(c) 2002, 2003 Electronic Arts Inc. All rights reserved.",
|
||||
0, RGB(0xef, 0xe3, 0x8c));
|
||||
if(image[IMG_COPYRIGHT] == NULL){
|
||||
EXIT_SCENE();
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, texture[TEX_COPYRIGHT]);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, image[IMG_COPYRIGHT]->Width, image[IMG_COPYRIGHT]->Height, 0, GL_BGRA,
|
||||
GL_UNSIGNED_BYTE, image[IMG_COPYRIGHT]->Data);
|
||||
free(image[IMG_COPYRIGHT]->Data);
|
||||
|
||||
for(int i=0; i<9; i++){
|
||||
image[IMG_STATUS+i] = Graphics::StringImage(StatusStrings[i], 0, RGB(0xef, 0xe3, 0x8c));
|
||||
if(image[IMG_STATUS+i] == NULL){
|
||||
EXIT_SCENE();
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, texture[TEX_STATUS+i]);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, image[IMG_STATUS+i]->Width, image[IMG_STATUS+i]->Height, 0, GL_BGRA,
|
||||
GL_UNSIGNED_BYTE, image[IMG_STATUS+i]->Data);
|
||||
free(image[IMG_STATUS+i]->Data);
|
||||
}
|
||||
|
||||
for(int i=0; i<SND_COUNT; i++){
|
||||
Sound_t * Sound = File::ReadSoundFile(sounds[i]);
|
||||
if(!Sound){
|
||||
const char * Message;
|
||||
switch(File::Error){
|
||||
case FERR_NOT_FOUND:
|
||||
Message = "%s does not exist.";
|
||||
break;
|
||||
case FERR_OPEN:
|
||||
Message = "%s could not be opened for reading.";
|
||||
break;
|
||||
case FERR_BLANK:
|
||||
case FERR_UNRECOGNIZED:
|
||||
case FERR_INVALIDDATA:
|
||||
Message = "%s is corrupt or invalid.";
|
||||
break;
|
||||
case FERR_MEMORY:
|
||||
Message = "Memory for %s could not be allocated.";
|
||||
break;
|
||||
default:
|
||||
Message = "%s could not be read.";
|
||||
}
|
||||
|
||||
char Buffer[1024];
|
||||
sprintf(Buffer, Message, sounds[i]);
|
||||
MessageBox(Window::hWnd, Buffer, NULL, MB_OK | MB_ICONERROR);
|
||||
EXIT_SCENE();
|
||||
}
|
||||
|
||||
sound[i] = Audio::LoadSound(Sound);
|
||||
free(Sound);
|
||||
if(!sound){
|
||||
MessageBox(Window::hWnd, "Sound could not be created", NULL, MB_OK | MB_ICONERROR);
|
||||
EXIT_SCENE();
|
||||
}
|
||||
Audio::PlaySound(sound[i]);
|
||||
}
|
||||
}
|
||||
|
||||
LoginScreen::~LoginScreen(){
|
||||
for(int i=0; i<IMG_COUNT; i++){ if(image[i]) free(image[i]); }
|
||||
glDeleteTextures(TEX_COUNT, texture);
|
||||
|
||||
for(int i=0; i<SND_COUNT; i++){
|
||||
if(sound[i]){
|
||||
Audio::DeleteSound(sound[i]);
|
||||
free(sound[i]->Data);
|
||||
free(sound[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int LoginScreen::Run(float TimeDelta){
|
||||
Time += TimeDelta;
|
||||
if(ScrollPos != 8){
|
||||
ScrollPos += TimeDelta*0.75;
|
||||
if(ScrollPos > 8) ScrollPos = 8;
|
||||
}
|
||||
|
||||
if(Screen != Screen_Setup && Time >= 4.0){
|
||||
Screen = (Screen==Screen_EAGames) ? Screen_Maxis : Screen_Setup;
|
||||
Time = 0;
|
||||
}
|
||||
|
||||
if(System::UserInput.CloseWindow){
|
||||
return SCENE_EXIT;
|
||||
}
|
||||
return SCENE_NEED_REDRAW;
|
||||
}
|
||||
|
||||
void LoginScreen::Render(){
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
|
||||
//Background
|
||||
glBindTexture(GL_TEXTURE_2D, texture[Screen]);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2i(0,0); glVertex2i(0,0);
|
||||
glTexCoord2i(1,0); glVertex2i(800,0);
|
||||
glTexCoord2i(1,1); glVertex2i(800,600);
|
||||
glTexCoord2i(0,1); glVertex2i(0,600);
|
||||
glEnd();
|
||||
|
||||
if(Screen != Screen_Setup) return;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, texture[TEX_COPYRIGHT]);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2i(0,0); glVertex2i((800-image[IMG_COPYRIGHT]->Width)/2,58);
|
||||
glTexCoord2i(1,0); glVertex2i((800-image[IMG_COPYRIGHT]->Width)/2 + image[IMG_COPYRIGHT]->Width,58);
|
||||
glTexCoord2i(1,1); glVertex2i((800-image[IMG_COPYRIGHT]->Width)/2 + image[IMG_COPYRIGHT]->Width,image[IMG_COPYRIGHT]->Height + 58);
|
||||
glTexCoord2i(0,1); glVertex2i((800-image[IMG_COPYRIGHT]->Width)/2,image[IMG_COPYRIGHT]->Height + 58);
|
||||
glEnd();
|
||||
|
||||
for(int i=0; i<9; i++){
|
||||
glBindTexture(GL_TEXTURE_2D, texture[TEX_STATUS+i]);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2i(0,0); glVertex2i(((float)i - ScrollPos)*800 + (800-image[IMG_STATUS+i]->Width)/2,20);
|
||||
glTexCoord2i(1,0); glVertex2i(((float)i - ScrollPos)*800 + (800-image[IMG_STATUS+i]->Width)/2 + image[IMG_STATUS+i]->Width,20);
|
||||
glTexCoord2i(1,1); glVertex2i(((float)i - ScrollPos)*800 + (800-image[IMG_STATUS+i]->Width)/2 + image[IMG_STATUS+i]->Width,image[IMG_STATUS+i]->Height + 20);
|
||||
glTexCoord2i(0,1); glVertex2i(((float)i - ScrollPos)*800 + (800-image[IMG_STATUS+i]->Width)/2,image[IMG_STATUS+i]->Height + 20);
|
||||
glEnd();
|
||||
}
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Scene/LoginScreen/LoginScreen.hpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class LoginScreen : public Scene {
|
||||
enum {
|
||||
IMG_COPYRIGHT,
|
||||
IMG_STATUS, //value = 1..9
|
||||
IMG_COUNT = 10
|
||||
};
|
||||
|
||||
enum {
|
||||
TEX_EAGAMES,
|
||||
TEX_MAXIS,
|
||||
TEX_SETUP,
|
||||
TEX_COPYRIGHT,
|
||||
TEX_STATUS, //value = 4..12
|
||||
TEX_COUNT = 13
|
||||
};
|
||||
|
||||
enum {
|
||||
SND_LOADLOOP,
|
||||
SND_COUNT
|
||||
};
|
||||
|
||||
enum { Screen_EAGames, Screen_Maxis, Screen_Setup } Screen;
|
||||
float Time;
|
||||
float ScrollPos;
|
||||
Image_t * image[IMG_COUNT];
|
||||
GLuint texture[TEX_COUNT];
|
||||
PlayableSound_t * sound[SND_COUNT];
|
||||
|
||||
public:
|
||||
LoginScreen();
|
||||
~LoginScreen();
|
||||
void Render();
|
||||
|
||||
private:
|
||||
int Run(float TimeDelta);
|
||||
};
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Scene/Scene.hpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define EXIT_SCENE() do { System::SceneFailed = true; delete this; return; } while(0)
|
||||
#define SCENE_EXIT 0
|
||||
#define SCENE_NEED_REDRAW 1
|
||||
#define SCENE_NO_REDRAW -1
|
||||
|
||||
class Scene {
|
||||
const float TickPeriod;
|
||||
float RealTimeDelta;
|
||||
virtual int Run(float TimeDelta) = 0;
|
||||
|
||||
protected:
|
||||
float TimeDelta;
|
||||
Scene(float c) : TickPeriod(c), RealTimeDelta(0) {}
|
||||
|
||||
public:
|
||||
int RunFor(float TimeDelta) {
|
||||
if(TickPeriod == 0){
|
||||
return Run(TimeDelta);
|
||||
}
|
||||
|
||||
bool Redraw = false;
|
||||
RealTimeDelta += TimeDelta;
|
||||
while(RealTimeDelta >= 0){
|
||||
int result = Run(TickPeriod);
|
||||
if(result == System::SHUTDOWN)
|
||||
return System::SHUTDOWN;
|
||||
if(result > 0) Redraw = true;
|
||||
RealTimeDelta -= TickPeriod;
|
||||
}
|
||||
return (Redraw) ? 1 : -1;
|
||||
}
|
||||
|
||||
virtual void Render() = 0;
|
||||
virtual ~Scene() {};
|
||||
};
|
||||
|
||||
/****
|
||||
** Scenes
|
||||
*/
|
||||
|
||||
#include "LoginScreen/LoginScreen.hpp"
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
System/System.cpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../EngineInterface.hpp"
|
||||
|
||||
namespace System {
|
||||
|
||||
HINSTANCE hInst = NULL;
|
||||
LARGE_INTEGER ClockFreq;
|
||||
volatile float FramePeriod;
|
||||
UserInput_t UserInput = UserInput_t();
|
||||
volatile UserInput_t UserInput_v;
|
||||
bool SceneFailed = false;
|
||||
|
||||
int Initialize(){
|
||||
QueryPerformanceFrequency(&ClockFreq);
|
||||
|
||||
DEVMODE dm;
|
||||
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm);
|
||||
System::FramePeriod = 1.0f/dm.dmDisplayFrequency;
|
||||
|
||||
if(FT_Init_FreeType(&Graphics::FreeTypeLibrary)){
|
||||
MessageBox(Window::hWnd, "Failed to initialize FreeType.", NULL, MB_OK | MB_ICONERROR);
|
||||
Graphics::FreeTypeLibrary = NULL;
|
||||
Shutdown();
|
||||
return ERROR_SYSTEM_INIT_FREETYPE;
|
||||
};
|
||||
if(FT_New_Face(Graphics::FreeTypeLibrary, "simdialogue-uni-game.ttf", 0, &Graphics::FontFace)){
|
||||
MessageBox(Window::hWnd, "simdialogue-uni-game.ttf does not exist or is corrupt or invalid.",
|
||||
NULL, MB_OK | MB_ICONERROR);
|
||||
Graphics::FontFace = NULL;
|
||||
Shutdown();
|
||||
return ERROR_SYSTEM_MISSING_FONT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Shutdown(){
|
||||
if(Graphics::FontFace){
|
||||
FT_Done_Face(Graphics::FontFace);
|
||||
Graphics::FontFace = NULL;
|
||||
}
|
||||
if(Graphics::FreeTypeLibrary){
|
||||
FT_Done_FreeType(Graphics::FreeTypeLibrary);
|
||||
Graphics::FreeTypeLibrary = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
System/System.hpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace System {
|
||||
int Initialize();
|
||||
void Shutdown();
|
||||
|
||||
extern HINSTANCE hInst;
|
||||
extern LARGE_INTEGER ClockFreq;
|
||||
extern volatile float FramePeriod;
|
||||
|
||||
struct UserInput_t {
|
||||
bool Keys[256];
|
||||
bool MouseDown;
|
||||
bool CloseWindow;
|
||||
};
|
||||
extern UserInput_t UserInput;
|
||||
extern volatile UserInput_t UserInput_v;
|
||||
|
||||
extern bool SceneFailed;
|
||||
|
||||
//Constants
|
||||
enum {
|
||||
SHUTDOWN = 0
|
||||
};
|
||||
}
|
||||
|
||||
/****
|
||||
** Program exit codes
|
||||
** (Return 0 for success)
|
||||
*/
|
||||
|
||||
#define ERROR_INIT 0x1000
|
||||
#define ERROR_INIT_ANOTHERINSTRUNNING 0x1001
|
||||
|
||||
//Engine errors
|
||||
//Use: return ERROR_INIT | result;
|
||||
#define ERROR_INIT_WINDOW 0x0100
|
||||
enum {
|
||||
ERROR_WINDOW_SYNCOBJECT = 1,
|
||||
ERROR_WINDOW_CREATE_THREAD,
|
||||
ERROR_WINDOW_SYNCHRONIZE,
|
||||
ERROR_WINDOW_REGISTER_CLASS,
|
||||
ERROR_WINDOW_CREATE,
|
||||
ERROR_WINDOW_HANDLE
|
||||
};
|
||||
#define ERROR_INIT_SYSTEM 0x0200
|
||||
enum {
|
||||
ERROR_SYSTEM_INIT_FREETYPE = 1,
|
||||
ERROR_SYSTEM_MISSING_FONT
|
||||
};
|
||||
#define ERROR_INIT_GRAPHICS 0x0300
|
||||
enum {
|
||||
ERROR_GRAPHICS_OBTAIN_DC = 1,
|
||||
ERROR_GRAPHICS_FIND_PIXELFORMAT,
|
||||
ERROR_GRAPHICS_SET_PIXELFORMAT,
|
||||
ERROR_GRAPHICS_CREATE_GLRC,
|
||||
ERROR_GRAPHICS_ACTIVATE_GLRC,
|
||||
ERROR_GRAPHICS_INIT_GLSCENE
|
||||
};
|
||||
#define ERROR_INIT_AUDIO 0x0400
|
||||
enum {
|
||||
ERROR_AUDIO_INIT_COM = 1,
|
||||
ERROR_AUDIO_INIT_XAUDIO2,
|
||||
ERROR_AUDIO_CREATE_VOICE
|
||||
};
|
||||
#define ERROR_INIT_LOGIC 0x0500
|
||||
enum {
|
||||
ERROR_LOGIC_CREATE_SCENE = 1
|
||||
};
|
21
Client/TODO
21
Client/TODO
|
@ -1,21 +0,0 @@
|
|||
Because there are too many long-term things to list that we still have "to do" to reach the next development phase (e.g.
|
||||
alpha to beta), this file contains only the things that are worked on currently or that will be in the very near future.
|
||||
|
||||
While anybody is free to work on _anything_ at any point during Niotso's time, this list shall ONLY contain those relevant
|
||||
to complete the criteria for the next development phase, which can be found here:
|
||||
<http://wiki.niotso.org/Niotso_Release_Schedule>
|
||||
|
||||
//----------//
|
||||
|
||||
Development Phase: Planning
|
||||
|
||||
Technical Preview 1
|
||||
Schedule: (Not very subject to change)
|
||||
1. Implement cst, uis, ini, and xml parsers with support for UTF-8 [20%]
|
||||
2. Replicate functionality up until the login dialog [90%]
|
||||
3. Implement the audio engine
|
||||
4. Implement the OpenGL-based windowing system
|
||||
5. Replicate character selection and creation features and the city selection dialog
|
||||
6. Implement debug logging and support for configuration files
|
||||
7. Implement the code needed to allow the game to read all necessary files from the TSOClient folder
|
||||
8. Port the client to Linux
|
|
@ -1,208 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Window/Window.cpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../EngineInterface.hpp"
|
||||
|
||||
namespace Window {
|
||||
|
||||
unsigned Width, Height;
|
||||
bool Fullscreen;
|
||||
HWND hWnd;
|
||||
|
||||
static HANDLE Response = NULL;
|
||||
static HANDLE Thread = NULL;
|
||||
static DWORD ThreadID = NULL;
|
||||
static volatile int Result = NULL;
|
||||
|
||||
static DWORD WINAPI Procedure(LPVOID);
|
||||
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
static int CreateWindowInvisible(HINSTANCE hInst, unsigned Width, unsigned Height, bool Fullscreen);
|
||||
|
||||
int Initialize(){
|
||||
Response = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
if(Response == NULL){
|
||||
MessageBox(NULL, "Failed to create the message loop synchronization object.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_WINDOW_SYNCOBJECT;
|
||||
}
|
||||
|
||||
Thread = CreateThread(NULL, 1024 /* very tiny stack size is needed */, Window::Procedure, NULL, 0, &ThreadID);
|
||||
if(Thread == NULL){
|
||||
MessageBox(NULL, "Failed to create the message loop thread.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_WINDOW_CREATE_THREAD;
|
||||
}
|
||||
|
||||
if(WaitForSingleObject(Window::Response, INFINITE) != WAIT_OBJECT_0){
|
||||
MessageBox(NULL, "Failed to synchronize with the message loop thread.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_WINDOW_SYNCHRONIZE;
|
||||
}
|
||||
|
||||
if(Result != 0){
|
||||
Shutdown();
|
||||
return Result;
|
||||
}
|
||||
|
||||
hWnd = FindWindow("TSO_NIOTSO", "The Sims Online");
|
||||
if(hWnd == NULL){
|
||||
MessageBox(NULL, "Failed to obtain a handle for the window.", NULL, MB_OK | MB_ICONERROR);
|
||||
Shutdown();
|
||||
return ERROR_WINDOW_HANDLE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Shutdown(){
|
||||
if(hWnd){
|
||||
DestroyWindow(hWnd);
|
||||
hWnd = NULL;
|
||||
}
|
||||
if(Thread){
|
||||
DWORD value;
|
||||
while(GetExitCodeThread(Thread, &value) && value){
|
||||
PostThreadMessage(ThreadID, WM_QUIT, 0, 0);
|
||||
Sleep(1);
|
||||
}
|
||||
Thread = NULL;
|
||||
}
|
||||
if(Response){
|
||||
CloseHandle(Response);
|
||||
Response = NULL;
|
||||
}
|
||||
|
||||
UnregisterClass("TSO_NIOTSO", System::hInst);
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){
|
||||
switch(uMsg){
|
||||
|
||||
case WM_SETCURSOR:
|
||||
SetCursor(NULL);
|
||||
break;
|
||||
|
||||
case WM_KEYDOWN:
|
||||
case WM_KEYUP:
|
||||
System::UserInput_v.Keys[wParam] = (uMsg == WM_KEYDOWN);
|
||||
return 0;
|
||||
|
||||
case WM_CLOSE:
|
||||
System::UserInput_v.CloseWindow = true;
|
||||
return 0;
|
||||
|
||||
case WM_DEVMODECHANGE: {
|
||||
DEVMODE dm;
|
||||
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm);
|
||||
System::FramePeriod = 1.0f/dm.dmDisplayFrequency;
|
||||
} return 0;
|
||||
|
||||
}
|
||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
static DWORD WINAPI Procedure(LPVOID){
|
||||
int result = CreateWindowInvisible(System::hInst, Window::Width, Window::Height, Window::Fullscreen);
|
||||
if(result != 0){
|
||||
Window::Result = result;
|
||||
SetEvent(Window::Response);
|
||||
return 0;
|
||||
}
|
||||
SetEvent(Window::Response);
|
||||
|
||||
MSG msg;
|
||||
while(GetMessage(&msg, NULL, 0, 0)){
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int CreateWindowInvisible(HINSTANCE hInst, unsigned Width, unsigned Height, bool Fullscreen)
|
||||
{
|
||||
const WNDCLASS wc = {
|
||||
CS_OWNDC, //style
|
||||
WndProc, //lpfnWndProc
|
||||
0, //cbClsExtra
|
||||
0, //cbWndExtra
|
||||
hInst, //hInstance
|
||||
(HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_TSO), //hIcon
|
||||
IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE),
|
||||
NULL, //hCursor
|
||||
NULL, //hbrBackground
|
||||
NULL, //lpszMenuName
|
||||
"TSO_NIOTSO" //lpszClassName
|
||||
};
|
||||
|
||||
if(!RegisterClass(&wc)){
|
||||
MessageBox(NULL, "Failed to register the window class.", NULL, MB_OK | MB_ICONERROR);
|
||||
return ERROR_WINDOW_REGISTER_CLASS;
|
||||
}
|
||||
SetCursor(NULL);
|
||||
|
||||
HWND hWnd = NULL;
|
||||
if(Fullscreen){
|
||||
DEVMODE dmScreenSettings;
|
||||
dmScreenSettings.dmSize = sizeof(dmScreenSettings);
|
||||
dmScreenSettings.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT|DM_BITSPERPEL;
|
||||
dmScreenSettings.dmPelsWidth = Width;
|
||||
dmScreenSettings.dmPelsHeight = Height;
|
||||
dmScreenSettings.dmBitsPerPel = 32;
|
||||
|
||||
if(ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL){
|
||||
MessageBox(NULL, "Fullscreen mode is not supported by your setup. It has been turned off.", NULL,
|
||||
MB_OK | MB_ICONERROR);
|
||||
Fullscreen = 0;
|
||||
}else{
|
||||
hWnd = CreateWindowEx(WS_EX_APPWINDOW, "TSO_NIOTSO", "The Sims Online", WS_POPUP,
|
||||
0, 0, Width, Height, 0, 0, hInst, NULL);
|
||||
}
|
||||
}
|
||||
if(hWnd == NULL){
|
||||
Fullscreen = false;
|
||||
RECT WindowRect = {0, 0, Width, Height};
|
||||
|
||||
//Use a style of WS_OVERLAPPEDWINDOW to allow resizing
|
||||
AdjustWindowRectEx(&WindowRect, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, FALSE,
|
||||
WS_EX_APPWINDOW); //This finds the dimensions of a window with a client area of our specified dimensions
|
||||
|
||||
//Note: Windows can be positioned anywhere, even outside the visible workspace,
|
||||
//but their sizes are limited to the size of the workspace on the primary display.
|
||||
unsigned WindowWidth = WindowRect.right-WindowRect.left, WindowHeight = WindowRect.bottom-WindowRect.top;
|
||||
RECT WorkspaceRect;
|
||||
SystemParametersInfo(SPI_GETWORKAREA, 0, &WorkspaceRect, 0);
|
||||
|
||||
hWnd = CreateWindowEx(WS_EX_APPWINDOW, "TSO_NIOTSO", "The Sims Online",
|
||||
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX,
|
||||
((WorkspaceRect.right-WorkspaceRect.left - WindowWidth)>>1) + WorkspaceRect.left,
|
||||
((WorkspaceRect.bottom-WorkspaceRect.top - WindowHeight)>>1) + WorkspaceRect.top,
|
||||
WindowWidth, WindowHeight, 0, 0, hInst, NULL);
|
||||
}
|
||||
|
||||
if(hWnd == NULL){
|
||||
MessageBox(NULL, "Failed to create the window.", NULL, MB_OK | MB_ICONERROR);
|
||||
return ERROR_WINDOW_CREATE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Window/Window.hpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Window {
|
||||
int Initialize();
|
||||
void Shutdown();
|
||||
|
||||
extern unsigned Width, Height;
|
||||
extern bool Fullscreen;
|
||||
extern HWND hWnd;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
#define VERSION_A 0
|
||||
#define VERSION_B 0
|
||||
#define VERSION_C 0
|
||||
#define VERSION_D 0
|
||||
|
||||
//You don't have to touch the following
|
||||
#define xstr(x) str(x)
|
||||
#define str(x) #x //Yes, double levels is required. See <http://gcc.gnu.org/onlinedocs/cpp/Stringification.html>
|
||||
#define VERSIONSTR "" \
|
||||
xstr(VERSION_A) "." xstr(VERSION_B) "." xstr(VERSION_C) "." xstr(VERSION_D)
|
|
@ -1,11 +0,0 @@
|
|||
if(WIN32)
|
||||
set(GLDEMO_EXE WIN32)
|
||||
set(GLDEMO_LIBS mingw32 libgldemo_static opengl32 glu32)
|
||||
else()
|
||||
set(GLDEMO_EXE "")
|
||||
set(GLDEMO_LIBS libgldemo_static Xxf86vm rt Xext X11 GL GLU)
|
||||
endif()
|
||||
|
||||
add_subdirectory(FileHandler)
|
||||
add_subdirectory(libgldemo)
|
||||
add_subdirectory(libvitaboy)
|
|
@ -1,52 +0,0 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
project(FileHandler)
|
||||
|
||||
set(FILEHANDLER_SERIES 0)
|
||||
set(FILEHANDLER_MAJOR 0)
|
||||
set(FILEHANDLER_MINOR 0)
|
||||
|
||||
if(64BIT)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic")
|
||||
endif()
|
||||
|
||||
add_subdirectory(far)
|
||||
add_subdirectory(iff)
|
||||
add_subdirectory(utk)
|
||||
add_subdirectory(xa)
|
||||
|
||||
set(FILEHANDLER_SOURCES
|
||||
Audio.cpp
|
||||
File.cpp
|
||||
Image.cpp
|
||||
bmp/read_bmp.c
|
||||
cst/cst.c
|
||||
utk/read_utk.c
|
||||
wav/read_wav.c
|
||||
xa/read_xa.c
|
||||
)
|
||||
if(WIN32)
|
||||
set(FILEHANDLER_SOURCES ${FILEHANDLER_SOURCES} resource.rc)
|
||||
endif()
|
||||
|
||||
include_directories(${FILEHANDLER_INCLUDE} ${LIBMPG123_INCLUDE} ${LIBJPEGTURBO_INCLUDE} ${LIBPNG_INCLUDE})
|
||||
|
||||
#### Static library (uncomment to build)
|
||||
#add_library(FileHandler_static STATIC ${FILEHANDLER_SOURCES})
|
||||
#set_target_properties(FileHandler_static PROPERTIES
|
||||
# OUTPUT_NAME "FileHandler${FILEHANDLER_SERIES}"
|
||||
# PREFIX ""
|
||||
# CLEAN_DIRECT_OUTPUT 1)
|
||||
|
||||
add_library(FileHandler_shared SHARED ${FILEHANDLER_SOURCES})
|
||||
if(WIN32)
|
||||
set_target_properties(FileHandler_shared PROPERTIES OUTPUT_NAME "FileHandler${FILEHANDLER_SERIES}")
|
||||
else()
|
||||
set_target_properties(FileHandler_shared PROPERTIES OUTPUT_NAME "FileHandler")
|
||||
endif()
|
||||
set_target_properties(FileHandler_shared PROPERTIES
|
||||
VERSION ${FILEHANDLER_SERIES}.${FILEHANDLER_MAJOR}.${FILEHANDLER_MINOR}
|
||||
PREFIX ""
|
||||
IMPORT_PREFIX ""
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
|
||||
target_link_libraries(FileHandler_shared far_static iff_static ${LIBJPEG_LINK} ${LIBMPG123_LINK} ${LIBPNG_LINK} ${ZLIB_LINK} m)
|
|
@ -1,265 +0,0 @@
|
|||
/*
|
||||
FileHandler - General-purpose file handling library for Niotso
|
||||
Image.cpp - Copyright (c) 2011-2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "FileHandler.hpp"
|
||||
#include <jpeglib.h>
|
||||
#include <jerror.h>
|
||||
#include <png.h>
|
||||
#include <setjmp.h> //Used for libpng
|
||||
#include "bmp/read_bmp.h"
|
||||
|
||||
namespace File {
|
||||
|
||||
enum ImageType {
|
||||
FIMG_BMP,
|
||||
FIMG_JPEG,
|
||||
FIMG_PNG,
|
||||
FIMG_TGACUR,
|
||||
FIMG_COUNT
|
||||
};
|
||||
|
||||
static uint8_t * ReadJPG(Image_t * Image, const uint8_t * InData, size_t FileSize);
|
||||
static uint8_t * ReadBMP(Image_t * Image, const uint8_t * InData, size_t FileSize);
|
||||
static uint8_t * ReadPNG(Image_t * Image, const uint8_t * InData, size_t FileSize);
|
||||
static uint8_t * ReadTGA(Image_t * Image, const uint8_t * InData, size_t FileSize);
|
||||
static uint8_t * ReadCUR(Image_t * Image, const uint8_t * InData, size_t FileSize);
|
||||
|
||||
static uint8_t * ReadTGACUR(Image_t * Image, const uint8_t * InData, size_t FileSize){
|
||||
//Microsoft and Truevision, y u no more creative with your file signatures?
|
||||
//In many cases we're going to see these bytes, exactly, at the beginning in both formats:
|
||||
//00 00 02 00 01 00
|
||||
//So screw it. Try parsing the file first as a TGA, then as a CUR.
|
||||
|
||||
uint8_t * Result = ReadTGA(Image, InData, FileSize);
|
||||
return Result ? Result : ReadCUR(Image, InData, FileSize);
|
||||
}
|
||||
|
||||
static const uint8_t Signature[] = {
|
||||
'B', //BMP
|
||||
0xFF, //JPEG
|
||||
0x89, //PNG
|
||||
0x00 //TGA or CUR
|
||||
};
|
||||
static uint8_t* (* const ImageFunction[])(Image_t*, const uint8_t*, size_t) = {
|
||||
ReadBMP,
|
||||
ReadJPG,
|
||||
ReadPNG,
|
||||
ReadTGACUR
|
||||
};
|
||||
|
||||
Image_t * ReadImageFile(const char * Filename){
|
||||
uint8_t * InData = File::ReadFile(Filename);
|
||||
if(InData == NULL) return NULL;
|
||||
|
||||
if(File::FileSize < 4){
|
||||
free(InData);
|
||||
File::Error = FERR_INVALIDDATA;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Image_t * Image = (Image_t*) malloc(sizeof(Image_t));
|
||||
if(Image == NULL){
|
||||
free(InData);
|
||||
File::Error = FERR_MEMORY;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for(int i=0; i<FIMG_COUNT; i++){
|
||||
if(InData[0] == Signature[i]){
|
||||
uint8_t * OutData = ImageFunction[i](Image, InData, File::FileSize);
|
||||
free(InData);
|
||||
if(OutData == NULL){
|
||||
File::Error = FERR_INVALIDDATA;
|
||||
return NULL;
|
||||
}
|
||||
return Image;
|
||||
}
|
||||
}
|
||||
|
||||
free(InData);
|
||||
File::Error = FERR_UNRECOGNIZED;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static uint8_t * ReadBMP(Image_t * Image, const uint8_t * InData, size_t FileSize){
|
||||
bmpheader_t BMPHeader;
|
||||
if(!bmp_read_header(&BMPHeader, InData, FileSize)){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint8_t * OutData = (uint8_t*) malloc(BMPHeader.DecompressedSize);
|
||||
if(OutData == NULL){
|
||||
return NULL;
|
||||
}
|
||||
if(!bmp_read_data(&BMPHeader, InData, OutData)){
|
||||
free(OutData);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Image->Width = BMPHeader.biWidth;
|
||||
Image->Height = BMPHeader.biHeight;
|
||||
Image->Format = FIMG_BGR24;
|
||||
Image->Data = OutData;
|
||||
return OutData;
|
||||
}
|
||||
|
||||
|
||||
// libjpeg-turbo v6 doesn't support jpeg_mem_src, so we have to implement it here
|
||||
static void term_source(j_decompress_ptr){}
|
||||
static int fill_mem_input_buffer(j_decompress_ptr cinfo){
|
||||
ERREXIT(cinfo, JERR_FILE_READ);
|
||||
return FALSE;
|
||||
}
|
||||
static void skip_input_data(j_decompress_ptr cinfo, long bytes)
|
||||
{
|
||||
jpeg_source_mgr * src = cinfo->src;
|
||||
|
||||
if(bytes > (long) src->bytes_in_buffer){
|
||||
ERREXIT(cinfo, JERR_FILE_READ);
|
||||
return;
|
||||
}
|
||||
src->next_input_byte += bytes;
|
||||
src->bytes_in_buffer -= bytes;
|
||||
}
|
||||
static uint8_t * ReadJPG(Image_t * Image, const uint8_t * InData, size_t FileSize){
|
||||
//Initialize
|
||||
jpeg_decompress_struct cinfo;
|
||||
jpeg_error_mgr jerr;
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
jpeg_create_decompress(&cinfo);
|
||||
|
||||
if (cinfo.src == NULL)
|
||||
cinfo.src = (jpeg_source_mgr *)
|
||||
(*cinfo.mem->alloc_small)((j_common_ptr) &cinfo, JPOOL_PERMANENT, sizeof(jpeg_source_mgr));
|
||||
|
||||
jpeg_source_mgr *src = cinfo.src;
|
||||
src->init_source = term_source;
|
||||
src->fill_input_buffer = fill_mem_input_buffer;
|
||||
src->skip_input_data = skip_input_data;
|
||||
src->resync_to_restart = jpeg_resync_to_restart;
|
||||
src->term_source = term_source;
|
||||
src->bytes_in_buffer = FileSize;
|
||||
src->next_input_byte = InData;
|
||||
|
||||
if(jpeg_read_header(&cinfo, TRUE) != JPEG_HEADER_OK){
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
return NULL;
|
||||
}
|
||||
cinfo.out_color_space = JCS_EXT_BGR;
|
||||
if(!jpeg_start_decompress(&cinfo)){
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//Read
|
||||
unsigned row_stride = cinfo.output_width * cinfo.output_components;
|
||||
uint8_t * OutData = (uint8_t*) malloc(cinfo.output_width * cinfo.output_height * cinfo.output_components);
|
||||
if(OutData == NULL){
|
||||
jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
return NULL;
|
||||
}
|
||||
for(unsigned i=cinfo.output_height; i; i--){
|
||||
//According to the libjpeg documentation,
|
||||
//jpeg_read_scanlines can only really read 1 scanline at a time.
|
||||
//We need to convert to bottom-up format anyway.
|
||||
uint8_t * Location = OutData + (i-1)*row_stride;
|
||||
if(!jpeg_read_scanlines(&cinfo, &Location, 1)){
|
||||
free(OutData);
|
||||
jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//Close up
|
||||
jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
if(Image){
|
||||
Image->Width = cinfo.output_width;
|
||||
Image->Height = cinfo.output_height;
|
||||
Image->Format = FIMG_BGR24;
|
||||
Image->Data = OutData;
|
||||
}
|
||||
return OutData;
|
||||
}
|
||||
|
||||
struct pngdata_t {
|
||||
const uint8_t * buffer;
|
||||
size_t size;
|
||||
};
|
||||
static void user_read_data(png_structp png_ptr, png_bytep data, png_size_t length){
|
||||
pngdata_t *pngdata = (pngdata_t *) png_get_io_ptr(png_ptr);
|
||||
if(length > pngdata->size) png_error(png_ptr, "");
|
||||
memcpy(data, pngdata->buffer, length);
|
||||
pngdata->buffer += length;
|
||||
pngdata->size -= length;
|
||||
}
|
||||
static uint8_t * ReadPNG(Image_t * Image, const uint8_t * InData, size_t FileSize){
|
||||
pngdata_t pngdata;
|
||||
|
||||
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
if(png_ptr == NULL) return 0;
|
||||
png_infop info_ptr = png_create_info_struct(png_ptr);
|
||||
if(info_ptr == NULL){
|
||||
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
||||
return NULL;
|
||||
}
|
||||
if(setjmp(png_jmpbuf(png_ptr))){
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pngdata.buffer = InData;
|
||||
pngdata.size = FileSize;
|
||||
png_set_read_fn(png_ptr, &pngdata, user_read_data);
|
||||
png_set_user_limits(png_ptr, 4096, 4096);
|
||||
png_read_png(png_ptr, info_ptr,
|
||||
PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_STRIP_ALPHA |
|
||||
PNG_TRANSFORM_PACKING | PNG_TRANSFORM_GRAY_TO_RGB | PNG_TRANSFORM_BGR, NULL);
|
||||
|
||||
//png_get_IHDR does not work in high-level mode.
|
||||
unsigned width = png_get_image_width(png_ptr, info_ptr);
|
||||
unsigned height = png_get_image_height(png_ptr, info_ptr);
|
||||
uint8_t * OutData = (uint8_t *) malloc(width*height*3);
|
||||
if(OutData == NULL){
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint8_t **Scanlines = png_get_rows(png_ptr, info_ptr);
|
||||
for(unsigned i=0; i<height; i++)
|
||||
memcpy(OutData + i*width*3, Scanlines[height-i-1], width*3);
|
||||
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
Image->Width = width;
|
||||
Image->Height = height;
|
||||
Image->Format = FIMG_BGR24;
|
||||
Image->Data = OutData;
|
||||
return OutData;
|
||||
}
|
||||
|
||||
static uint8_t * ReadTGA(Image_t * Image, const uint8_t * InData, size_t FileSize){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static uint8_t * ReadCUR(Image_t * Image, const uint8_t * InData, size_t FileSize){
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
FileHandler - General-purpose file handling library for Niotso
|
||||
read_cur.h - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
|
@ -1,22 +0,0 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
project(far)
|
||||
|
||||
set(FAR_SOURCES
|
||||
far.c
|
||||
refpack_dec.c
|
||||
)
|
||||
|
||||
add_library(far_static STATIC ${FAR_SOURCES})
|
||||
set_target_properties(far_static PROPERTIES
|
||||
OUTPUT_NAME "far"
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
|
||||
#### Shared library (uncomment to build)
|
||||
#add_library(far_shared SHARED ${FAR_SOURCES})
|
||||
#set_target_properties(far_shared PROPERTIES
|
||||
# OUTPUT_NAME "far"
|
||||
# PREFIX ""
|
||||
# CLEAN_DIRECT_OUTPUT 1)
|
||||
|
||||
add_executable(farextract farextract.c)
|
||||
target_link_libraries(farextract far_static)
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
FileHandler - General-purpose file handling library for Niotso
|
||||
hit.c - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
FileHandler - General-purpose file handling library for Niotso
|
||||
hot.c - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
FileHandler - General-purpose file handling library for Niotso
|
||||
hsm.c - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
|
@ -1,37 +0,0 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
project(iff)
|
||||
|
||||
set(IFF_SOURCES
|
||||
bhav.c
|
||||
cats.c
|
||||
iff.c
|
||||
bcon.c
|
||||
dgrp.c
|
||||
fcns.c
|
||||
glob.c
|
||||
objf.c
|
||||
palt.c
|
||||
rsmp.c
|
||||
spr.c
|
||||
spr2.c
|
||||
str.c
|
||||
string.c
|
||||
tmpl.c
|
||||
trcn.c
|
||||
)
|
||||
|
||||
add_library(iff_static STATIC ${IFF_SOURCES})
|
||||
set_target_properties(iff_static PROPERTIES
|
||||
OUTPUT_NAME "iff"
|
||||
PREFIX ""
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
|
||||
#### Shared library (uncomment to build)
|
||||
#add_library(iff_shared SHARED ${IFF_SOURCES})
|
||||
#set_target_properties(iff_shared PROPERTIES
|
||||
# OUTPUT_NAME "iff"
|
||||
# PREFIX ""
|
||||
# CLEAN_DIRECT_OUTPUT 1)
|
||||
|
||||
add_executable(iffexport iffexport.c)
|
||||
target_link_libraries(iffexport iff_static)
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
FileHandler - General-purpose file handling library for Niotso
|
||||
read_ini.c - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
Binary file not shown.
|
@ -1,93 +0,0 @@
|
|||
* Elf32_Word sh_name:
|
||||
* Elf32_Word sh_type:
|
||||
* Elf32_Word sh_flags:
|
||||
* Elf32_Addr sh_addr:
|
||||
* Elf32_Off sh_offset: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_size: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_link:
|
||||
* Elf32_Word sh_info:
|
||||
* Elf32_Word sh_addralign: 1 (01 00 00 00)
|
||||
* Elf32_Word sh_entsize:
|
||||
|
||||
ELF Header:
|
||||
* e_ident:
|
||||
* Elf32_Word EI_MAG0: (7F 45 4C 46)
|
||||
* unsigned char EI_CLASS: ELFCLASS32 (01)
|
||||
* unsigned char EI_DATA: ELFDATA2LSB (01)
|
||||
* unsigned char EI_VERSION: EV_CURRENT (01)
|
||||
* unsigned char EI_PAD[9]: (00 00 00 00 00 00 00 00 00)
|
||||
* Elf32_Half e_type: ET_REL (01 00)
|
||||
* Elf32_Half e_machine: EM_NONE (00 00)
|
||||
* Elf32_Word e_version: EV_CURRENT (01 00 00 00)
|
||||
* Elf32_Addr e_entry: 0 (00 00 00 00)
|
||||
* Elf32_Off e_phoff: 0 (00 00 00 00)
|
||||
* Elf32_Off e_shoff: 64 (40 00 00 00)
|
||||
* Elf32_Word e_flags: 0x00000001 (01 00 00 00)
|
||||
* Elf32_Half e_ehsize: 52 (34 00)
|
||||
* Elf32_Half e_phentsize: 0 (00 00)
|
||||
* Elf32_Half e_phnum: 0 (00 00)
|
||||
* Elf32_Half e_shentsize: 40 (28 00)
|
||||
* Elf32_Half e_shnum: 6 (06 00)
|
||||
* Elf32_Half e_shstrndx: 2 (02 00)
|
||||
* unsigned char padding[12] = (00 00 00 00 00 00 00 00 00 00 00 00)
|
||||
|
||||
Section headers
|
||||
0 (""): All 0s
|
||||
1 (".text"):
|
||||
* Elf32_Word sh_name: 1 (01 00 00 00)
|
||||
* Elf32_Word sh_type: SHT_PROGBITS (01 00 00 00)
|
||||
* Elf32_Word sh_flags: SHF_ALLOC | SHF_EXECINSTR (06 00 00 00)
|
||||
* Elf32_Addr sh_addr: 0x00000010 (10 00 00 00)
|
||||
* Elf32_Off sh_offset: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_size: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_link: 0 (00 00 00 00)
|
||||
* Elf32_Word sh_info: 0 (00 00 00 00)
|
||||
* Elf32_Word sh_addralign: 1 (01 00 00 00)
|
||||
* Elf32_Word sh_entsize: 0 (00 00 00 00)
|
||||
2 (".shstrtab"):
|
||||
* Elf32_Word sh_name: 7 (07 00 00 00)
|
||||
* Elf32_Word sh_type: SHT_STRTAB (03 00 00 00)
|
||||
* Elf32_Word sh_flags: 0 (00 00 00 00)
|
||||
* Elf32_Addr sh_addr: 0 (00 00 00 00)
|
||||
* Elf32_Off sh_offset: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_size: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_link: 0 (00 00 00 00)
|
||||
* Elf32_Word sh_info: 0 (00 00 00 00)
|
||||
* Elf32_Word sh_addralign: 1 (01 00 00 00)
|
||||
* Elf32_Word sh_entsize: 0 (00 00 00 00)
|
||||
3 (".symtab"):
|
||||
* Elf32_Word sh_name: 17 (11 00 00 00)
|
||||
* Elf32_Word sh_type: SHT_SYMTAB (02 00 00 00)
|
||||
* Elf32_Word sh_flags: 0 (00 00 00 00)
|
||||
* Elf32_Addr sh_addr: 0 (00 00 00 00)
|
||||
* Elf32_Off sh_offset: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_size: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_link: 4 (04 00 00 00)
|
||||
* Elf32_Word sh_info: 5 (05 00 00 00)
|
||||
* Elf32_Word sh_addralign: 1 (01 00 00 00)
|
||||
* Elf32_Word sh_entsize: 16 (10 00 00 00)
|
||||
4 (".strtab"):
|
||||
* Elf32_Word sh_name: 25 (19 00 00 00)
|
||||
* Elf32_Word sh_type: SHT_STRTAB (03 00 00 00)
|
||||
* Elf32_Word sh_flags: 0 (00 00 00 00)
|
||||
* Elf32_Addr sh_addr: 0 (00 00 00 00)
|
||||
* Elf32_Off sh_offset: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_size: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_link: 0 (00 00 00 00)
|
||||
* Elf32_Word sh_info: 0 (00 00 00 00)
|
||||
* Elf32_Word sh_addralign: 1 (01 00 00 00)
|
||||
* Elf32_Word sh_entsize: 0 (00 00 00 00)
|
||||
5 (".rel.text"):
|
||||
* Elf32_Word sh_name: 33 (21 00 00 00)
|
||||
* Elf32_Word sh_type: SHT_REL (09 00 00 00)
|
||||
* Elf32_Word sh_flags: 0 (00 00 00 00)
|
||||
* Elf32_Addr sh_addr: 0 (00 00 00 00)
|
||||
* Elf32_Off sh_offset: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_size: (?? ?? ?? ??)
|
||||
* Elf32_Word sh_link: 3 (03 00 00 00)
|
||||
* Elf32_Word sh_info: 1 (01 00 00 00)
|
||||
* Elf32_Word sh_addralign: 1 (01 00 00 00)
|
||||
* Elf32_Word sh_entsize: 8 (08 00 00 00)
|
||||
|
||||
Symbols:
|
||||
0: All 0s
|
|
@ -1,461 +0,0 @@
|
|||
/*
|
||||
hitutils - The Sims HIT (dis)assembler and linker
|
||||
hitutils.h - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef min
|
||||
#define min(x,y) ((x) < (y) ? (x) : (y))
|
||||
#endif
|
||||
#ifndef max
|
||||
#define max(x,y) ((x) > (y) ? (x) : (y))
|
||||
#endif
|
||||
|
||||
#ifndef read_int32
|
||||
#define read_uint32(x) (unsigned)(((x)[0]<<(8*0)) | ((x)[1]<<(8*1)) | ((x)[2]<<(8*2)) | ((x)[3]<<(8*3)))
|
||||
#define read_uint16(x) (unsigned)(((x)[0]<<(8*0)) | ((x)[1]<<(8*1)))
|
||||
#endif
|
||||
|
||||
#ifndef write_int32
|
||||
#define write_uint32(dest, src) do {\
|
||||
(dest)[0] = ((src)&0x000000FF)>>(8*0); \
|
||||
(dest)[1] = ((src)&0x0000FF00)>>(8*1); \
|
||||
(dest)[2] = ((src)&0x00FF0000)>>(8*2); \
|
||||
(dest)[3] = ((src)&0xFF000000)>>(8*3); \
|
||||
} while(0)
|
||||
#define write_uint16(dest, src) do {\
|
||||
(dest)[0] = ((src)&0x00FF)>>(8*0); \
|
||||
(dest)[1] = ((src)&0xFF00)>>(8*1); \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
extern char *strdup (const char *__s)
|
||||
__THROW __attribute_malloc__ __nonnull ((1));
|
||||
|
||||
static void Shutdown();
|
||||
|
||||
static void Shutdown_M(const char * Message, ...){
|
||||
va_list args;
|
||||
va_start(args, Message);
|
||||
vfprintf(stderr, Message, args);
|
||||
va_end(args);
|
||||
|
||||
Shutdown();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
enum {
|
||||
VERSION_TS1 = 1, VERSION_TSO
|
||||
};
|
||||
|
||||
#define OPERAND_BYTES(x) (x)
|
||||
#define OPERAND(x, y) ((y)<<((x)*4+4))
|
||||
#define UNIMPLEMENTED ((uint32_t)~0)
|
||||
|
||||
enum operand_t {
|
||||
o_byte = 1,
|
||||
o_dword,
|
||||
o_address,
|
||||
o_variable,
|
||||
o_jump
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
const char * Name;
|
||||
uint32_t Operands;
|
||||
} instruction_t;
|
||||
|
||||
typedef struct {
|
||||
const char * Name;
|
||||
uint32_t Value;
|
||||
} variable_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t * Data;
|
||||
size_t Size;
|
||||
} ByteReaderContext;
|
||||
|
||||
static const uint8_t HITHeader[] = {'H','I','T','!',0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,'T','R','A','X'};
|
||||
|
||||
#define InstructionCount 96
|
||||
static const instruction_t Instructions[] = {
|
||||
{"note", UNIMPLEMENTED},
|
||||
{"note_on", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"note_off", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"loadb", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_byte)},
|
||||
{"loadl", OPERAND_BYTES(5) | OPERAND(0, o_variable) | OPERAND(1, o_dword)},
|
||||
{"set", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"call", OPERAND_BYTES(4) | OPERAND(0, o_address)},
|
||||
{"return", OPERAND_BYTES(0)},
|
||||
{"wait", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"callentrypoint", UNIMPLEMENTED},
|
||||
{"wait_samp", OPERAND_BYTES(0)},
|
||||
{"end", OPERAND_BYTES(0)},
|
||||
{"jump", OPERAND_BYTES(1) | OPERAND(0, o_jump)},
|
||||
{"test", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"nop", OPERAND_BYTES(0)},
|
||||
{"add", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"sub", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"div", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"mul", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"cmp", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"less", UNIMPLEMENTED},
|
||||
{"greater", UNIMPLEMENTED},
|
||||
{"not", UNIMPLEMENTED},
|
||||
{"rand", OPERAND_BYTES(3) | OPERAND(0, o_variable) | OPERAND(1, o_variable) | OPERAND(2, o_variable)},
|
||||
{"abs", UNIMPLEMENTED},
|
||||
{"limit", UNIMPLEMENTED},
|
||||
{"error", UNIMPLEMENTED},
|
||||
{"assert", UNIMPLEMENTED},
|
||||
{"add_to_group", UNIMPLEMENTED},
|
||||
{"remove_from_group", UNIMPLEMENTED},
|
||||
{"get_var", UNIMPLEMENTED},
|
||||
{"loop", OPERAND_BYTES(0)},
|
||||
{"set_loop", OPERAND_BYTES(0)},
|
||||
{"callback", UNIMPLEMENTED},
|
||||
{"smart_add", UNIMPLEMENTED},
|
||||
{"smart_remove", UNIMPLEMENTED},
|
||||
{"smart_removeall", UNIMPLEMENTED},
|
||||
{"smart_setcrit", UNIMPLEMENTED},
|
||||
{"smart_choose", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"and", UNIMPLEMENTED},
|
||||
{"nand", UNIMPLEMENTED},
|
||||
{"or", UNIMPLEMENTED},
|
||||
{"nor", UNIMPLEMENTED},
|
||||
{"xor", UNIMPLEMENTED},
|
||||
{"max", OPERAND_BYTES(5) | OPERAND(0, o_variable) | OPERAND(1, o_dword)},
|
||||
{"min", OPERAND_BYTES(5) | OPERAND(0, o_variable) | OPERAND(1, o_dword)},
|
||||
{"inc", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"dec", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"printreg", UNIMPLEMENTED},
|
||||
{"play_trk", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"kill_trk", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"push", UNIMPLEMENTED},
|
||||
{"push_mask", UNIMPLEMENTED},
|
||||
{"push_vars", UNIMPLEMENTED},
|
||||
{"call_mask", UNIMPLEMENTED},
|
||||
{"call_push", UNIMPLEMENTED},
|
||||
{"pop", UNIMPLEMENTED},
|
||||
{"test1", OPERAND_BYTES(0)},
|
||||
{"test2", OPERAND_BYTES(0)},
|
||||
{"test3", OPERAND_BYTES(0)},
|
||||
{"test4", OPERAND_BYTES(0)},
|
||||
{"ifeq", OPERAND_BYTES(4) | OPERAND(0, o_address)},
|
||||
{"ifne", OPERAND_BYTES(4) | OPERAND(0, o_address)},
|
||||
{"ifgt", OPERAND_BYTES(4) | OPERAND(0, o_address)},
|
||||
{"iflt", OPERAND_BYTES(4) | OPERAND(0, o_address)},
|
||||
{"ifge", OPERAND_BYTES(4) | OPERAND(0, o_address)},
|
||||
{"ifle", OPERAND_BYTES(4) | OPERAND(0, o_address)},
|
||||
{"smart_setlist", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"seqgroup_kill", OPERAND_BYTES(1) | OPERAND(0, o_byte)},
|
||||
{"seqgroup_wait", UNIMPLEMENTED},
|
||||
{"seqgroup_return", OPERAND_BYTES(1) | OPERAND(0, o_byte)},
|
||||
{"getsrcdatafield", OPERAND_BYTES(3) | OPERAND(0, o_variable) | OPERAND(1, o_variable) | OPERAND(2, o_variable)},
|
||||
{"seqgroup_trkid", OPERAND_BYTES(2) | OPERAND(0, o_byte) | OPERAND(1, o_byte)},
|
||||
{"setll", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"setlt", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"settl", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"waiteq", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"waitne", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"waitgt", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"waitlt", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"waitge", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"waitle", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"duck", OPERAND_BYTES(0)},
|
||||
{"unduck", OPERAND_BYTES(0)},
|
||||
{"testx", UNIMPLEMENTED},
|
||||
{"setlg", OPERAND_BYTES(5) | OPERAND(0, o_variable) | OPERAND(1, o_dword)},
|
||||
{"setgl", OPERAND_BYTES(5) | OPERAND(0, o_variable) | OPERAND(1, o_dword)},
|
||||
{"throw", UNIMPLEMENTED},
|
||||
{"setsrcdatafield", OPERAND_BYTES(3) | OPERAND(0, o_variable) | OPERAND(1, o_variable) | OPERAND(2, o_variable)},
|
||||
{"stop_trk", OPERAND_BYTES(1) | OPERAND(0, o_variable)},
|
||||
{"setchanreg", UNIMPLEMENTED},
|
||||
{"play_note", UNIMPLEMENTED},
|
||||
{"stop_note", UNIMPLEMENTED},
|
||||
{"kill_note", UNIMPLEMENTED},
|
||||
{"smart_index", OPERAND_BYTES(2) | OPERAND(0, o_variable) | OPERAND(1, o_variable)},
|
||||
{"note_on_loop", OPERAND_BYTES(1) | OPERAND(0, o_variable)}
|
||||
};
|
||||
|
||||
#define TSOVariableCount 82
|
||||
static const variable_t TSOVariables[] = {
|
||||
{"arg0", 0x00},
|
||||
{"arg1", 0x01},
|
||||
{"arg2", 0x02},
|
||||
{"arg3", 0x03},
|
||||
{"arg4", 0x04},
|
||||
{"v1", 0x05},
|
||||
{"v2", 0x06},
|
||||
{"v3", 0x07},
|
||||
{"v4", 0x08},
|
||||
{"v5", 0x09},
|
||||
{"v6", 0x0A},
|
||||
{"v7", 0x0B},
|
||||
{"v8", 0x0C},
|
||||
{"h1", 0x0D},
|
||||
{"h2", 0x0E},
|
||||
{"h3", 0x0F},
|
||||
{"argstype", 0x10},
|
||||
{"trackdatasource", 0x11},
|
||||
{"patch", 0x12},
|
||||
{"priority", 0x13},
|
||||
{"vol", 0x14},
|
||||
{"extvol", 0x15},
|
||||
{"pan", 0x16},
|
||||
{"pitch", 0x17},
|
||||
{"paused", 0x18},
|
||||
{"fxtype", 0x19},
|
||||
{"fxlevel", 0x1a},
|
||||
{"duckpri", 0x1b},
|
||||
{"Is3d", 0x1c},
|
||||
{"IsHeadRelative", 0x1d},
|
||||
{"MinDistance", 0x1e},
|
||||
{"MaxDistance", 0x1f},
|
||||
{"X", 0x20},
|
||||
{"Y", 0x21},
|
||||
{"Z", 0x22},
|
||||
{"attack", 0x23},
|
||||
{"decay", 0x24},
|
||||
{"IsStreamed", 0x25},
|
||||
{"bufsizemult", 0x26},
|
||||
{"fade_dest", 0x27},
|
||||
{"fade_var", 0x28},
|
||||
{"fade_speed", 0x29},
|
||||
{"fade_on", 0x2a},
|
||||
{"Preload", 0x2b},
|
||||
{"isplaying", 0x2c},
|
||||
{"whattodowithupdate", 0x2d},
|
||||
{"tempo", 0x2e},
|
||||
{"target", 0x2f},
|
||||
{"ctrlgroup", 0x30},
|
||||
{"interrupt", 0x31},
|
||||
{"ispositioned", 0x32},
|
||||
{"AppObjectId", 0x34},
|
||||
{"callbackarg", 0x35},
|
||||
{"pitchrandmin", 0x36},
|
||||
{"pitchrandmax", 0x37},
|
||||
{"spl", 0x38},
|
||||
{"sem", 0x39},
|
||||
{"starttrackid", 0x3a},
|
||||
{"endtrackid", 0x3b},
|
||||
{"startdelay", 0x3c},
|
||||
{"fadeinspeed", 0x3d},
|
||||
{"fadeoutspeed", 0x3e},
|
||||
{"hitlist", 0x3f},
|
||||
{"SimSpeed", 0x64},
|
||||
{"test_g1", 0x65},
|
||||
{"test_g2", 0x66},
|
||||
{"test_g3", 0x67},
|
||||
{"test_g4", 0x68},
|
||||
{"test_g5", 0x69},
|
||||
{"test_g6", 0x6a},
|
||||
{"test_g7", 0x6b},
|
||||
{"test_g8", 0x6c},
|
||||
{"test_g9", 0x6d},
|
||||
{"main_songnum", 0x6e},
|
||||
{"main_musichitlistid", 0x6f},
|
||||
{"campfire_nexttrack", 0x70},
|
||||
{"campfire_busy", 0x71},
|
||||
{"main_duckpri", 0x7b},
|
||||
{"main_vol", 0x7c},
|
||||
{"main_fxtype", 0x7d},
|
||||
{"main_fxlevel", 0x7e},
|
||||
{"main_pause", 0x7f},
|
||||
};
|
||||
|
||||
#define TS1VariableCount 87
|
||||
static const variable_t TS1Variables[] = {
|
||||
{"arg0", 0x00},
|
||||
{"arg1", 0x01},
|
||||
{"arg2", 0x02},
|
||||
{"arg3", 0x03},
|
||||
{"arg4", 0x04},
|
||||
{"v1", 0x05},
|
||||
{"v2", 0x06},
|
||||
{"v3", 0x07},
|
||||
{"v4", 0x08},
|
||||
{"v5", 0x09},
|
||||
{"v6", 0x0a},
|
||||
{"v7", 0x0b},
|
||||
{"v8", 0x0c},
|
||||
{"h1", 0x0d},
|
||||
{"h2", 0x0e},
|
||||
{"h3", 0x0f},
|
||||
{"priority", 0x11},
|
||||
{"vol", 0x12},
|
||||
{"extvol", 0x13},
|
||||
{"pan", 0x14},
|
||||
{"pitch", 0x15},
|
||||
{"paused", 0x16},
|
||||
{"fxtype", 0x17},
|
||||
{"fxlevel", 0x18},
|
||||
{"duckpri", 0x19},
|
||||
{"Is3d", 0x1a},
|
||||
{"IsHeadRelative", 0x1b},
|
||||
{"MinDistance", 0x1c},
|
||||
{"MaxDistance", 0x1d},
|
||||
{"X", 0x1e},
|
||||
{"Y", 0x1f},
|
||||
{"Z", 0x20},
|
||||
{"filter_type", 0x21},
|
||||
{"filter_cutoff", 0x22},
|
||||
{"filter_level", 0x23},
|
||||
{"attack", 0x24},
|
||||
{"decay", 0x25},
|
||||
{"IsStreamed", 0x26},
|
||||
{"BufSizeMult", 0x27},
|
||||
{"fade_dest", 0x28},
|
||||
{"fade_var", 0x29},
|
||||
{"fade_speed", 0x2a},
|
||||
{"Preload", 0x2b},
|
||||
{"IsLooped", 0x2c},
|
||||
{"fade_on", 0x2d},
|
||||
{"isplaying", 0x2e},
|
||||
{"source", 0x2f},
|
||||
{"patch", 0x32},
|
||||
{"WhatToDoWithUpdate", 0x33},
|
||||
{"tempo", 0x34},
|
||||
{"target", 0x35},
|
||||
{"mutegroup", 0x36},
|
||||
{"interrupt", 0x37},
|
||||
{"IsPositioned", 0x38},
|
||||
{"Spl", 0x39},
|
||||
{"MultipleInstances", 0x3a},
|
||||
{"AssociatedTrack1", 0x3b},
|
||||
{"AssociatedTrack2", 0x3c},
|
||||
{"AssociatedTrack3", 0x3d},
|
||||
{"AssociatedTrack4", 0x3e},
|
||||
{"AssociatedTrack5", 0x3f},
|
||||
{"AssociatedTrack6", 0x40},
|
||||
{"AssociatedTrack7", 0x41},
|
||||
{"AssociatedTrack8", 0x42},
|
||||
{"SimSpeed", 0x64},
|
||||
{"test_g1", 0x65},
|
||||
{"test_g2", 0x66},
|
||||
{"test_g3", 0x67},
|
||||
{"test_g4", 0x68},
|
||||
{"test_g5", 0x69},
|
||||
{"test_g6", 0x6a},
|
||||
{"test_g7", 0x6b},
|
||||
{"test_g8", 0x6c},
|
||||
{"test_g9", 0x6d},
|
||||
{"main_songnum", 0x6e},
|
||||
{"main_musichitlistid", 0x6f},
|
||||
{"campfire_nexttrack", 0x70},
|
||||
{"campfire_busy", 0x71},
|
||||
{"main_duckpri", 0x7b},
|
||||
{"main_vol", 0x7c},
|
||||
{"main_fxtype", 0x7d},
|
||||
{"main_fxlevel", 0x7e},
|
||||
{"main_pause", 0x7f},
|
||||
};
|
||||
|
||||
#define ConstantCount 72
|
||||
static const variable_t Constants[] = {
|
||||
{"duckpri_always", 0x0},
|
||||
{"duckpri_low", 0xa},
|
||||
{"duckpri_normal", 0x14},
|
||||
{"duckpri_high", 0x1e},
|
||||
{"duckpri_higher", 0x28},
|
||||
{"duckpri_evenhigher", 0x32},
|
||||
{"duckpri_never", 0x64},
|
||||
{"spl_infinite", 0x0},
|
||||
{"spl_loud", 0xa},
|
||||
{"spl_normal", 0x14},
|
||||
{"spl_quiet", 0x64},
|
||||
{"Instance", 0x0},
|
||||
{"Gender", 0x1},
|
||||
{"GroupMusic", 0x1},
|
||||
{"GroupDialogMain", 0x2},
|
||||
{"GroupDialogOverlay", 0x3},
|
||||
{"PchDishwasherClose", 0x32},
|
||||
{"PchDishwasherLoad", 0x33},
|
||||
{"PchDishwasherLoad2", 0x34},
|
||||
{"PchDishwasherOpen", 0x35},
|
||||
{"PchDishwasherTurnDial", 0x39},
|
||||
{"PchDishwasherTurnDial2", 0x3a},
|
||||
{"TrkRadioStationCountry", 0x104},
|
||||
{"TrkRadioStationBossaNova", 0x10e},
|
||||
{"TrkRadioStationClassical", 0x10d},
|
||||
{"TrkRadioStationRock", 0x118},
|
||||
{"kSndobPlay", 1},
|
||||
{"kSndobStop", 2},
|
||||
{"kSndobKill", 3},
|
||||
{"kSndobUpdate", 4},
|
||||
{"kSndobSetVolume", 5},
|
||||
{"kSndobSetPitch", 6},
|
||||
{"kSndobSetPan", 7},
|
||||
{"kSndobSetPosition", 8},
|
||||
{"kSndobSetFxType", 9},
|
||||
{"kSndobSetFxLevel", 10},
|
||||
{"kSndobPause", 11},
|
||||
{"kSndobUnpause", 12},
|
||||
{"kSndobLoad", 13},
|
||||
{"kSndobUnload", 14},
|
||||
{"kSndobCache", 15},
|
||||
{"kSndobUncache", 16},
|
||||
{"kSndobCancelNote", 19},
|
||||
{"kPlayPiano", 43},
|
||||
{"kSetMusicMode", 36},
|
||||
{"kLive", 0},
|
||||
{"kBuy", 1},
|
||||
{"kBuild", 2},
|
||||
{"kHood", 3},
|
||||
{"kFrontEnd", 4},
|
||||
{"kGroupSfx", 1},
|
||||
{"kGroupMusic", 2},
|
||||
{"kGroupVox", 3},
|
||||
{"kAction", 1000},
|
||||
{"kComedy", 1001},
|
||||
{"kRomance", 1002},
|
||||
{"kNews", 1003},
|
||||
{"kCountry", 1004},
|
||||
{"kRock", 1005},
|
||||
{"kJazz", 1006},
|
||||
{"kClassical", 1007},
|
||||
{"kArgsNormal", 0},
|
||||
{"kArgsVolPan", 1},
|
||||
{"kArgsIdVolPan", 2},
|
||||
{"kArgsXYZ", 3},
|
||||
{"kKillAll", 20},
|
||||
{"kPause", 21},
|
||||
{"kUnpause", 22},
|
||||
{"kKillInstance", 23},
|
||||
{"kTurnOnTv", 30},
|
||||
{"kTurnOffTv", 31},
|
||||
{"kUpdateSourceVolPan", 32},
|
||||
};
|
||||
|
||||
static const uint8_t ObjectHeader[] = {
|
||||
0x7F, 0x45, 0x4C, 0x46, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00,
|
||||
0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00
|
||||
};
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
FileHandler - General-purpose file handling library for Niotso
|
||||
read_tga.c - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include "read_tga.h"
|
||||
|
||||
#ifndef read_uint32
|
||||
#define read_uint32(x) (unsigned)(((x)[0]<<(8*0)) | ((x)[1]<<(8*1)) | ((x)[2]<<(8*2)) | ((x)[3]<<(8*3)))
|
||||
#define read_uint16(x) (unsigned)(((x)[0]<<(8*0)) | ((x)[1]<<(8*1)))
|
||||
#endif
|
||||
|
||||
int tga_read_header(tgaheader_t * TGAHeader, const uint8_t * Buffer, size_t FileSize){
|
||||
unsigned padding;
|
||||
if(FileSize < ?) return 0;
|
||||
TGAHeader->IDLength = read_uint8(Buffer);
|
||||
TGAHeader->ColorMapType = read_uint8(Buffer+1);
|
||||
TGAHeader->ImageType = read_uint8(Buffer+2);
|
||||
|
||||
/* Color map */
|
||||
TGAHeader->FirstEntry = read_uint16(Buffer+3);
|
||||
TGAHeader->ColorMapLength = read_uint16(Buffer+5);
|
||||
TGAHeader->EntrySize = read_uint8(Buffer+7);
|
||||
|
||||
/* Image */
|
||||
TGAHeader->XOrigin = read_uint16(Buffer+8);
|
||||
TGAHeader->YOrigin = read_uint16(Buffer+10);
|
||||
TGAHeader->Width = read_uint16(Buffer+12);
|
||||
TGAHeader->Height = read_uint16(Buffer+14);
|
||||
TGAHeader->ImageDepth = read_uint8(Buffer+16);
|
||||
TGAHeader->Descriptor = read_uint8(Buffer+17);
|
||||
|
||||
return 1;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
FileHandler - General-purpose file handling library for Niotso
|
||||
read_tga.h - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
File diff suppressed because it is too large
Load diff
|
@ -1 +0,0 @@
|
|||
Fatbag <X-Fi6@phppoll.org>
|
|
@ -1 +0,0 @@
|
|||
Fatbag <X-Fi6@phppoll.org>
|
|
@ -1,2 +0,0 @@
|
|||
Technical Preview 1
|
||||
* Initial release
|
|
@ -1,11 +0,0 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
project(NiotsoServer)
|
||||
|
||||
if(WIN32)
|
||||
else()
|
||||
set(NIOTSOSERVER_SOURCES
|
||||
Server.cpp
|
||||
)
|
||||
add_executable(niotsod-vanilla ${NIOTSOSERVER_SOURCES})
|
||||
target_link_libraries(niotsod-vanilla)
|
||||
endif()
|
642
Server/COPYING
642
Server/COPYING
|
@ -1,642 +0,0 @@
|
|||
IMPORTANT:
|
||||
Niotso is distributed under the terms of the GNU GPLv3.
|
||||
|
||||
While this license does permit others to compile, distribute, change,
|
||||
and distribute changes to Niotso, in reality, many of these freedoms
|
||||
cannot legally be enacted by anybody.
|
||||
|
||||
Specifically, if you make changes to Niotso such that it significantly
|
||||
changes the "game experience as presented to the player", it cannot
|
||||
be distributed to others. You also may not distribute a version of
|
||||
Niotso that has stripped the EA or Maxis trademarked names or logos
|
||||
anywhere from the game. Personal use of these modifications is okay.
|
||||
|
||||
These restrictions are not enforced by us, but may potentially be used
|
||||
by EA in attempt to take down your game.
|
||||
|
||||
If you have any questions, you may visit
|
||||
<http://wiki.niotso.org/Niotso/Legal_Summary>
|
||||
|
||||
---
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
|
@ -1,177 +0,0 @@
|
|||
/*
|
||||
Niotso Server - Niotso daemon based on PostgreSQL
|
||||
Server.cpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <syslog.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/epoll.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include "Server.hpp"
|
||||
|
||||
#define SHUTDOWN(X) do { syslog(LOG_INFO, "<info> Could not recover from errors. Shutting down."); \
|
||||
exitval = EXIT_FAILURE; goto X; } while(0)
|
||||
#define SHUTDOWN_M(X, Y) do { syslog(LOG_ERR, "<error> %s (%s)", X, strerror(errno)); \
|
||||
SHUTDOWN(Y); } while(0)
|
||||
|
||||
//IPV6_V6ONLY
|
||||
|
||||
static void term(int)
|
||||
{
|
||||
}
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
const pid_t pid = fork();
|
||||
if(pid < 0){
|
||||
const char *msg1 = "<error> Failed to create child process (%s).", *msg2 = strerror(errno);
|
||||
openlog(SERVER_NAME, 0, LOG_DAEMON);
|
||||
syslog(LOG_ERR, msg1, msg2);
|
||||
closelog();
|
||||
fprintf(stderr, msg1, msg2);
|
||||
fprintf(stderr, "\n");
|
||||
return EXIT_FAILURE;
|
||||
}else if(pid > 0)
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
int exitval = EXIT_SUCCESS, sockfd, epollfd;
|
||||
{ //New scope required for error handling
|
||||
int ret;
|
||||
FILE * fd;
|
||||
|
||||
umask(0);
|
||||
|
||||
openlog(SERVER_NAME, LOG_PID, LOG_DAEMON);
|
||||
|
||||
if(setsid() < 0)
|
||||
SHUTDOWN_M("Failed to create session", close_msg);
|
||||
|
||||
if(chdir(CONFIG_DIR) < 0)
|
||||
SHUTDOWN_M("Failed to change into \""CONFIG_DIR"\"", close_msg);
|
||||
|
||||
close(STDIN_FILENO);
|
||||
close(STDOUT_FILENO);
|
||||
close(STDERR_FILENO);
|
||||
|
||||
struct sigaction sigact;
|
||||
sigact.sa_handler = term;
|
||||
sigemptyset(&sigact.sa_mask);
|
||||
sigact.sa_flags = 0;
|
||||
sigaction(SIGTERM, &sigact, NULL);
|
||||
sigaction(SIGINT, &sigact, NULL);
|
||||
|
||||
syslog(LOG_INFO, "<info> "SERVER_NAME" (version "VERSIONSTR") is starting...");
|
||||
|
||||
fd = fopen("network.conf", "r");
|
||||
if(!fd)
|
||||
SHUTDOWN_M("Failed to open \""CONFIG_DIR"/network.conf\"", close_msg);
|
||||
unsigned int port = 0;
|
||||
ret = fscanf(fd, "%u", &port);
|
||||
fclose(fd);
|
||||
if(ret < 0)
|
||||
SHUTDOWN_M("Failed to read \""CONFIG_DIR"/network.conf\"", close_msg);
|
||||
if(port > 65535){
|
||||
syslog(LOG_ERR, "<error> Invalid port '%u' specified in \""CONFIG_DIR"/network.conf\".", port);
|
||||
SHUTDOWN(close_msg);
|
||||
}
|
||||
|
||||
sockfd = socket(AF_INET6, SOCK_DGRAM, 0);
|
||||
if(sockfd < 0)
|
||||
SHUTDOWN_M("Failed to open socket", close_msg);
|
||||
|
||||
int flags = fcntl(sockfd, F_GETFL, 0);
|
||||
if(flags < 0)
|
||||
SHUTDOWN_M("Failed to read socket flags", close_socket);
|
||||
if(fcntl(sockfd, F_SETFL, flags | O_NONBLOCK) < 0)
|
||||
SHUTDOWN_M("Failed to set socket flags", close_socket);
|
||||
|
||||
sockaddr_in6 server_addr, client_addr;
|
||||
memset(&server_addr, 0, sizeof(sockaddr_in6));
|
||||
memset(&client_addr, 0, sizeof(sockaddr_in6));
|
||||
server_addr.sin6_family = AF_INET6;
|
||||
server_addr.sin6_port = htons((uint16_t) port);
|
||||
server_addr.sin6_addr = in6addr_any;
|
||||
client_addr.sin6_family = AF_INET6;
|
||||
client_addr.sin6_addr = in6addr_any;
|
||||
|
||||
if(bind(sockfd, (const sockaddr*) &server_addr, sizeof(sockaddr_in6)) < 0)
|
||||
SHUTDOWN_M("Failed to bind to socket", close_socket);
|
||||
|
||||
epollfd = epoll_create(1);
|
||||
if(epollfd < 0)
|
||||
SHUTDOWN_M("Failed to create an epoll handle", close_socket);
|
||||
|
||||
epoll_event epev[1];
|
||||
epev[0].events = EPOLLIN | EPOLLPRI;
|
||||
epev[0].data.fd = sockfd;
|
||||
if(epoll_ctl(epollfd, EPOLL_CTL_ADD, sockfd, epev) < 0)
|
||||
SHUTDOWN_M("Failed to register the socket to the epoll handle", close_epoll);
|
||||
|
||||
//Now that we're running, stop being terminate-on-failure-happy
|
||||
syslog(LOG_INFO, "<info> Running.");
|
||||
|
||||
/****
|
||||
** Listen loop
|
||||
*/
|
||||
|
||||
int eventcount;
|
||||
while((eventcount = epoll_wait(epollfd, epev, 1, -1)) >= 0){
|
||||
if(eventcount == 0)
|
||||
continue;
|
||||
else if(epev[0].events & EPOLLERR)
|
||||
SHUTDOWN_M("Socket closed unexpectedly with EPOLLERR", close_epoll);
|
||||
else if(epev[0].events & EPOLLHUP)
|
||||
SHUTDOWN_M("Socket closed unexpectedly with EPOLLHUP", close_epoll);
|
||||
else if(!(epev[0].events & EPOLLIN) && !(epev[0].events & EPOLLPRI))
|
||||
continue;
|
||||
|
||||
uint8_t packetdata[1500];
|
||||
socklen_t addrlen = sizeof(sockaddr_in6);
|
||||
ssize_t packetsize = recvfrom(epev[0].data.fd, packetdata, 1500, 0, (sockaddr*) &client_addr, &addrlen);
|
||||
if(packetsize < 0){
|
||||
if(errno == EINTR || errno == ECONNRESET || errno == ENOTCONN || errno == ETIMEDOUT ||
|
||||
errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
continue;
|
||||
|
||||
SHUTDOWN_M("Socket closed unexpectedly on call to recvfrom", close_epoll);
|
||||
}
|
||||
|
||||
//Pass the packet down (even zero-length packets might be meaningful in the protocol)
|
||||
//...
|
||||
}
|
||||
|
||||
/****
|
||||
** Shutdown
|
||||
*/
|
||||
|
||||
}
|
||||
close_epoll: close(epollfd);
|
||||
close_socket: close(sockfd);
|
||||
close_msg: syslog(LOG_INFO, "<info> Shut down gracefully.");
|
||||
closelog();
|
||||
|
||||
return exitval;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
Niotso Server - Niotso daemon based on PostgreSQL
|
||||
Server.hpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define SERVER_NAME "niotsod-vanilla"
|
||||
#define CONFIG_DIR "/etc/"SERVER_NAME
|
||||
|
||||
#define VERSIONSTR "0.0.0"
|
10
Server/TODO
10
Server/TODO
|
@ -1,10 +0,0 @@
|
|||
Because there are too many long-term things to list that we still have "to do" to reach the next development phase (e.g.
|
||||
alpha to beta), this file contains only the things that are worked on currently or that will be in the very near future.
|
||||
|
||||
While anybody is free to work on _anything_ at any point during Niotso's time, this list shall ONLY contain those relevant
|
||||
to complete the criteria for the next development phase, which can be found here:
|
||||
<http://wiki.niotso.org/Niotso_Release_Schedule>
|
||||
|
||||
//----------//
|
||||
|
||||
Tasks will be added for the server when the development phase reaches Alpha.
|
|
@ -1,5 +1,7 @@
|
|||
add_subdirectory(FARDive)
|
||||
add_subdirectory(hitutils)
|
||||
add_subdirectory(iff2html)
|
||||
add_subdirectory(rtti-reader)
|
||||
add_subdirectory(tsoscan)
|
||||
add_subdirectory(far-extract)
|
||||
|
||||
#add_subdirectory(FARDive)
|
||||
#add_subdirectory(hitutils)
|
||||
#add_subdirectory(iff2html)
|
||||
#add_subdirectory(rtti-reader)
|
||||
#add_subdirectory(tsoscan)
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 2.6...3.29)
|
||||
project(FARDive)
|
||||
|
||||
if(WIN32)
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
The Sims Online Translation Tool - Graphical Translation Writer for TSO
|
||||
TranslateTool.hpp - Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
namespace Translation {
|
||||
extern wchar_t Path[1024], Filename[1024];
|
||||
|
||||
extern bool IsOpen;
|
||||
extern bool IsModified;
|
||||
|
||||
bool Add(const wchar_t * Path);
|
||||
bool Close();
|
||||
bool Open();
|
||||
bool PopulateEntries();
|
||||
bool Save();
|
||||
bool SaveAs();
|
||||
bool SetWorkspace();
|
||||
}
|
8
Tools/far-extract/CMakeLists.txt
Normal file
8
Tools/far-extract/CMakeLists.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
cmake_minimum_required(VERSION 2.6...3.29)
|
||||
project(far-extract)
|
||||
|
||||
include_directories(${format_SOURCE_DIR})
|
||||
add_executable(farextract farextract.c)
|
||||
target_link_libraries(farextract far)
|
||||
|
||||
set_target_properties(farextract PROPERTIES FOLDER tools)
|
9
Tools/far-extract/HOWTO_EXTRACT.txt
Normal file
9
Tools/far-extract/HOWTO_EXTRACT.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
.\farextract.exe -tso "./Avatardata/skeletons/skeletons.dat" "./out/skeletons"
|
||||
.\farextract.exe -tso "./Avatardata/animations/animations.dat" "./out/animations"
|
||||
|
||||
.\farextract.exe -tso "./Avatardata/bodies/meshes/meshes.dat" "./out/bodies/meshes"
|
||||
.\farextract.exe -tso "./Avatardata/bodies/textures/textures.dat" "./out/bodies/textures"
|
||||
.\farextract.exe -tso "./Avatardata/heads/meshes/meshes.dat" "./out/heads/meshes"
|
||||
.\farextract.exe -tso "./Avatardata/heads/textures/textures.dat" "./out/heads/textures"
|
||||
.\farextract.exe -tso "./Avatardata/hands/meshes/meshes.dat" "./out/hands/meshes"
|
||||
.\farextract.exe -tso "./Avatardata/hands/textures/textures.dat" "./out/hands/textures"
|
|
@ -20,11 +20,10 @@
|
|||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include "far.h"
|
||||
#include "far/far.h"
|
||||
|
||||
#ifndef read_uint32
|
||||
#define read_uint32(x) (unsigned)(((x)[0]<<(8*0)) | ((x)[1]<<(8*1)) | ((x)[2]<<(8*2)) | ((x)[3]<<(8*3)))
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 2.6...3.29)
|
||||
project(hitutils)
|
||||
|
||||
set(HITDUMP_SOURCES
|
||||
|
|
5
Tools/iff-export/CMakeLists.txt
Normal file
5
Tools/iff-export/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
cmake_minimum_required(VERSION 2.6...3.29)
|
||||
project(iff-export)
|
||||
|
||||
add_executable(iffexport iffexport.c)
|
||||
target_link_libraries(iffexport iff)
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 2.6...3.29)
|
||||
project(iff2html)
|
||||
|
||||
set(IFF2HTML_SOURCES
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 2.6...3.29)
|
||||
project(rtti-reader)
|
||||
|
||||
set(RTTIREADER_SOURCES
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 2.6...3.29)
|
||||
project(tsoscan)
|
||||
|
||||
set(TSOSCAN_SOURCES
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 2.6...3.29)
|
||||
project(utk)
|
||||
|
||||
set(UTK_SOURCES
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
cmake_minimum_required(VERSION 2.6...3.29)
|
||||
project(xa)
|
||||
|
||||
set(XA_SOURCES
|
6
deps/CMakeLists.txt
vendored
Normal file
6
deps/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
add_subdirectory(zlib)
|
||||
add_subdirectory(libpng)
|
||||
add_subdirectory(libjpeg-turbo)
|
||||
#add_subdirectory(libmpg123)
|
||||
#add_subdirectory(libpq)
|
||||
add_subdirectory(freetype)
|
25
deps/freetype/CMakeLists.txt
vendored
Normal file
25
deps/freetype/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
cmake_minimum_required(VERSION 2.6...3.29)
|
||||
project(freetype)
|
||||
|
||||
set(FREETYPE_SOURCES
|
||||
src/autofit/autofit.c
|
||||
src/base/ftbase.c
|
||||
src/base/ftbitmap.c
|
||||
src/base/ftglyph.c
|
||||
src/base/ftinit.c
|
||||
src/base/ftsystem.c
|
||||
src/raster/raster.c
|
||||
src/sfnt/sfnt.c
|
||||
src/smooth/smooth.c
|
||||
src/truetype/truetype.c
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE FREETYPE_HEADERS ${PROJECT_SOURCE_DIR}/include/*.h)
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
add_definitions(-DFT2_BUILD_LIBRARY)
|
||||
|
||||
add_library(freetype STATIC ${FREETYPE_SOURCES} ${FREETYPE_HEADERS}) # remove static, cmake should take care of that
|
||||
target_include_directories(freetype PUBLIC ${FREETYPE_HEADERS})
|
||||
|
||||
set_target_properties(freetype PROPERTIES FOLDER deps)
|
4312
deps/freetype/ChangeLog
vendored
Normal file
4312
deps/freetype/ChangeLog
vendored
Normal file
File diff suppressed because it is too large
Load diff
2613
deps/freetype/ChangeLog.20
vendored
Normal file
2613
deps/freetype/ChangeLog.20
vendored
Normal file
File diff suppressed because it is too large
Load diff
9439
deps/freetype/ChangeLog.21
vendored
Normal file
9439
deps/freetype/ChangeLog.21
vendored
Normal file
File diff suppressed because it is too large
Load diff
2837
deps/freetype/ChangeLog.22
vendored
Normal file
2837
deps/freetype/ChangeLog.22
vendored
Normal file
File diff suppressed because it is too large
Load diff
7948
deps/freetype/ChangeLog.23
vendored
Normal file
7948
deps/freetype/ChangeLog.23
vendored
Normal file
File diff suppressed because it is too large
Load diff
34
deps/freetype/Makefile
vendored
Normal file
34
deps/freetype/Makefile
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
#
|
||||
# FreeType 2 build system -- top-level Makefile
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2002, 2006 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
# and distributed under the terms of the FreeType project license,
|
||||
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||
# indicate that you have read the license and understand and accept it
|
||||
# fully.
|
||||
|
||||
|
||||
# Project names
|
||||
#
|
||||
PROJECT := freetype
|
||||
PROJECT_TITLE := FreeType
|
||||
|
||||
# The variable TOP_DIR holds the path to the topmost directory in the project
|
||||
# engine source hierarchy. If it is not defined, default it to `.'.
|
||||
#
|
||||
TOP_DIR ?= .
|
||||
|
||||
# The variable OBJ_DIR gives the location where object files and the
|
||||
# FreeType library are built.
|
||||
#
|
||||
OBJ_DIR ?= $(TOP_DIR)/objs
|
||||
|
||||
|
||||
include $(TOP_DIR)/builds/toplevel.mk
|
||||
|
||||
# EOF
|
57
deps/freetype/README
vendored
Normal file
57
deps/freetype/README
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
FreeType 2.4.10
|
||||
===============
|
||||
|
||||
Please read the docs/CHANGES file, it contains IMPORTANT
|
||||
INFORMATION.
|
||||
|
||||
Read the files `docs/INSTALL' for installation instructions.
|
||||
|
||||
See the file `docs/LICENSE.TXT' for the available licenses. Note
|
||||
that we use ranges (`2008-2010') for copyright years also instead of
|
||||
listing individual years (`2008, 2009, 2010').
|
||||
|
||||
The FreeType 2 API reference is located in `docs/reference'; use the
|
||||
file `ft2-doc.html' as the top entry point. Additional
|
||||
documentation is available as a separate package from our sites. Go
|
||||
to
|
||||
|
||||
http://download.savannah.gnu.org/releases/freetype/
|
||||
|
||||
and download one of the following files.
|
||||
|
||||
freetype-doc-2.4.10.tar.bz2
|
||||
freetype-doc-2.4.10.tar.gz
|
||||
ftdoc2410.zip
|
||||
|
||||
|
||||
Bugs
|
||||
====
|
||||
|
||||
Please report bugs by e-mail to `freetype-devel@nongnu.org'. Don't
|
||||
forget to send a detailed explanation of the problem -- there is
|
||||
nothing worse than receiving a terse message that only says `it
|
||||
doesn't work'.
|
||||
|
||||
Alternatively, you may submit a bug report at
|
||||
|
||||
https://savannah.nongnu.org/bugs/?group=freetype
|
||||
|
||||
|
||||
Enjoy!
|
||||
|
||||
|
||||
The FreeType Team
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright 2006-2011 by
|
||||
David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
|
||||
This file is part of the FreeType project, and may only be used,
|
||||
modified, and distributed under the terms of the FreeType project
|
||||
license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
this file you indicate that you have read the license and understand
|
||||
and accept it fully.
|
||||
|
||||
|
||||
--- end of README ---
|
166
deps/freetype/autogen.sh
vendored
Normal file
166
deps/freetype/autogen.sh
vendored
Normal file
|
@ -0,0 +1,166 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright 2005, 2006, 2007, 2008, 2009, 2010 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
# and distributed under the terms of the FreeType project license,
|
||||
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||
# indicate that you have read the license and understand and accept it
|
||||
# fully.
|
||||
|
||||
run ()
|
||||
{
|
||||
echo "running \`$*'"
|
||||
eval $*
|
||||
|
||||
if test $? != 0 ; then
|
||||
echo "error while running \`$*'"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_major_version ()
|
||||
{
|
||||
echo $1 | sed -e 's/\([0-9][0-9]*\)\..*/\1/g'
|
||||
}
|
||||
|
||||
get_minor_version ()
|
||||
{
|
||||
echo $1 | sed -e 's/[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/g'
|
||||
}
|
||||
|
||||
get_patch_version ()
|
||||
{
|
||||
# tricky: some version numbers don't include a patch
|
||||
# separated with a point, but something like 1.4-p6
|
||||
patch=`echo $1 | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/g'`
|
||||
if test "$patch" = "$1"; then
|
||||
patch=`echo $1 | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\-p\([0-9][0-9]*\).*/\1/g'`
|
||||
# if there isn't any patch number, default to 0
|
||||
if test "$patch" = "$1"; then
|
||||
patch=0
|
||||
fi
|
||||
fi
|
||||
echo $patch
|
||||
}
|
||||
|
||||
# $1: version to check
|
||||
# $2: minimum version
|
||||
|
||||
compare_to_minimum_version ()
|
||||
{
|
||||
MAJOR1=`get_major_version $1`
|
||||
MAJOR2=`get_major_version $2`
|
||||
if test $MAJOR1 -lt $MAJOR2; then
|
||||
echo 0
|
||||
return
|
||||
else
|
||||
if test $MAJOR1 -gt $MAJOR2; then
|
||||
echo 1
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
MINOR1=`get_minor_version $1`
|
||||
MINOR2=`get_minor_version $2`
|
||||
if test $MINOR1 -lt $MINOR2; then
|
||||
echo 0
|
||||
return
|
||||
else
|
||||
if test $MINOR1 -gt $MINOR2; then
|
||||
echo 1
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
PATCH1=`get_patch_version $1`
|
||||
PATCH2=`get_patch_version $2`
|
||||
if test $PATCH1 -lt $PATCH2; then
|
||||
echo 0
|
||||
else
|
||||
echo 1
|
||||
fi
|
||||
}
|
||||
|
||||
# check the version of a given tool against a minimum version number
|
||||
#
|
||||
# $1: tool path
|
||||
# $2: tool usual name (e.g. `aclocal')
|
||||
# $3: tool variable (e.g. `ACLOCAL')
|
||||
# $4: minimum version to check against
|
||||
# $5: option field index used to extract the tool version from the
|
||||
# output of --version
|
||||
|
||||
check_tool_version ()
|
||||
{
|
||||
field=$5
|
||||
# assume the output of "[TOOL] --version" is "toolname (GNU toolname foo bar) version"
|
||||
if test "$field"x = x; then
|
||||
field=3 # default to 3 for all GNU autotools, after filtering enclosed string
|
||||
fi
|
||||
version=`$1 --version | head -1 | sed 's/([^)]*)/()/g' | cut -d ' ' -f $field`
|
||||
version_check=`compare_to_minimum_version $version $4`
|
||||
if test "$version_check"x = 0x; then
|
||||
echo "ERROR: Your version of the \`$2' tool is too old."
|
||||
echo " Minimum version $4 is required (yours is version $version)."
|
||||
echo " Please upgrade or use the $3 variable to point to a more recent one."
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
if test ! -f ./builds/unix/configure.raw; then
|
||||
echo "You must be in the same directory as \`autogen.sh'."
|
||||
echo "Bootstrapping doesn't work if srcdir != builddir."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# On MacOS X, the GNU libtool is named `glibtool'.
|
||||
HOSTOS=`uname`
|
||||
if test "$LIBTOOLIZE"x != x; then
|
||||
:
|
||||
elif test "$HOSTOS"x = Darwinx; then
|
||||
LIBTOOLIZE=glibtoolize
|
||||
else
|
||||
LIBTOOLIZE=libtoolize
|
||||
fi
|
||||
|
||||
if test "$ACLOCAL"x = x; then
|
||||
ACLOCAL=aclocal
|
||||
fi
|
||||
|
||||
if test "$AUTOCONF"x = x; then
|
||||
AUTOCONF=autoconf
|
||||
fi
|
||||
|
||||
check_tool_version $ACLOCAL aclocal ACLOCAL 1.10.1
|
||||
check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4
|
||||
check_tool_version $AUTOCONF autoconf AUTOCONF 2.62
|
||||
|
||||
# This sets freetype_major, freetype_minor, and freetype_patch.
|
||||
eval `sed -nf version.sed include/freetype/freetype.h`
|
||||
|
||||
# We set freetype-patch to an empty value if it is zero.
|
||||
if test "$freetype_patch" = ".0"; then
|
||||
freetype_patch=
|
||||
fi
|
||||
|
||||
cd builds/unix
|
||||
|
||||
echo "generating \`configure.ac'"
|
||||
sed -e "s;@VERSION@;$freetype_major$freetype_minor$freetype_patch;" \
|
||||
< configure.raw > configure.ac
|
||||
|
||||
run aclocal -I . --force
|
||||
run $LIBTOOLIZE --force --copy --install
|
||||
run autoconf --force
|
||||
|
||||
chmod +x mkinstalldirs
|
||||
chmod +x install-sh
|
||||
|
||||
cd ../..
|
||||
|
||||
chmod +x ./configure
|
||||
|
||||
# EOF
|
62
deps/freetype/config.mk
vendored
Normal file
62
deps/freetype/config.mk
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
#
|
||||
# FreeType 2 configuration rules for UNIX platforms
|
||||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2002, 2004, 2006 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
# and distributed under the terms of the FreeType project license,
|
||||
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
|
||||
# indicate that you have read the license and understand and accept it
|
||||
# fully.
|
||||
|
||||
# We need these declarations here since unix-def.mk is a generated file.
|
||||
BUILD_DIR := $(TOP_DIR)/builds/unix
|
||||
PLATFORM := unix
|
||||
|
||||
have_mk := $(wildcard $(OBJ_DIR)/unix-def.mk)
|
||||
ifneq ($(have_mk),)
|
||||
# We are building FreeType 2 not in the src tree.
|
||||
include $(OBJ_DIR)/unix-def.mk
|
||||
include $(OBJ_DIR)/unix-cc.mk
|
||||
else
|
||||
include $(BUILD_DIR)/unix-def.mk
|
||||
include $(BUILD_DIR)/unix-cc.mk
|
||||
endif
|
||||
|
||||
ifdef BUILD_PROJECT
|
||||
|
||||
.PHONY: clean_project distclean_project
|
||||
|
||||
# Now include the main sub-makefile. It contains all the rules used to
|
||||
# build the library with the previous variables defined.
|
||||
#
|
||||
include $(TOP_DIR)/builds/$(PROJECT).mk
|
||||
|
||||
|
||||
# The cleanup targets.
|
||||
#
|
||||
clean_project: clean_project_unix
|
||||
distclean_project: distclean_project_unix
|
||||
|
||||
|
||||
# This final rule is used to link all object files into a single library.
|
||||
# It is part of the system-specific sub-Makefile because not all
|
||||
# librarians accept a simple syntax like
|
||||
#
|
||||
# librarian library_file {list of object files}
|
||||
#
|
||||
$(PROJECT_LIBRARY): $(OBJECTS_LIST)
|
||||
ifdef CLEAN_LIBRARY
|
||||
-$(CLEAN_LIBRARY) $(NO_OUTPUT)
|
||||
endif
|
||||
$(LINK_LIBRARY)
|
||||
|
||||
include $(TOP_DIR)/builds/unix/install.mk
|
||||
|
||||
endif
|
||||
|
||||
|
||||
# EOF
|
563
deps/freetype/include/freetype/config/ftconfig.h
vendored
Normal file
563
deps/freetype/include/freetype/config/ftconfig.h
vendored
Normal file
|
@ -0,0 +1,563 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftconfig.h */
|
||||
/* */
|
||||
/* ANSI-specific configuration file (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2004, 2006-2008, 2010-2011 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This header file contains a number of macro definitions that are used */
|
||||
/* by the rest of the engine. Most of the macros here are automatically */
|
||||
/* determined at compile time, and you should not need to change it to */
|
||||
/* port FreeType, except to compile the library with a non-ANSI */
|
||||
/* compiler. */
|
||||
/* */
|
||||
/* Note however that if some specific modifications are needed, we */
|
||||
/* advise you to place a modified copy in your build directory. */
|
||||
/* */
|
||||
/* The build directory is usually `freetype/builds/<system>', and */
|
||||
/* contains system-specific files that are always included first when */
|
||||
/* building the library. */
|
||||
/* */
|
||||
/* This ANSI version should stay in `include/freetype/config'. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef __FTCONFIG_H__
|
||||
#define __FTCONFIG_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_OPTIONS_H
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* PLATFORM-SPECIFIC CONFIGURATION MACROS */
|
||||
/* */
|
||||
/* These macros can be toggled to suit a specific system. The current */
|
||||
/* ones are defaults used to compile FreeType in an ANSI C environment */
|
||||
/* (16bit compilers are also supported). Copy this file to your own */
|
||||
/* `freetype/builds/<system>' directory, and edit it to port the engine. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* There are systems (like the Texas Instruments 'C54x) where a `char' */
|
||||
/* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
|
||||
/* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
|
||||
/* is probably unexpected. */
|
||||
/* */
|
||||
/* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
|
||||
/* `char' type. */
|
||||
|
||||
#ifndef FT_CHAR_BIT
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
#endif
|
||||
|
||||
|
||||
/* The size of an `int' type. */
|
||||
#if FT_UINT_MAX == 0xFFFFUL
|
||||
#define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
|
||||
#elif FT_UINT_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT (32 / FT_CHAR_BIT)
|
||||
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT (64 / FT_CHAR_BIT)
|
||||
#else
|
||||
#error "Unsupported size of `int' type!"
|
||||
#endif
|
||||
|
||||
/* The size of a `long' type. A five-byte `long' (as used e.g. on the */
|
||||
/* DM642) is recognized but avoided. */
|
||||
#if FT_ULONG_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT)
|
||||
#else
|
||||
#error "Unsupported size of `long' type!"
|
||||
#endif
|
||||
|
||||
|
||||
/* FT_UNUSED is a macro used to indicate that a given parameter is not */
|
||||
/* used -- this is only used to get rid of unpleasant compiler warnings */
|
||||
#ifndef FT_UNUSED
|
||||
#define FT_UNUSED( arg ) ( (arg) = (arg) )
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* AUTOMATIC CONFIGURATION MACROS */
|
||||
/* */
|
||||
/* These macros are computed from the ones defined above. Don't touch */
|
||||
/* their definition, unless you know precisely what you are doing. No */
|
||||
/* porter should need to mess with them. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Mac support */
|
||||
/* */
|
||||
/* This is the only necessary change, so it is defined here instead */
|
||||
/* providing a new configuration file. */
|
||||
/* */
|
||||
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
|
||||
/* no Carbon frameworks for 64bit 10.4.x */
|
||||
/* AvailabilityMacros.h is available since Mac OS X 10.2, */
|
||||
/* so guess the system version by maximum errno before inclusion */
|
||||
#include <errno.h>
|
||||
#ifdef ECANCELED /* defined since 10.2 */
|
||||
#include "AvailabilityMacros.h"
|
||||
#endif
|
||||
#if defined( __LP64__ ) && \
|
||||
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
|
||||
#undef FT_MACINTOSH
|
||||
#endif
|
||||
|
||||
#elif defined( __SC__ ) || defined( __MRC__ )
|
||||
/* Classic MacOS compilers */
|
||||
#include "ConditionalMacros.h"
|
||||
#if TARGET_OS_MAC
|
||||
#define FT_MACINTOSH 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* basic_types */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Int16 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A typedef for a 16bit signed integer type. */
|
||||
/* */
|
||||
typedef signed short FT_Int16;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_UInt16 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A typedef for a 16bit unsigned integer type. */
|
||||
/* */
|
||||
typedef unsigned short FT_UInt16;
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/* this #if 0 ... #endif clause is for documentation purposes */
|
||||
#if 0
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_Int32 */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A typedef for a 32bit signed integer type. The size depends on */
|
||||
/* the configuration. */
|
||||
/* */
|
||||
typedef signed XXX FT_Int32;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FT_UInt32 */
|
||||
/* */
|
||||
/* A typedef for a 32bit unsigned integer type. The size depends on */
|
||||
/* the configuration. */
|
||||
/* */
|
||||
typedef unsigned XXX FT_UInt32;
|
||||
|
||||
/* */
|
||||
|
||||
#endif
|
||||
|
||||
#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
|
||||
|
||||
typedef signed int FT_Int32;
|
||||
typedef unsigned int FT_UInt32;
|
||||
|
||||
#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
|
||||
|
||||
typedef signed long FT_Int32;
|
||||
typedef unsigned long FT_UInt32;
|
||||
|
||||
#else
|
||||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
|
||||
/* look up an integer type that is at least 32 bits */
|
||||
#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
|
||||
|
||||
typedef int FT_Fast;
|
||||
typedef unsigned int FT_UFast;
|
||||
|
||||
#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
|
||||
|
||||
typedef long FT_Fast;
|
||||
typedef unsigned long FT_UFast;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* determine whether we have a 64-bit int type for platforms without */
|
||||
/* Autoconf */
|
||||
#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
|
||||
|
||||
/* FT_LONG64 must be defined if a 64-bit type is available */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long
|
||||
|
||||
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* this compiler provides the __int64 type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
|
||||
#elif defined( __BORLANDC__ ) /* Borland C++ */
|
||||
|
||||
/* XXXX: We should probably check the value of __BORLANDC__ in order */
|
||||
/* to test the compiler version. */
|
||||
|
||||
/* this compiler provides the __int64 type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
|
||||
#elif defined( __WATCOMC__ ) /* Watcom C++ */
|
||||
|
||||
/* Watcom doesn't provide 64-bit data types */
|
||||
|
||||
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the `long long' type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* A 64-bit data type will create compilation problems if you compile */
|
||||
/* in strict ANSI mode. To avoid them, we disable its use if __STDC__ */
|
||||
/* is defined. You can however ignore this rule by defining the */
|
||||
/* FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
|
||||
/* */
|
||||
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#ifdef __STDC__
|
||||
|
||||
/* undefine the 64-bit macros in strict ANSI compilation mode */
|
||||
#undef FT_LONG64
|
||||
#undef FT_INT64
|
||||
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
|
||||
|
||||
|
||||
#define FT_BEGIN_STMNT do {
|
||||
#define FT_END_STMNT } while ( 0 )
|
||||
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
|
||||
/* Provide assembler fragments for performance-critical functions. */
|
||||
/* These must be defined `static __inline__' with GCC. */
|
||||
|
||||
#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
|
||||
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
static __inline FT_Int32
|
||||
FT_MulFix_arm( FT_Int32 a,
|
||||
FT_Int32 b )
|
||||
{
|
||||
register FT_Int32 t, t2;
|
||||
|
||||
|
||||
__asm
|
||||
{
|
||||
smull t2, t, b, a /* (lo=t2,hi=t) = a*b */
|
||||
mov a, t, asr #31 /* a = (hi >> 31) */
|
||||
add a, a, #0x8000 /* a += 0x8000 */
|
||||
adds t2, t2, a /* t2 += a */
|
||||
adc t, t, #0 /* t += carry */
|
||||
mov a, t2, lsr #16 /* a = t2 >> 16 */
|
||||
orr a, a, t, lsl #16 /* a |= t << 16 */
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
#endif /* __CC_ARM || __ARMCC__ */
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#if defined( __arm__ ) && !defined( __thumb__ ) && \
|
||||
!( defined( __CC_ARM ) || defined( __ARMCC__ ) )
|
||||
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
static __inline__ FT_Int32
|
||||
FT_MulFix_arm( FT_Int32 a,
|
||||
FT_Int32 b )
|
||||
{
|
||||
register FT_Int32 t, t2;
|
||||
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
|
||||
"mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */
|
||||
"add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */
|
||||
"adds %1, %1, %0\n\t" /* %1 += %0 */
|
||||
"adc %2, %2, #0\n\t" /* %2 += carry */
|
||||
"mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */
|
||||
"orr %0, %0, %2, lsl #16\n\t" /* %0 |= %2 << 16 */
|
||||
: "=r"(a), "=&r"(t2), "=&r"(t)
|
||||
: "r"(a), "r"(b) );
|
||||
return a;
|
||||
}
|
||||
|
||||
#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */
|
||||
|
||||
#if defined( __i386__ )
|
||||
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
static __inline__ FT_Int32
|
||||
FT_MulFix_i386( FT_Int32 a,
|
||||
FT_Int32 b )
|
||||
{
|
||||
register FT_Int32 result;
|
||||
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"imul %%edx\n"
|
||||
"movl %%edx, %%ecx\n"
|
||||
"sarl $31, %%ecx\n"
|
||||
"addl $0x8000, %%ecx\n"
|
||||
"addl %%ecx, %%eax\n"
|
||||
"adcl $0, %%edx\n"
|
||||
"shrl $16, %%eax\n"
|
||||
"shll $16, %%edx\n"
|
||||
"addl %%edx, %%eax\n"
|
||||
: "=a"(result), "=d"(b)
|
||||
: "a"(a), "d"(b)
|
||||
: "%ecx", "cc" );
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* i386 */
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
|
||||
#ifdef _MSC_VER /* Visual C++ */
|
||||
|
||||
#ifdef _M_IX86
|
||||
|
||||
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
static __inline FT_Int32
|
||||
FT_MulFix_i386( FT_Int32 a,
|
||||
FT_Int32 b )
|
||||
{
|
||||
register FT_Int32 result;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, a
|
||||
mov edx, b
|
||||
imul edx
|
||||
mov ecx, edx
|
||||
sar ecx, 31
|
||||
add ecx, 8000h
|
||||
add eax, ecx
|
||||
adc edx, 0
|
||||
shr eax, 16
|
||||
shl edx, 16
|
||||
add eax, edx
|
||||
mov result, eax
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* _M_IX86 */
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
|
||||
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
|
||||
#ifdef FT_MULFIX_ASSEMBLER
|
||||
#define FT_MULFIX_INLINED FT_MULFIX_ASSEMBLER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
||||
#define FT_LOCAL( x ) static x
|
||||
#define FT_LOCAL_DEF( x ) static x
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_LOCAL( x ) extern "C" x
|
||||
#define FT_LOCAL_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_LOCAL( x ) extern x
|
||||
#define FT_LOCAL_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
|
||||
|
||||
|
||||
#ifndef FT_BASE
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE( x ) extern "C" x
|
||||
#else
|
||||
#define FT_BASE( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE */
|
||||
|
||||
|
||||
#ifndef FT_BASE_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#else
|
||||
#define FT_BASE_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_BASE_DEF */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT_DEF( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT_DEF */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_VAR
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FT_EXPORT_VAR( x ) extern "C" x
|
||||
#else
|
||||
#define FT_EXPORT_VAR( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !FT_EXPORT_VAR */
|
||||
|
||||
/* The following macros are needed to compile the library with a */
|
||||
/* C++ compiler and with 16bit compilers. */
|
||||
/* */
|
||||
|
||||
/* This is special. Within C++, you must specify `extern "C"' for */
|
||||
/* functions which are used via function pointers, and you also */
|
||||
/* must do that for structures which contain function pointers to */
|
||||
/* assure C linkage -- it's not possible to have (local) anonymous */
|
||||
/* functions which are accessed by (global) function pointers. */
|
||||
/* */
|
||||
/* */
|
||||
/* FT_CALLBACK_DEF is used to _define_ a callback function. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
|
||||
/* contains pointers to callback functions. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
|
||||
/* that contains pointers to callback functions. */
|
||||
/* */
|
||||
/* */
|
||||
/* Some 16bit compilers have to redefine these macros to insert */
|
||||
/* the infamous `_cdecl' or `__fastcall' declarations. */
|
||||
/* */
|
||||
#ifndef FT_CALLBACK_DEF
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_CALLBACK_DEF( x ) static x
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_DEF */
|
||||
|
||||
#ifndef FT_CALLBACK_TABLE
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_TABLE extern "C"
|
||||
#define FT_CALLBACK_TABLE_DEF extern "C"
|
||||
#else
|
||||
#define FT_CALLBACK_TABLE extern
|
||||
#define FT_CALLBACK_TABLE_DEF /* nothing */
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_TABLE */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCONFIG_H__ */
|
||||
|
||||
|
||||
/* END */
|
793
deps/freetype/include/freetype/config/ftheader.h
vendored
Normal file
793
deps/freetype/include/freetype/config/ftheader.h
vendored
Normal file
|
@ -0,0 +1,793 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftheader.h */
|
||||
/* */
|
||||
/* Build macros of the FreeType 2 library. */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef __FT_HEADER_H__
|
||||
#define __FT_HEADER_H__
|
||||
|
||||
|
||||
/*@***********************************************************************/
|
||||
/* */
|
||||
/* <Macro> */
|
||||
/* FT_BEGIN_HEADER */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro is used in association with @FT_END_HEADER in header */
|
||||
/* files to ensure that the declarations within are properly */
|
||||
/* encapsulated in an `extern "C" { .. }' block when included from a */
|
||||
/* C++ compiler. */
|
||||
/* */
|
||||
#ifdef __cplusplus
|
||||
#define FT_BEGIN_HEADER extern "C" {
|
||||
#else
|
||||
#define FT_BEGIN_HEADER /* nothing */
|
||||
#endif
|
||||
|
||||
|
||||
/*@***********************************************************************/
|
||||
/* */
|
||||
/* <Macro> */
|
||||
/* FT_END_HEADER */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This macro is used in association with @FT_BEGIN_HEADER in header */
|
||||
/* files to ensure that the declarations within are properly */
|
||||
/* encapsulated in an `extern "C" { .. }' block when included from a */
|
||||
/* C++ compiler. */
|
||||
/* */
|
||||
#ifdef __cplusplus
|
||||
#define FT_END_HEADER }
|
||||
#else
|
||||
#define FT_END_HEADER /* nothing */
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Aliases for the FreeType 2 public and configuration files. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* header_file_macros */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Header File Macros */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* Macro definitions used to #include specific header files. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The following macros are defined to the name of specific */
|
||||
/* FreeType~2 header files. They can be used directly in #include */
|
||||
/* statements as in: */
|
||||
/* */
|
||||
/* { */
|
||||
/* #include FT_FREETYPE_H */
|
||||
/* #include FT_MULTIPLE_MASTERS_H */
|
||||
/* #include FT_GLYPH_H */
|
||||
/* } */
|
||||
/* */
|
||||
/* There are several reasons why we are now using macros to name */
|
||||
/* public header files. The first one is that such macros are not */
|
||||
/* limited to the infamous 8.3~naming rule required by DOS (and */
|
||||
/* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
|
||||
/* */
|
||||
/* The second reason is that it allows for more flexibility in the */
|
||||
/* way FreeType~2 is installed on a given system. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/* configuration files */
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_CONFIG_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing
|
||||
* FreeType~2 configuration data.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_CONFIG_H
|
||||
#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_STANDARD_LIBRARY_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing
|
||||
* FreeType~2 interface to the standard C library functions.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_STANDARD_LIBRARY_H
|
||||
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_OPTIONS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing
|
||||
* FreeType~2 project-specific configuration options.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_OPTIONS_H
|
||||
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CONFIG_MODULES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* list of FreeType~2 modules that are statically linked to new library
|
||||
* instances in @FT_Init_FreeType.
|
||||
*
|
||||
*/
|
||||
#ifndef FT_CONFIG_MODULES_H
|
||||
#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
|
||||
#endif
|
||||
|
||||
/* */
|
||||
|
||||
/* public headers */
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_FREETYPE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* base FreeType~2 API.
|
||||
*
|
||||
*/
|
||||
#define FT_FREETYPE_H <freetype/freetype.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ERRORS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* list of FreeType~2 error codes (and messages).
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_ERRORS_H <freetype/fterrors.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MODULE_ERRORS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* list of FreeType~2 module error offsets (and messages).
|
||||
*
|
||||
*/
|
||||
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SYSTEM_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 interface to low-level operations (i.e., memory management
|
||||
* and stream i/o).
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_SYSTEM_H <freetype/ftsystem.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_IMAGE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing type
|
||||
* definitions related to glyph images (i.e., bitmaps, outlines,
|
||||
* scan-converter parameters).
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_IMAGE_H <freetype/ftimage.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TYPES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* basic data types defined by FreeType~2.
|
||||
*
|
||||
* It is included by @FT_FREETYPE_H.
|
||||
*
|
||||
*/
|
||||
#define FT_TYPES_H <freetype/fttypes.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_LIST_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* list management API of FreeType~2.
|
||||
*
|
||||
* (Most applications will never need to include this file.)
|
||||
*
|
||||
*/
|
||||
#define FT_LIST_H <freetype/ftlist.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_OUTLINE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* scalable outline management API of FreeType~2.
|
||||
*
|
||||
*/
|
||||
#define FT_OUTLINE_H <freetype/ftoutln.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SIZES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API which manages multiple @FT_Size objects per face.
|
||||
*
|
||||
*/
|
||||
#define FT_SIZES_H <freetype/ftsizes.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MODULE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* module management API of FreeType~2.
|
||||
*
|
||||
*/
|
||||
#define FT_MODULE_H <freetype/ftmodapi.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_RENDER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* renderer module management API of FreeType~2.
|
||||
*
|
||||
*/
|
||||
#define FT_RENDER_H <freetype/ftrender.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TYPE1_TABLES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* types and API specific to the Type~1 format.
|
||||
*
|
||||
*/
|
||||
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_IDS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* enumeration values which identify name strings, languages, encodings,
|
||||
* etc. This file really contains a _large_ set of constant macro
|
||||
* definitions, taken from the TrueType and OpenType specifications.
|
||||
*
|
||||
*/
|
||||
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_TABLES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* types and API specific to the TrueType (as well as OpenType) format.
|
||||
*
|
||||
*/
|
||||
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRUETYPE_TAGS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of TrueType four-byte `tags' which identify blocks in
|
||||
* SFNT-based font formats (i.e., TrueType and OpenType).
|
||||
*
|
||||
*/
|
||||
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BDF_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which accesses BDF-specific strings from a
|
||||
* face.
|
||||
*
|
||||
*/
|
||||
#define FT_BDF_H <freetype/ftbdf.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CID_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which access CID font information from a
|
||||
* face.
|
||||
*
|
||||
*/
|
||||
#define FT_CID_H <freetype/ftcid.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GZIP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which supports gzip-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_GZIP_H <freetype/ftgzip.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_LZW_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which supports LZW-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_LZW_H <freetype/ftlzw.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BZIP2_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which supports bzip2-compressed files.
|
||||
*
|
||||
*/
|
||||
#define FT_BZIP2_H <freetype/ftbzip2.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_WINFONTS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* definitions of an API which supports Windows FNT files.
|
||||
*
|
||||
*/
|
||||
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GLYPH_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API of the optional glyph management component.
|
||||
*
|
||||
*/
|
||||
#define FT_GLYPH_H <freetype/ftglyph.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BITMAP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API of the optional bitmap conversion component.
|
||||
*
|
||||
*/
|
||||
#define FT_BITMAP_H <freetype/ftbitmap.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_BBOX_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API of the optional exact bounding box computation routines.
|
||||
*
|
||||
*/
|
||||
#define FT_BBOX_H <freetype/ftbbox.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CACHE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* API of the optional FreeType~2 cache sub-system.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_H <freetype/ftcache.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CACHE_IMAGE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* `glyph image' API of the FreeType~2 cache sub-system.
|
||||
*
|
||||
* It is used to define a cache for @FT_Glyph elements. You can also
|
||||
* use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
|
||||
* store small glyph bitmaps, as it will use less memory.
|
||||
*
|
||||
* This macro is deprecated. Simply include @FT_CACHE_H to have all
|
||||
* glyph image-related cache declarations.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_IMAGE_H FT_CACHE_H
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CACHE_SMALL_BITMAPS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* `small bitmaps' API of the FreeType~2 cache sub-system.
|
||||
*
|
||||
* It is used to define a cache for small glyph bitmaps in a relatively
|
||||
* memory-efficient way. You can also use the API defined in
|
||||
* @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
|
||||
* including scalable outlines.
|
||||
*
|
||||
* This macro is deprecated. Simply include @FT_CACHE_H to have all
|
||||
* small bitmaps-related cache declarations.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_CACHE_CHARMAP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* `charmap' API of the FreeType~2 cache sub-system.
|
||||
*
|
||||
* This macro is deprecated. Simply include @FT_CACHE_H to have all
|
||||
* charmap-based cache declarations.
|
||||
*
|
||||
*/
|
||||
#define FT_CACHE_CHARMAP_H FT_CACHE_H
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MAC_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* Macintosh-specific FreeType~2 API. The latter is used to access
|
||||
* fonts embedded in resource forks.
|
||||
*
|
||||
* This header file must be explicitly included by client applications
|
||||
* compiled on the Mac (note that the base API still works though).
|
||||
*
|
||||
*/
|
||||
#define FT_MAC_H <freetype/ftmac.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_MULTIPLE_MASTERS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* optional multiple-masters management API of FreeType~2.
|
||||
*
|
||||
*/
|
||||
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SFNT_NAMES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* optional FreeType~2 API which accesses embedded `name' strings in
|
||||
* SFNT-based font formats (i.e., TrueType and OpenType).
|
||||
*
|
||||
*/
|
||||
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_OPENTYPE_VALIDATE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
|
||||
* GPOS, GSUB, JSTF).
|
||||
*
|
||||
*/
|
||||
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GX_VALIDATE_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
|
||||
* mort, morx, bsln, just, kern, opbd, trak, prop).
|
||||
*
|
||||
*/
|
||||
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_PFR_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which accesses PFR-specific data.
|
||||
*
|
||||
*/
|
||||
#define FT_PFR_H <freetype/ftpfr.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_STROKER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which provides functions to stroke outline paths.
|
||||
*/
|
||||
#define FT_STROKER_H <freetype/ftstroke.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_SYNTHESIS_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which performs artificial obliquing and emboldening.
|
||||
*/
|
||||
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_XFREE86_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which provides functions specific to the XFree86 and
|
||||
* X.Org X11 servers.
|
||||
*/
|
||||
#define FT_XFREE86_H <freetype/ftxf86.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_TRIGONOMETRY_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which performs trigonometric computations (e.g.,
|
||||
* cosines and arc tangents).
|
||||
*/
|
||||
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_LCD_FILTER_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which performs color filtering for subpixel rendering.
|
||||
*/
|
||||
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_UNPATENTED_HINTING_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which performs color filtering for subpixel rendering.
|
||||
*/
|
||||
#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_INCREMENTAL_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which performs color filtering for subpixel rendering.
|
||||
*/
|
||||
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_GASP_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which returns entries from the TrueType GASP table.
|
||||
*/
|
||||
#define FT_GASP_H <freetype/ftgasp.h>
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_ADVANCES_H
|
||||
*
|
||||
* @description:
|
||||
* A macro used in #include statements to name the file containing the
|
||||
* FreeType~2 API which returns individual and ranged glyph advances.
|
||||
*/
|
||||
#define FT_ADVANCES_H <freetype/ftadvanc.h>
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
|
||||
|
||||
|
||||
/* The internals of the cache sub-system are no longer exposed. We */
|
||||
/* default to FT_CACHE_H at the moment just in case, but we know of */
|
||||
/* no rogue client that uses them. */
|
||||
/* */
|
||||
#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h>
|
||||
#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h>
|
||||
|
||||
|
||||
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
|
||||
|
||||
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
|
||||
|
||||
|
||||
/*
|
||||
* Include internal headers definitions from <freetype/internal/...>
|
||||
* only when building the library.
|
||||
*/
|
||||
#ifdef FT2_BUILD_LIBRARY
|
||||
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
|
||||
#include FT_INTERNAL_INTERNAL_H
|
||||
#endif /* FT2_BUILD_LIBRARY */
|
||||
|
||||
|
||||
#endif /* __FT2_BUILD_H__ */
|
||||
|
||||
|
||||
/* END */
|
19
deps/freetype/include/freetype/config/ftmodule.h
vendored
Normal file
19
deps/freetype/include/freetype/config/ftmodule.h
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* This file registers the FreeType modules compiled into the library.
|
||||
*
|
||||
* If you use GNU make, this file IS NOT USED! Instead, it is created in
|
||||
* the objects directory (normally `<topdir>/objs/') based on information
|
||||
* from `<topdir>/modules.cfg'.
|
||||
*
|
||||
* Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
|
||||
* FreeType without GNU make.
|
||||
*
|
||||
*/
|
||||
|
||||
FT_USE_MODULE( FT_Module_Class, autofit_module_class )
|
||||
FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
|
||||
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
|
||||
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
|
||||
|
||||
/* EOF */
|
805
deps/freetype/include/freetype/config/ftoption.h
vendored
Normal file
805
deps/freetype/include/freetype/config/ftoption.h
vendored
Normal file
|
@ -0,0 +1,805 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftoption.h */
|
||||
/* */
|
||||
/* User-selectable configuration macros (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2012 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTOPTION_H__
|
||||
#define __FTOPTION_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* USER-SELECTABLE CONFIGURATION MACROS */
|
||||
/* */
|
||||
/* This file contains the default configuration macro definitions for */
|
||||
/* a standard build of the FreeType library. There are three ways to */
|
||||
/* use this file to build project-specific versions of the library: */
|
||||
/* */
|
||||
/* - You can modify this file by hand, but this is not recommended in */
|
||||
/* cases where you would like to build several versions of the */
|
||||
/* library from a single source directory. */
|
||||
/* */
|
||||
/* - You can put a copy of this file in your build directory, more */
|
||||
/* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */
|
||||
/* is the name of a directory that is included _before_ the FreeType */
|
||||
/* include path during compilation. */
|
||||
/* */
|
||||
/* The default FreeType Makefiles and Jamfiles use the build */
|
||||
/* directory `builds/<system>' by default, but you can easily change */
|
||||
/* that for your own projects. */
|
||||
/* */
|
||||
/* - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it */
|
||||
/* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
|
||||
/* locate this file during the build. For example, */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
|
||||
/* #include <freetype/config/ftheader.h> */
|
||||
/* */
|
||||
/* will use `$BUILD/myftoptions.h' instead of this file for macro */
|
||||
/* definitions. */
|
||||
/* */
|
||||
/* Note also that you can similarly pre-define the macro */
|
||||
/* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
|
||||
/* that are statically linked to the library at compile time. By */
|
||||
/* default, this file is <freetype/config/ftmodule.h>. */
|
||||
/* */
|
||||
/* We highly recommend using the third method whenever possible. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Uncomment the line below if you want to activate sub-pixel rendering */
|
||||
/* (a.k.a. LCD rendering, or ClearType) in this build of the library. */
|
||||
/* */
|
||||
/* Note that this feature is covered by several Microsoft patents */
|
||||
/* and should not be activated in any default build of the library. */
|
||||
/* */
|
||||
/* This macro has no impact on the FreeType API, only on its */
|
||||
/* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */
|
||||
/* FT_Render_Glyph still generates a bitmap that is 3 times wider than */
|
||||
/* the original size in case this macro isn't defined; however, each */
|
||||
/* triplet of subpixels has R=G=B. */
|
||||
/* */
|
||||
/* This is done to allow FreeType clients to run unmodified, forcing */
|
||||
/* them to display normal gray-level anti-aliased glyphs. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Many compilers provide a non-ANSI 64-bit data type that can be used */
|
||||
/* by FreeType to speed up some computations. However, this will create */
|
||||
/* some problems when compiling the library in strict ANSI mode. */
|
||||
/* */
|
||||
/* For this reason, the use of 64-bit integers is normally disabled when */
|
||||
/* the __STDC__ macro is defined. You can however disable this by */
|
||||
/* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */
|
||||
/* */
|
||||
/* For most compilers, this will only create compilation warnings when */
|
||||
/* building the library. */
|
||||
/* */
|
||||
/* ObNote: The compiler-specific 64-bit integers are detected in the */
|
||||
/* file `ftconfig.h' either statically or through the */
|
||||
/* `configure' script on supported platforms. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_FORCE_INT64
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* If this macro is defined, do not try to use an assembler version of */
|
||||
/* performance-critical functions (e.g. FT_MulFix). You should only do */
|
||||
/* that to verify that the assembler function works properly, or to */
|
||||
/* execute benchmark tests of the various implementations. */
|
||||
/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* If this macro is defined, try to use an inlined assembler version of */
|
||||
/* the `FT_MulFix' function, which is a `hotspot' when loading and */
|
||||
/* hinting glyphs, and which should be executed as fast as possible. */
|
||||
/* */
|
||||
/* Note that if your compiler or CPU is not supported, this will default */
|
||||
/* to the standard and portable implementation found in `ftcalc.c'. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_INLINE_MULFIX
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* LZW-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* `compress' program. This is mostly used to parse many of the PCF */
|
||||
/* files that come with various X11 distributions. The implementation */
|
||||
/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
|
||||
/* (see src/lzw/ftgzip.c). */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_USE_LZW */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Gzip-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* `gzip' program. This is mostly used to parse many of the PCF files */
|
||||
/* that come with XFree86. The implementation uses `zlib' to */
|
||||
/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. See also */
|
||||
/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_USE_ZLIB */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* ZLib library selection */
|
||||
/* */
|
||||
/* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
|
||||
/* It allows FreeType's `ftgzip' component to link to the system's */
|
||||
/* installation of the ZLib library. This is useful on systems like */
|
||||
/* Unix or VMS where it generally is already available. */
|
||||
/* */
|
||||
/* If you let it undefined, the component will use its own copy */
|
||||
/* of the zlib sources instead. These have been modified to be */
|
||||
/* included directly within the component and *not* export external */
|
||||
/* function names. This allows you to link any program with FreeType */
|
||||
/* _and_ ZLib without linking conflicts. */
|
||||
/* */
|
||||
/* Do not #undef this macro here since the build system might define */
|
||||
/* it for certain configurations only. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Bzip2-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* `bzip2' program. This is mostly used to parse many of the PCF */
|
||||
/* files that come with XFree86. The implementation uses `libbz2' to */
|
||||
/* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */
|
||||
/* Contrary to gzip, bzip2 currently is not included and need to use */
|
||||
/* the system available bzip2 implementation. */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_USE_BZIP2 */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define to disable the use of file stream functions and types, FILE, */
|
||||
/* fopen() etc. Enables the use of smaller system libraries on embedded */
|
||||
/* systems that have multiple system libraries, some with or without */
|
||||
/* file stream support, in the cases where file stream support is not */
|
||||
/* necessary such as memory loading of font files. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* DLL export compilation */
|
||||
/* */
|
||||
/* When compiling FreeType as a DLL, some systems/compilers need a */
|
||||
/* special keyword in front OR after the return type of function */
|
||||
/* declarations. */
|
||||
/* */
|
||||
/* Two macros are used within the FreeType source code to define */
|
||||
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
|
||||
/* */
|
||||
/* FT_EXPORT( return_type ) */
|
||||
/* */
|
||||
/* is used in a function declaration, as in */
|
||||
/* */
|
||||
/* FT_EXPORT( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ); */
|
||||
/* */
|
||||
/* */
|
||||
/* FT_EXPORT_DEF( return_type ) */
|
||||
/* */
|
||||
/* is used in a function definition, as in */
|
||||
/* */
|
||||
/* FT_EXPORT_DEF( FT_Error ) */
|
||||
/* FT_Init_FreeType( FT_Library* alibrary ) */
|
||||
/* { */
|
||||
/* ... some code ... */
|
||||
/* return FT_Err_Ok; */
|
||||
/* } */
|
||||
/* */
|
||||
/* You can provide your own implementation of FT_EXPORT and */
|
||||
/* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
|
||||
/* will be later automatically defined as `extern return_type' to */
|
||||
/* allow normal compilation. */
|
||||
/* */
|
||||
/* Do not #undef these macros here since the build system might define */
|
||||
/* them for certain configurations only. */
|
||||
/* */
|
||||
/* #define FT_EXPORT(x) extern x */
|
||||
/* #define FT_EXPORT_DEF(x) x */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Glyph Postscript Names handling */
|
||||
/* */
|
||||
/* By default, FreeType 2 is compiled with the `psnames' module. This */
|
||||
/* module is in charge of converting a glyph name string into a */
|
||||
/* Unicode value, or return a Macintosh standard glyph name for the */
|
||||
/* use with the TrueType `post' table. */
|
||||
/* */
|
||||
/* Undefine this macro if you do not want `psnames' compiled in your */
|
||||
/* build of FreeType. This has the following effects: */
|
||||
/* */
|
||||
/* - The TrueType driver will provide its own set of glyph names, */
|
||||
/* if you build it to support postscript names in the TrueType */
|
||||
/* `post' table. */
|
||||
/* */
|
||||
/* - The Type 1 driver will not be able to synthesize a Unicode */
|
||||
/* charmap out of the glyphs found in the fonts. */
|
||||
/* */
|
||||
/* You would normally undefine this configuration macro when building */
|
||||
/* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_POSTSCRIPT_NAMES */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Postscript Names to Unicode Values support */
|
||||
/* */
|
||||
/* By default, FreeType 2 is built with the `PSNames' module compiled */
|
||||
/* in. Among other things, the module is used to convert a glyph name */
|
||||
/* into a Unicode value. This is especially useful in order to */
|
||||
/* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */
|
||||
/* through a big table named the `Adobe Glyph List' (AGL). */
|
||||
/* */
|
||||
/* Undefine this macro if you do not want the Adobe Glyph List */
|
||||
/* compiled in your `PSNames' module. The Type 1 driver will not be */
|
||||
/* able to synthesize a Unicode charmap out of the glyphs found in the */
|
||||
/* fonts. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Support for Mac fonts */
|
||||
/* */
|
||||
/* Define this macro if you want support for outline fonts in Mac */
|
||||
/* format (mac dfont, mac resource, macbinary containing a mac */
|
||||
/* resource) on non-Mac platforms. */
|
||||
/* */
|
||||
/* Note that the `FOND' resource isn't checked. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_MAC_FONTS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Guessing methods to access embedded resource forks */
|
||||
/* */
|
||||
/* Enable extra Mac fonts support on non-Mac platforms (e.g. */
|
||||
/* GNU/Linux). */
|
||||
/* */
|
||||
/* Resource forks which include fonts data are stored sometimes in */
|
||||
/* locations which users or developers don't expected. In some cases, */
|
||||
/* resource forks start with some offset from the head of a file. In */
|
||||
/* other cases, the actual resource fork is stored in file different */
|
||||
/* from what the user specifies. If this option is activated, */
|
||||
/* FreeType tries to guess whether such offsets or different file */
|
||||
/* names must be used. */
|
||||
/* */
|
||||
/* Note that normal, direct access of resource forks is controlled via */
|
||||
/* the FT_CONFIG_OPTION_MAC_FONTS option. */
|
||||
/* */
|
||||
#ifdef FT_CONFIG_OPTION_MAC_FONTS
|
||||
#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Allow the use of FT_Incremental_Interface to load typefaces that */
|
||||
/* contain no glyph data, but supply it via a callback function. */
|
||||
/* This is required by clients supporting document formats which */
|
||||
/* supply font data incrementally as the document is parsed, such */
|
||||
/* as the Ghostscript interpreter for the PostScript language. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_INCREMENTAL */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The size in bytes of the render pool used by the scan-line converter */
|
||||
/* to do all of its work. */
|
||||
/* */
|
||||
/* This must be greater than 4KByte if you use FreeType to rasterize */
|
||||
/* glyphs; otherwise, you may set it to zero to avoid unnecessary */
|
||||
/* allocation of the render pool. */
|
||||
/* */
|
||||
#define FT_RENDER_POOL_SIZE 16384L
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* FT_MAX_MODULES */
|
||||
/* */
|
||||
/* The maximum number of modules that can be registered in a single */
|
||||
/* FreeType library object. 32 is the default. */
|
||||
/* */
|
||||
#define FT_MAX_MODULES 32
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Debug level */
|
||||
/* */
|
||||
/* FreeType can be compiled in debug or trace mode. In debug mode, */
|
||||
/* errors are reported through the `ftdebug' component. In trace */
|
||||
/* mode, additional messages are sent to the standard output during */
|
||||
/* execution. */
|
||||
/* */
|
||||
/* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
|
||||
/* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
|
||||
/* */
|
||||
/* Don't define any of these macros to compile in `release' mode! */
|
||||
/* */
|
||||
/* Do not #undef these macros here since the build system might define */
|
||||
/* them for certain configurations only. */
|
||||
/* */
|
||||
/* #define FT_DEBUG_LEVEL_ERROR */
|
||||
/* #define FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Autofitter debugging */
|
||||
/* */
|
||||
/* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */
|
||||
/* control the autofitter behaviour for debugging purposes with global */
|
||||
/* boolean variables (consequently, you should *never* enable this */
|
||||
/* while compiling in `release' mode): */
|
||||
/* */
|
||||
/* _af_debug_disable_horz_hints */
|
||||
/* _af_debug_disable_vert_hints */
|
||||
/* _af_debug_disable_blue_hints */
|
||||
/* */
|
||||
/* Additionally, the following functions provide dumps of various */
|
||||
/* internal autofit structures to stdout (using `printf'): */
|
||||
/* */
|
||||
/* af_glyph_hints_dump_points */
|
||||
/* af_glyph_hints_dump_segments */
|
||||
/* af_glyph_hints_dump_edges */
|
||||
/* */
|
||||
/* As an argument, they use another global variable: */
|
||||
/* */
|
||||
/* _af_debug_hints */
|
||||
/* */
|
||||
/* Please have a look at the `ftgrid' demo program to see how those */
|
||||
/* variables and macros should be used. */
|
||||
/* */
|
||||
/* Do not #undef these macros here since the build system might define */
|
||||
/* them for certain configurations only. */
|
||||
/* */
|
||||
/* #define FT_DEBUG_AUTOFIT */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Memory Debugging */
|
||||
/* */
|
||||
/* FreeType now comes with an integrated memory debugger that is */
|
||||
/* capable of detecting simple errors like memory leaks or double */
|
||||
/* deletes. To compile it within your build of the library, you */
|
||||
/* should define FT_DEBUG_MEMORY here. */
|
||||
/* */
|
||||
/* Note that the memory debugger is only activated at runtime when */
|
||||
/* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */
|
||||
/* */
|
||||
/* Do not #undef this macro here since the build system might define */
|
||||
/* it for certain configurations only. */
|
||||
/* */
|
||||
/* #define FT_DEBUG_MEMORY */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Module errors */
|
||||
/* */
|
||||
/* If this macro is set (which is _not_ the default), the higher byte */
|
||||
/* of an error code gives the module in which the error has occurred, */
|
||||
/* while the lower byte is the real error code. */
|
||||
/* */
|
||||
/* Setting this macro makes sense for debugging purposes only, since */
|
||||
/* it would break source compatibility of certain programs that use */
|
||||
/* FreeType 2. */
|
||||
/* */
|
||||
/* More details can be found in the files ftmoderr.h and fterrors.h. */
|
||||
/* */
|
||||
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Position Independent Code */
|
||||
/* */
|
||||
/* If this macro is set (which is _not_ the default), FreeType2 will */
|
||||
/* avoid creating constants that require address fixups. Instead the */
|
||||
/* constants will be moved into a struct and additional intialization */
|
||||
/* code will be used. */
|
||||
/* */
|
||||
/* Setting this macro is needed for systems that prohibit address */
|
||||
/* fixups, such as BREW. */
|
||||
/* */
|
||||
/* #define FT_CONFIG_OPTION_PIC */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** S F N T D R I V E R C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
|
||||
/* embedded bitmaps in all formats using the SFNT module (namely */
|
||||
/* TrueType & OpenType). */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
|
||||
/* load and enumerate the glyph Postscript names in a TrueType or */
|
||||
/* OpenType file. */
|
||||
/* */
|
||||
/* Note that when you do not compile the `PSNames' module by undefining */
|
||||
/* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
|
||||
/* contain additional code used to read the PS Names table from a font. */
|
||||
/* */
|
||||
/* (By default, the module uses `PSNames' to extract glyph names.) */
|
||||
/* */
|
||||
/* #define TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
|
||||
/* access the internal name table in a SFNT-based format like TrueType */
|
||||
/* or OpenType. The name table contains various strings used to */
|
||||
/* describe the font, like family name, copyright, version, etc. It */
|
||||
/* does not contain any glyph name though. */
|
||||
/* */
|
||||
/* Accessing SFNT names is done through the functions declared in */
|
||||
/* `freetype/ftsnames.h'. */
|
||||
/* */
|
||||
/* #define TT_CONFIG_OPTION_SFNT_NAMES */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* TrueType CMap support */
|
||||
/* */
|
||||
/* Here you can fine-tune which TrueType CMap table format shall be */
|
||||
/* supported. */
|
||||
#define TT_CONFIG_CMAP_FORMAT_0
|
||||
#define TT_CONFIG_CMAP_FORMAT_2
|
||||
#define TT_CONFIG_CMAP_FORMAT_4
|
||||
#define TT_CONFIG_CMAP_FORMAT_6
|
||||
#define TT_CONFIG_CMAP_FORMAT_8
|
||||
#define TT_CONFIG_CMAP_FORMAT_10
|
||||
#define TT_CONFIG_CMAP_FORMAT_12
|
||||
#define TT_CONFIG_CMAP_FORMAT_13
|
||||
#define TT_CONFIG_CMAP_FORMAT_14
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
|
||||
/* a bytecode interpreter in the TrueType driver. */
|
||||
/* */
|
||||
/* By undefining this, you will only compile the code necessary to load */
|
||||
/* TrueType glyphs without hinting. */
|
||||
/* */
|
||||
/* Do not #undef this macro here, since the build system might */
|
||||
/* define it for certain configurations only. */
|
||||
/* */
|
||||
/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
|
||||
/* of the TrueType bytecode interpreter is used that doesn't implement */
|
||||
/* any of the patented opcodes and algorithms. The patents related to */
|
||||
/* TrueType hinting have expired worldwide since May 2010; this option */
|
||||
/* is now deprecated. */
|
||||
/* */
|
||||
/* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */
|
||||
/* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */
|
||||
/* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */
|
||||
/* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */
|
||||
/* */
|
||||
/* This macro is only useful for a small number of font files (mostly */
|
||||
/* for Asian scripts) that require bytecode interpretation to properly */
|
||||
/* load glyphs. For all other fonts, this produces unpleasant results, */
|
||||
/* thus the unpatented interpreter is never used to load glyphs from */
|
||||
/* TrueType fonts unless one of the following two options is used. */
|
||||
/* */
|
||||
/* - The unpatented interpreter is explicitly activated by the user */
|
||||
/* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */
|
||||
/* when opening the FT_Face. */
|
||||
/* */
|
||||
/* - FreeType detects that the FT_Face corresponds to one of the */
|
||||
/* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */
|
||||
/* contains a hard-coded list of font names and other matching */
|
||||
/* parameters (see function `tt_face_init' in file */
|
||||
/* `src/truetype/ttobjs.c'). */
|
||||
/* */
|
||||
/* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */
|
||||
/* */
|
||||
/* { */
|
||||
/* FT_Parameter parameter; */
|
||||
/* FT_Open_Args open_args; */
|
||||
/* */
|
||||
/* */
|
||||
/* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */
|
||||
/* */
|
||||
/* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */
|
||||
/* open_args.pathname = my_font_pathname; */
|
||||
/* open_args.num_params = 1; */
|
||||
/* open_args.params = ¶meter; */
|
||||
/* */
|
||||
/* error = FT_Open_Face( library, &open_args, index, &face ); */
|
||||
/* ... */
|
||||
/* } */
|
||||
/* */
|
||||
/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
|
||||
/* bytecode interpreter with a huge switch statement, rather than a call */
|
||||
/* table. This results in smaller and faster code for a number of */
|
||||
/* architectures. */
|
||||
/* */
|
||||
/* Note however that on some compiler/processor combinations, undefining */
|
||||
/* this macro will generate faster, though larger, code. */
|
||||
/* */
|
||||
#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
|
||||
/* TrueType glyph loader to use Apple's definition of how to handle */
|
||||
/* component offsets in composite glyphs. */
|
||||
/* */
|
||||
/* Apple and MS disagree on the default behavior of component offsets */
|
||||
/* in composites. Apple says that they should be scaled by the scaling */
|
||||
/* factors in the transformation matrix (roughly, it's more complex) */
|
||||
/* while MS says they should not. OpenType defines two bits in the */
|
||||
/* composite flags array which can be used to disambiguate, but old */
|
||||
/* fonts will not have them. */
|
||||
/* */
|
||||
/* http://www.microsoft.com/typography/otspec/glyf.htm */
|
||||
/* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
|
||||
/* */
|
||||
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */
|
||||
/* support for Apple's distortable font technology (fvar, gvar, cvar, */
|
||||
/* and avar tables). This has many similarities to Type 1 Multiple */
|
||||
/* Masters support. */
|
||||
/* */
|
||||
/* #define TT_CONFIG_OPTION_GX_VAR_SUPPORT */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define TT_CONFIG_OPTION_BDF if you want to include support for */
|
||||
/* an embedded `BDF ' table within SFNT-based bitmap formats. */
|
||||
/* */
|
||||
/* #define TT_CONFIG_OPTION_BDF */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */
|
||||
/* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
|
||||
/* required. */
|
||||
/* */
|
||||
#define T1_MAX_DICT_DEPTH 5
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
|
||||
/* calls during glyph loading. */
|
||||
/* */
|
||||
#define T1_MAX_SUBRS_CALLS 16
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
|
||||
/* minimum of 16 is required. */
|
||||
/* */
|
||||
/* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
|
||||
/* */
|
||||
#define T1_MAX_CHARSTRINGS_OPERANDS 256
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define this configuration macro if you want to prevent the */
|
||||
/* compilation of `t1afm', which is in charge of reading Type 1 AFM */
|
||||
/* files into an existing face. Note that if set, the T1 driver will be */
|
||||
/* unable to produce kerning distances. */
|
||||
/* */
|
||||
#undef T1_CONFIG_OPTION_NO_AFM
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Define this configuration macro if you want to prevent the */
|
||||
/* compilation of the Multiple Masters font support in the Type 1 */
|
||||
/* driver. */
|
||||
/* */
|
||||
#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/**** ****/
|
||||
/**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/
|
||||
/**** ****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Compile autofit module with CJK (Chinese, Japanese, Korean) script */
|
||||
/* support. */
|
||||
/* */
|
||||
#define AF_CONFIG_OPTION_CJK
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Compile autofit module with Indic script support. */
|
||||
/* */
|
||||
#define AF_CONFIG_OPTION_INDIC
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Compile autofit module with warp hinting. The idea of the warping */
|
||||
/* code is to slightly scale and shift a glyph within a single dimension */
|
||||
/* so that as much of its segments are aligned (more or less) on the */
|
||||
/* grid. To find out the optimal scaling and shifting value, various */
|
||||
/* parameter combinations are tried and scored. */
|
||||
/* */
|
||||
/* This experimental option is only active if the render mode is */
|
||||
/* FT_RENDER_MODE_LIGHT. */
|
||||
/* */
|
||||
/* #define AF_CONFIG_OPTION_USE_WARPER */
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/*
|
||||
* Define this variable if you want to keep the layout of internal
|
||||
* structures that was used prior to FreeType 2.2. This also compiles in
|
||||
* a few obsolete functions to avoid linking problems on typical Unix
|
||||
* distributions.
|
||||
*
|
||||
* For embedded systems or building a new distribution from scratch, it
|
||||
* is recommended to disable the macro since it reduces the library's code
|
||||
* size and activates a few memory-saving optimizations as well.
|
||||
*/
|
||||
#define FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
|
||||
|
||||
/*
|
||||
* To detect legacy cache-lookup call from a rogue client (<= 2.1.7),
|
||||
* we restrict the number of charmaps in a font. The current API of
|
||||
* FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API
|
||||
* takes charcode only. To determine the passed value is for cmap_index
|
||||
* or charcode, the possible cmap_index is restricted not to exceed
|
||||
* the minimum possible charcode by a rogue client. It is also very
|
||||
* unlikely that a rogue client is interested in Unicode values 0 to 15.
|
||||
*
|
||||
* NOTE: The original threshold was 4 deduced from popular number of
|
||||
* cmap subtables in UCS-4 TrueType fonts, but now it is not
|
||||
* irregular for OpenType fonts to have more than 4 subtables,
|
||||
* because variation selector subtables are available for Apple
|
||||
* and Microsoft platforms.
|
||||
*/
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
|
||||
#define FT_MAX_CHARMAP_CACHEABLE 15
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* This macro is defined if either unpatented or native TrueType
|
||||
* hinting is requested by the definitions above.
|
||||
*/
|
||||
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
#define TT_USE_BYTECODE_INTERPRETER
|
||||
#undef TT_CONFIG_OPTION_UNPATENTED_HINTING
|
||||
#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING
|
||||
#define TT_USE_BYTECODE_INTERPRETER
|
||||
#endif
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTOPTION_H__ */
|
||||
|
||||
|
||||
/* END */
|
174
deps/freetype/include/freetype/config/ftstdlib.h
vendored
Normal file
174
deps/freetype/include/freetype/config/ftstdlib.h
vendored
Normal file
|
@ -0,0 +1,174 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftstdlib.h */
|
||||
/* */
|
||||
/* ANSI-specific library and header configuration file (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 2002-2007, 2009, 2011 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file is used to group all #includes to the ANSI C library that */
|
||||
/* FreeType normally requires. It also defines macros to rename the */
|
||||
/* standard functions within the FreeType source code. */
|
||||
/* */
|
||||
/* Load a file which defines __FTSTDLIB_H__ before this one to override */
|
||||
/* it. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTSTDLIB_H__
|
||||
#define __FTSTDLIB_H__
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define ft_ptrdiff_t ptrdiff_t
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* integer limits */
|
||||
/* */
|
||||
/* UINT_MAX and ULONG_MAX are used to automatically compute the size */
|
||||
/* of `int' and `long' in bytes at compile-time. So far, this works */
|
||||
/* for all platforms the library has been tested on. */
|
||||
/* */
|
||||
/* Note that on the extremely rare platforms that do not provide */
|
||||
/* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
|
||||
/* old Crays where `int' is 36 bits), we do not make any guarantee */
|
||||
/* about the correct behaviour of FT2 with all fonts. */
|
||||
/* */
|
||||
/* In these case, `ftconfig.h' will refuse to compile anyway with a */
|
||||
/* message like `couldn't find 32-bit type' or something similar. */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
#define FT_USHORT_MAX USHRT_MAX
|
||||
#define FT_INT_MAX INT_MAX
|
||||
#define FT_INT_MIN INT_MIN
|
||||
#define FT_UINT_MAX UINT_MAX
|
||||
#define FT_ULONG_MAX ULONG_MAX
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* character and string processing */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define ft_memchr memchr
|
||||
#define ft_memcmp memcmp
|
||||
#define ft_memcpy memcpy
|
||||
#define ft_memmove memmove
|
||||
#define ft_memset memset
|
||||
#define ft_strcat strcat
|
||||
#define ft_strcmp strcmp
|
||||
#define ft_strcpy strcpy
|
||||
#define ft_strlen strlen
|
||||
#define ft_strncmp strncmp
|
||||
#define ft_strncpy strncpy
|
||||
#define ft_strrchr strrchr
|
||||
#define ft_strstr strstr
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* file handling */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define FT_FILE FILE
|
||||
#define ft_fclose fclose
|
||||
#define ft_fopen fopen
|
||||
#define ft_fread fread
|
||||
#define ft_fseek fseek
|
||||
#define ft_ftell ftell
|
||||
#define ft_sprintf sprintf
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* sorting */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ft_qsort qsort
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* memory allocation */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#define ft_scalloc calloc
|
||||
#define ft_sfree free
|
||||
#define ft_smalloc malloc
|
||||
#define ft_srealloc realloc
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* miscellaneous */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#define ft_atol atol
|
||||
#define ft_labs labs
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* execution control */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
|
||||
/* jmp_buf is defined as a macro */
|
||||
/* on certain platforms */
|
||||
|
||||
#define ft_longjmp longjmp
|
||||
#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */
|
||||
|
||||
|
||||
/* the following is only used for debugging purposes, i.e., if */
|
||||
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
#endif /* __FTSTDLIB_H__ */
|
||||
|
||||
|
||||
/* END */
|
3963
deps/freetype/include/freetype/freetype.h
vendored
Normal file
3963
deps/freetype/include/freetype/freetype.h
vendored
Normal file
File diff suppressed because it is too large
Load diff
179
deps/freetype/include/freetype/ftadvanc.h
vendored
Normal file
179
deps/freetype/include/freetype/ftadvanc.h
vendored
Normal file
|
@ -0,0 +1,179 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftadvanc.h */
|
||||
/* */
|
||||
/* Quick computation of advance widths (specification only). */
|
||||
/* */
|
||||
/* Copyright 2008 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTADVANC_H__
|
||||
#define __FTADVANC_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @section:
|
||||
* quick_advance
|
||||
*
|
||||
* @title:
|
||||
* Quick retrieval of advance values
|
||||
*
|
||||
* @abstract:
|
||||
* Retrieve horizontal and vertical advance values without processing
|
||||
* glyph outlines, if possible.
|
||||
*
|
||||
* @description:
|
||||
* This section contains functions to quickly extract advance values
|
||||
* without handling glyph outlines, if possible.
|
||||
*/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Const> */
|
||||
/* FT_ADVANCE_FLAG_FAST_ONLY */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A bit-flag to be OR-ed with the `flags' parameter of the */
|
||||
/* @FT_Get_Advance and @FT_Get_Advances functions. */
|
||||
/* */
|
||||
/* If set, it indicates that you want these functions to fail if the */
|
||||
/* corresponding hinting mode or font driver doesn't allow for very */
|
||||
/* quick advance computation. */
|
||||
/* */
|
||||
/* Typically, glyphs which are either unscaled, unhinted, bitmapped, */
|
||||
/* or light-hinted can have their advance width computed very */
|
||||
/* quickly. */
|
||||
/* */
|
||||
/* Normal and bytecode hinted modes, which require loading, scaling, */
|
||||
/* and hinting of the glyph outline, are extremely slow by */
|
||||
/* comparison. */
|
||||
/* */
|
||||
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Advance */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieve the advance value of a given glyph outline in an */
|
||||
/* @FT_Face. By default, the unhinted advance is returned in font */
|
||||
/* units. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The source @FT_Face handle. */
|
||||
/* */
|
||||
/* gindex :: The glyph index. */
|
||||
/* */
|
||||
/* load_flags :: A set of bit flags similar to those used when */
|
||||
/* calling @FT_Load_Glyph, used to determine what kind */
|
||||
/* of advances you need. */
|
||||
/* <Output> */
|
||||
/* padvance :: The advance value, in either font units or 16.16 */
|
||||
/* format. */
|
||||
/* */
|
||||
/* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
|
||||
/* vertical advance corresponding to a vertical layout. */
|
||||
/* Otherwise, it is the horizontal advance in a */
|
||||
/* horizontal layout. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
|
||||
/* if the corresponding font backend doesn't have a quick way to */
|
||||
/* retrieve the advances. */
|
||||
/* */
|
||||
/* A scaled advance is returned in 16.16 format but isn't transformed */
|
||||
/* by the affine transformation specified by @FT_Set_Transform. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_Advance( FT_Face face,
|
||||
FT_UInt gindex,
|
||||
FT_Int32 load_flags,
|
||||
FT_Fixed *padvance );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Get_Advances */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieve the advance values of several glyph outlines in an */
|
||||
/* @FT_Face. By default, the unhinted advances are returned in font */
|
||||
/* units. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* face :: The source @FT_Face handle. */
|
||||
/* */
|
||||
/* start :: The first glyph index. */
|
||||
/* */
|
||||
/* count :: The number of advance values you want to retrieve. */
|
||||
/* */
|
||||
/* load_flags :: A set of bit flags similar to those used when */
|
||||
/* calling @FT_Load_Glyph. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* padvance :: The advances, in either font units or 16.16 format. */
|
||||
/* This array must contain at least `count' elements. */
|
||||
/* */
|
||||
/* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
|
||||
/* vertical advances corresponding to a vertical layout. */
|
||||
/* Otherwise, they are the horizontal advances in a */
|
||||
/* horizontal layout. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
|
||||
/* if the corresponding font backend doesn't have a quick way to */
|
||||
/* retrieve the advances. */
|
||||
/* */
|
||||
/* Scaled advances are returned in 16.16 format but aren't */
|
||||
/* transformed by the affine transformation specified by */
|
||||
/* @FT_Set_Transform. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_Advances( FT_Face face,
|
||||
FT_UInt start,
|
||||
FT_UInt count,
|
||||
FT_Int32 load_flags,
|
||||
FT_Fixed *padvances );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTADVANC_H__ */
|
||||
|
||||
|
||||
/* END */
|
102
deps/freetype/include/freetype/ftbbox.h
vendored
Normal file
102
deps/freetype/include/freetype/ftbbox.h
vendored
Normal file
|
@ -0,0 +1,102 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftbbox.h */
|
||||
/* */
|
||||
/* FreeType exact bbox computation (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2003, 2007, 2011 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This component has a _single_ role: to compute exact outline bounding */
|
||||
/* boxes. */
|
||||
/* */
|
||||
/* It is separated from the rest of the engine for various technical */
|
||||
/* reasons. It may well be integrated in `ftoutln' later. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTBBOX_H__
|
||||
#define __FTBBOX_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* outline_processing */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Outline_Get_BBox */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Compute the exact bounding box of an outline. This is slower */
|
||||
/* than computing the control box. However, it uses an advanced */
|
||||
/* algorithm which returns _very_ quickly when the two boxes */
|
||||
/* coincide. Otherwise, the outline Bézier arcs are traversed to */
|
||||
/* extract their extrema. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* outline :: A pointer to the source outline. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* abbox :: The outline's exact bounding box. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0~means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* If the font is tricky and the glyph has been loaded with */
|
||||
/* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
|
||||
/* reasonable values for the BBox it is necessary to load the glyph */
|
||||
/* at a large ppem value (so that the hinting instructions can */
|
||||
/* properly shift and scale the subglyphs), then extracting the BBox */
|
||||
/* which can be eventually converted back to font units. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Outline_Get_BBox( FT_Outline* outline,
|
||||
FT_BBox *abbox );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTBBOX_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
||||
|
||||
/* Local Variables: */
|
||||
/* coding: utf-8 */
|
||||
/* End: */
|
209
deps/freetype/include/freetype/ftbdf.h
vendored
Normal file
209
deps/freetype/include/freetype/ftbdf.h
vendored
Normal file
|
@ -0,0 +1,209 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftbdf.h */
|
||||
/* */
|
||||
/* FreeType API for accessing BDF-specific strings (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003, 2004, 2006, 2009 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTBDF_H__
|
||||
#define __FTBDF_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* bdf_fonts */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* BDF and PCF Files */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* BDF and PCF specific API. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section contains the declaration of functions specific to BDF */
|
||||
/* and PCF fonts. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_PropertyType
|
||||
*
|
||||
* @description:
|
||||
* A list of BDF property types.
|
||||
*
|
||||
* @values:
|
||||
* BDF_PROPERTY_TYPE_NONE ::
|
||||
* Value~0 is used to indicate a missing property.
|
||||
*
|
||||
* BDF_PROPERTY_TYPE_ATOM ::
|
||||
* Property is a string atom.
|
||||
*
|
||||
* BDF_PROPERTY_TYPE_INTEGER ::
|
||||
* Property is a 32-bit signed integer.
|
||||
*
|
||||
* BDF_PROPERTY_TYPE_CARDINAL ::
|
||||
* Property is a 32-bit unsigned integer.
|
||||
*/
|
||||
typedef enum BDF_PropertyType_
|
||||
{
|
||||
BDF_PROPERTY_TYPE_NONE = 0,
|
||||
BDF_PROPERTY_TYPE_ATOM = 1,
|
||||
BDF_PROPERTY_TYPE_INTEGER = 2,
|
||||
BDF_PROPERTY_TYPE_CARDINAL = 3
|
||||
|
||||
} BDF_PropertyType;
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @type:
|
||||
* BDF_Property
|
||||
*
|
||||
* @description:
|
||||
* A handle to a @BDF_PropertyRec structure to model a given
|
||||
* BDF/PCF property.
|
||||
*/
|
||||
typedef struct BDF_PropertyRec_* BDF_Property;
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* BDF_PropertyRec
|
||||
*
|
||||
* @description:
|
||||
* This structure models a given BDF/PCF property.
|
||||
*
|
||||
* @fields:
|
||||
* type ::
|
||||
* The property type.
|
||||
*
|
||||
* u.atom ::
|
||||
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
|
||||
*
|
||||
* u.integer ::
|
||||
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
|
||||
*
|
||||
* u.cardinal ::
|
||||
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
|
||||
*/
|
||||
typedef struct BDF_PropertyRec_
|
||||
{
|
||||
BDF_PropertyType type;
|
||||
union {
|
||||
const char* atom;
|
||||
FT_Int32 integer;
|
||||
FT_UInt32 cardinal;
|
||||
|
||||
} u;
|
||||
|
||||
} BDF_PropertyRec;
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_BDF_Charset_ID
|
||||
*
|
||||
* @description:
|
||||
* Retrieve a BDF font character set identity, according to
|
||||
* the BDF specification.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* A handle to the input face.
|
||||
*
|
||||
* @output:
|
||||
* acharset_encoding ::
|
||||
* Charset encoding, as a C~string, owned by the face.
|
||||
*
|
||||
* acharset_registry ::
|
||||
* Charset registry, as a C~string, owned by the face.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function only works with BDF faces, returning an error otherwise.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_BDF_Charset_ID( FT_Face face,
|
||||
const char* *acharset_encoding,
|
||||
const char* *acharset_registry );
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Get_BDF_Property
|
||||
*
|
||||
* @description:
|
||||
* Retrieve a BDF property from a BDF or PCF font file.
|
||||
*
|
||||
* @input:
|
||||
* face :: A handle to the input face.
|
||||
*
|
||||
* name :: The property name.
|
||||
*
|
||||
* @output:
|
||||
* aproperty :: The property.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* This function works with BDF _and_ PCF fonts. It returns an error
|
||||
* otherwise. It also returns an error if the property is not in the
|
||||
* font.
|
||||
*
|
||||
* A `property' is a either key-value pair within the STARTPROPERTIES
|
||||
* ... ENDPROPERTIES block of a BDF font or a key-value pair from the
|
||||
* `info->props' array within a `FontRec' structure of a PCF font.
|
||||
*
|
||||
* Integer properties are always stored as `signed' within PCF fonts;
|
||||
* consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
|
||||
* for BDF fonts only.
|
||||
*
|
||||
* In case of error, `aproperty->type' is always set to
|
||||
* @BDF_PROPERTY_TYPE_NONE.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Get_BDF_Property( FT_Face face,
|
||||
const char* prop_name,
|
||||
BDF_PropertyRec *aproperty );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTBDF_H__ */
|
||||
|
||||
|
||||
/* END */
|
227
deps/freetype/include/freetype/ftbitmap.h
vendored
Normal file
227
deps/freetype/include/freetype/ftbitmap.h
vendored
Normal file
|
@ -0,0 +1,227 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftbitmap.h */
|
||||
/* */
|
||||
/* FreeType utility functions for bitmaps (specification). */
|
||||
/* */
|
||||
/* Copyright 2004, 2005, 2006, 2008 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTBITMAP_H__
|
||||
#define __FTBITMAP_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* bitmap_handling */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Bitmap Handling */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* Handling FT_Bitmap objects. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section contains functions for converting FT_Bitmap objects. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Bitmap_New */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Initialize a pointer to an @FT_Bitmap structure. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* abitmap :: A pointer to the bitmap structure. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FT_Bitmap_New( FT_Bitmap *abitmap );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Bitmap_Copy */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Copy a bitmap into another one. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to a library object. */
|
||||
/* */
|
||||
/* source :: A handle to the source bitmap. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* target :: A handle to the target bitmap. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0~means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Copy( FT_Library library,
|
||||
const FT_Bitmap *source,
|
||||
FT_Bitmap *target);
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Bitmap_Embolden */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Embolden a bitmap. The new bitmap will be about `xStrength' */
|
||||
/* pixels wider and `yStrength' pixels higher. The left and bottom */
|
||||
/* borders are kept unchanged. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to a library object. */
|
||||
/* */
|
||||
/* xStrength :: How strong the glyph is emboldened horizontally. */
|
||||
/* Expressed in 26.6 pixel format. */
|
||||
/* */
|
||||
/* yStrength :: How strong the glyph is emboldened vertically. */
|
||||
/* Expressed in 26.6 pixel format. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* bitmap :: A handle to the target bitmap. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0~means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The current implementation restricts `xStrength' to be less than */
|
||||
/* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
|
||||
/* */
|
||||
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
|
||||
/* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Embolden( FT_Library library,
|
||||
FT_Bitmap* bitmap,
|
||||
FT_Pos xStrength,
|
||||
FT_Pos yStrength );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Bitmap_Convert */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
|
||||
/* bitmap object with depth 8bpp, making the number of used bytes per */
|
||||
/* line (a.k.a. the `pitch') a multiple of `alignment'. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to a library object. */
|
||||
/* */
|
||||
/* source :: The source bitmap. */
|
||||
/* */
|
||||
/* alignment :: The pitch of the bitmap is a multiple of this */
|
||||
/* parameter. Common values are 1, 2, or 4. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* target :: The target bitmap. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0~means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* It is possible to call @FT_Bitmap_Convert multiple times without */
|
||||
/* calling @FT_Bitmap_Done (the memory is simply reallocated). */
|
||||
/* */
|
||||
/* Use @FT_Bitmap_Done to finally remove the bitmap object. */
|
||||
/* */
|
||||
/* The `library' argument is taken to have access to FreeType's */
|
||||
/* memory handling functions. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Convert( FT_Library library,
|
||||
const FT_Bitmap *source,
|
||||
FT_Bitmap *target,
|
||||
FT_Int alignment );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_GlyphSlot_Own_Bitmap */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Make sure that a glyph slot owns `slot->bitmap'. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* slot :: The glyph slot. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0~means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function is to be used in combination with */
|
||||
/* @FT_Bitmap_Embolden. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Bitmap_Done */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Destroy a bitmap object created with @FT_Bitmap_New. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: A handle to a library object. */
|
||||
/* */
|
||||
/* bitmap :: The bitmap object to be freed. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0~means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The `library' argument is taken to have access to FreeType's */
|
||||
/* memory handling functions. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Bitmap_Done( FT_Library library,
|
||||
FT_Bitmap *bitmap );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTBITMAP_H__ */
|
||||
|
||||
|
||||
/* END */
|
102
deps/freetype/include/freetype/ftbzip2.h
vendored
Normal file
102
deps/freetype/include/freetype/ftbzip2.h
vendored
Normal file
|
@ -0,0 +1,102 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftbzip2.h */
|
||||
/* */
|
||||
/* Bzip2-compressed stream support. */
|
||||
/* */
|
||||
/* Copyright 2010 by */
|
||||
/* Joel Klinghed. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTBZIP2_H__
|
||||
#define __FTBZIP2_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* bzip2 */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* BZIP2 Streams */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* Using bzip2-compressed font files. */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section contains the declaration of Bzip2-specific functions. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stream_OpenBzip2
|
||||
*
|
||||
* @description:
|
||||
* Open a new stream to parse bzip2-compressed font files. This is
|
||||
* mainly used to support the compressed `*.pcf.bz2' fonts that come
|
||||
* with XFree86.
|
||||
*
|
||||
* @input:
|
||||
* stream ::
|
||||
* The target embedding stream.
|
||||
*
|
||||
* source ::
|
||||
* The source stream.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* The source stream must be opened _before_ calling this function.
|
||||
*
|
||||
* Calling the internal function `FT_Stream_Close' on the new stream will
|
||||
* *not* call `FT_Stream_Close' on the source stream. None of the stream
|
||||
* objects will be released to the heap.
|
||||
*
|
||||
* The stream implementation is very basic and resets the decompression
|
||||
* process each time seeking backwards is needed within the stream.
|
||||
*
|
||||
* In certain builds of the library, bzip2 compression recognition is
|
||||
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
|
||||
* This means that if no font driver is capable of handling the raw
|
||||
* compressed file, the library will try to open a bzip2 compressed stream
|
||||
* from it and re-open the face with it.
|
||||
*
|
||||
* This function may return `FT_Err_Unimplemented_Feature' if your build
|
||||
* of FreeType was not compiled with bzip2 support.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stream_OpenBzip2( FT_Stream stream,
|
||||
FT_Stream source );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTBZIP2_H__ */
|
||||
|
||||
|
||||
/* END */
|
1140
deps/freetype/include/freetype/ftcache.h
vendored
Normal file
1140
deps/freetype/include/freetype/ftcache.h
vendored
Normal file
File diff suppressed because it is too large
Load diff
104
deps/freetype/include/freetype/ftchapters.h
vendored
Normal file
104
deps/freetype/include/freetype/ftchapters.h
vendored
Normal file
|
@ -0,0 +1,104 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* This file defines the structure of the FreeType reference. */
|
||||
/* It is used by the python script which generates the HTML files. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
/* general_remarks */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* General Remarks */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* user_allocation */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
/* core_api */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Core API */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* version */
|
||||
/* basic_types */
|
||||
/* base_interface */
|
||||
/* glyph_variants */
|
||||
/* glyph_management */
|
||||
/* mac_specific */
|
||||
/* sizes_management */
|
||||
/* header_file_macros */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
/* format_specific */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Format-Specific API */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* multiple_masters */
|
||||
/* truetype_tables */
|
||||
/* type1_tables */
|
||||
/* sfnt_names */
|
||||
/* bdf_fonts */
|
||||
/* cid_fonts */
|
||||
/* pfr_fonts */
|
||||
/* winfnt_fonts */
|
||||
/* font_formats */
|
||||
/* gasp_table */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Cache Sub-System */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* <Chapter> */
|
||||
/* support_api */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* Support API */
|
||||
/* */
|
||||
/* <Sections> */
|
||||
/* computations */
|
||||
/* list_processing */
|
||||
/* outline_processing */
|
||||
/* quick_advance */
|
||||
/* bitmap_handling */
|
||||
/* raster */
|
||||
/* glyph_stroker */
|
||||
/* system_interface */
|
||||
/* module_management */
|
||||
/* gzip */
|
||||
/* lzw */
|
||||
/* bzip2 */
|
||||
/* lcd_filtering */
|
||||
/* */
|
||||
/***************************************************************************/
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue