diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cfb8b4696..0e8396061 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,6 @@ jobs: - job: ubuntu16 + timeoutInMinutes: 120 pool: vmImage: 'Ubuntu-16.04' steps: @@ -26,12 +27,13 @@ jobs: sudo apt-get install libsquish-dev -y sudo apt-get install liblzma-dev -y sudo apt-get install libgsf-1-dev -y + sudo apt-get install qtbase5-dev qttools5-dev qttools5-dev-tools displayName: 'Dependencies' - script: | mkdir build cmake --version cd build - cmake -DWITH_STATIC=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=ON -DWITH_LIBGSF=ON ../code + cmake -DWITH_STATIC=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_CLIENT=ON -DWITH_RYZOM_TOOLS=ON -DWITH_NEL_TOOLS=ON -DWITH_NELNS=ON -DWITH_NELNS_LOGIN_SYSTEM=ON -DWITH_NELNS_SERVER=ON -DWITH_QT5=ON -DWITH_LIBGSF=ON ../code cat CMakeCache.txt displayName: 'CMake' - script: | diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 4e5292f2a..b6bc37f51 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -55,7 +55,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(RyzomCore CXX C) SET(NL_VERSION_MAJOR 1) SET(NL_VERSION_MINOR 0) -SET(NL_VERSION_PATCH 0) +SET(NL_VERSION_PATCH 1) SET(YEAR "2004-${CURRENT_YEAR}") SET(AUTHOR "Winch Gate and The Ryzom Core Community") diff --git a/code/CMakeModules/ConfigureChecks.cmake b/code/CMakeModules/ConfigureChecks.cmake index cab7a08c1..db43a2a3f 100644 --- a/code/CMakeModules/ConfigureChecks.cmake +++ b/code/CMakeModules/ConfigureChecks.cmake @@ -37,15 +37,25 @@ MACRO(NL_CONFIGURE_CHECKS) SET(RYZOM_VERSION_PATCH ${NL_VERSION_PATCH}) ENDIF() - SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}.${REVISION}") + IF(DESCRIBE) + SET(NL_VERSION "${DESCRIBE}") + ELSE() + SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}.${REVISION}") + ENDIF() SET(NL_VERSION_RC "${NL_VERSION_MAJOR},${NL_VERSION_MINOR},${NL_VERSION_PATCH},${REVISION}") + SET(NL_PRODUCT_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}") SET(RYZOM_VERSION_SHORT "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}") - SET(RYZOM_VERSION "${RYZOM_VERSION_SHORT}.${REVISION}") + IF(DESCRIBE) + SET(RYZOM_VERSION "${DESCRIBE}") + ELSE() + SET(RYZOM_VERSION "${RYZOM_VERSION_SHORT}.${REVISION}") + ENDIF() SET(RYZOM_VERSION_RC "${RYZOM_VERSION_MAJOR},${RYZOM_VERSION_MINOR},${RYZOM_VERSION_PATCH},${REVISION}") + SET(RYZOM_PRODUCT_VERSION "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}") NOW(BUILD_DATE) - SET(COPYRIGHT "${YEAR} ${AUTHOR}") + SET(COPYRIGHT "Copyright (C) ${YEAR} ${AUTHOR}") IF(NOT RYZOM_CLIENT_ICON) SET(RYZOM_CLIENT_ICON "khanat_client") diff --git a/code/CMakeModules/GetRevision.cmake b/code/CMakeModules/GetRevision.cmake index 17a617ba3..5293b0a44 100644 --- a/code/CMakeModules/GetRevision.cmake +++ b/code/CMakeModules/GetRevision.cmake @@ -76,9 +76,42 @@ IF(EXISTS "${ROOT_DIR}/.git/") FIND_PACKAGE(Git) IF(GIT_FOUND) - Git_WC_INFO(${ROOT_DIR} ER) - SET(REVISION ${ER_WC_REVISION}) - SET(CHANGESET ${ER_WC_CHANGESET}) + EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-list HEAD --count + WORKING_DIRECTORY ${ROOT_DIR} + RESULT_VARIABLE git_exit_code + OUTPUT_VARIABLE REVISION) + IF(NOT ${git_exit_code} EQUAL 0) + MESSAGE(WARNING "git rev-list failed, unable to include version.") + ELSE() + STRING(STRIP ${REVISION} REVISION) + ENDIF() + EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --short=8 HEAD + WORKING_DIRECTORY ${ROOT_DIR} + RESULT_VARIABLE git_exit_code + OUTPUT_VARIABLE CHANGESET) + IF(NOT ${git_exit_code} EQUAL 0) + MESSAGE(WARNING "git rev-parse failed, unable to include version.") + ELSE() + STRING(STRIP ${CHANGESET} CHANGESET) + ENDIF() + EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${ROOT_DIR} + RESULT_VARIABLE git_exit_code + OUTPUT_VARIABLE BRANCH) + IF(NOT ${git_exit_code} EQUAL 0) + MESSAGE(WARNING "git rev-parse failed, unable to include git branch.") + ELSE() + STRING(STRIP ${BRANCH} BRANCH) + ENDIF() + EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe + WORKING_DIRECTORY ${ROOT_DIR} + RESULT_VARIABLE git_exit_code + OUTPUT_VARIABLE DESCRIBE) + IF(NOT ${git_exit_code} EQUAL 0) + MESSAGE(WARNING "git rev-parse failed, unable to include git branch.") + ELSE() + STRING(STRIP ${DESCRIBE} DESCRIBE) + ENDIF() ENDIF() ENDIF() @@ -91,11 +124,6 @@ IF(SOURCE_DIR AND NOT DEFINED REVISION) ENDIF() ENDIF() -# Prevent crash if no revision from git or mercurial found -IF(NOT DEFINED REVISION) - SET(REVISION 0) -ENDIF() - IF(DEFINED REVISION) MESSAGE(STATUS "Found revision ${REVISION}") ELSE() diff --git a/code/config.h.cmake b/code/config.h.cmake index 69171cf68..9d698ac08 100644 --- a/code/config.h.cmake +++ b/code/config.h.cmake @@ -27,9 +27,12 @@ #cmakedefine NL_VERSION "${NL_VERSION}" #cmakedefine NL_VERSION_RC ${NL_VERSION_RC} +#cmakedefine NL_PRODUCT_VERSION "${NL_PRODUCT_VERSION}" #cmakedefine RYZOM_VERSION "${RYZOM_VERSION}" #cmakedefine RYZOM_VERSION_RC ${RYZOM_VERSION_RC} +#cmakedefine RYZOM_PRODUCT_VERSION "${RYZOM_PRODUCT_VERSION}" + #cmakedefine AUTHOR "${AUTHOR}" #cmakedefine YEAR "${YEAR}" #cmakedefine COPYRIGHT "${COPYRIGHT}" diff --git a/code/nel/include/nel/gui/css_selector.h b/code/nel/include/nel/gui/css_selector.h index 84b039089..ed04ba86d 100644 --- a/code/nel/include/nel/gui/css_selector.h +++ b/code/nel/include/nel/gui/css_selector.h @@ -43,8 +43,9 @@ namespace NLGUI std::string key; std::string value; char op; // =, ~, |, ^, $, * - SAttribute(const std::string &k, const std::string &v, char o) - :key(k),value(v),op(o) + bool caseSensitive; + SAttribute(const std::string &k, const std::string &v, char o, bool cs) + :key(k),value(v),op(o), caseSensitive(cs) {} }; @@ -69,7 +70,8 @@ namespace NLGUI // add attribute to selector // ' ' op means 'key exists, ignore value' - void addAttribute(const std::string &key, const std::string &val = "", char op = ' '); + // cs case-sensitive true|false + void addAttribute(const std::string &key, const std::string &val = "", char op = ' ', bool cs = true); // add pseudo class to selector, eg 'first-child' void addPseudoClass(const std::string &key); @@ -84,6 +86,9 @@ namespace NLGUI // NOTE: Does not check combinator bool match(const CHtmlElement &elm) const; + // debug + std::string toString() const; + private: bool matchClass(const CHtmlElement &elm) const; bool matchAttributes(const CHtmlElement &elm) const; @@ -91,7 +96,7 @@ namespace NLGUI // match An+B rule to child index (1 based) bool matchNth(sint childNr, sint a, sint b) const; - + // parse nth-child string to 'a' and 'b' components // :nth-child(odd) // :nth-child(even) diff --git a/code/nel/include/nel/gui/css_style.h b/code/nel/include/nel/gui/css_style.h index 74fcf240d..0937ebe0b 100644 --- a/code/nel/include/nel/gui/css_style.h +++ b/code/nel/include/nel/gui/css_style.h @@ -57,11 +57,12 @@ namespace NLGUI Underlined=false; StrikeThrough=false; GlobalColor=false; + DisplayBlock=false; Width=-1; Height=-1; MaxWidth=-1; MaxHeight=-1; - BorderWidth=1; + BorderWidth=-1; BackgroundColor=NLMISC::CRGBA::Black; BackgroundColorOver=NLMISC::CRGBA::Black; } @@ -87,6 +88,7 @@ namespace NLGUI bool GlobalColor; bool Underlined; bool StrikeThrough; + bool DisplayBlock; sint32 Width; sint32 Height; sint32 MaxWidth; @@ -172,11 +174,12 @@ namespace NLGUI styleStackIndex++; _StyleStack.push_back(Current); + Current.DisplayBlock = false; Current.Width=-1; Current.Height=-1; Current.MaxWidth=-1; Current.MaxHeight=-1; - Current.BorderWidth=1; + Current.BorderWidth=-1; Current.StyleRules.clear(); } diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index fc29c840d..d448b9d5f 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -107,7 +107,7 @@ namespace NLGUI void refresh(); // submit form - void submitForm (uint formId, const char *submitButtonType, const char *submitButtonName, const char *submitButtonValue, sint32 x, sint32 y); + void submitForm(uint button, sint32 x, sint32 y); // Browse error void browseError (const char *msg); @@ -125,6 +125,8 @@ namespace NLGUI // add image download (used by view_bitmap.cpp to load web images) void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage); + // remove image from download list if present + void removeImageDownload(CViewBase *img); std::string localImageName(const std::string &url); // Timeout @@ -325,7 +327,7 @@ namespace NLGUI // Add a button in the current paragraph. actionHandler, actionHandlerParams and tooltip can be NULL. CCtrlButton *addButton(CCtrlButton::EType type, const std::string &name, const std::string &normalBitmap, const std::string &pushedBitmap, - const std::string &overBitmap, const char *actionHandler, const char *actionHandlerParams, const char *tooltip, + const std::string &overBitmap, const char *actionHandler, const char *actionHandlerParams, const std::string &tooltip, const CStyleParams &style = CStyleParams()); // Set the background color @@ -385,6 +387,7 @@ namespace NLGUI bool _BrowseNextTime; bool _PostNextTime; uint _PostFormId; + std::string _PostFormAction; std::string _PostFormSubmitType; std::string _PostFormSubmitButton; std::string _PostFormSubmitValue; @@ -407,6 +410,7 @@ namespace NLGUI // True when the element has been encountered bool _ParsingLua; bool _IgnoreText; + bool _IgnoreChildElements; // the script to execute std::string _LuaScript; bool _LuaHrefHack; @@ -465,6 +469,64 @@ namespace NLGUI }; std::vector _UL; + class HTMLMeterElement { + public: + enum EValueRegion { + VALUE_OPTIMUM = 0, + VALUE_SUB_OPTIMAL, + VALUE_EVEN_LESS_GOOD + }; + public: + HTMLMeterElement() + : value(0.f), min(0.f), max(1.f), low(0.f), high(1.f), optimum(0.5f) + {} + + // read attributes from html element + void readValues(const CHtmlElement &elm); + + // return value ratio to min-max + float getValueRatio() const; + + // return optimum region based current value + EValueRegion getValueRegion() const; + + // return meter bar color + NLMISC::CRGBA getBarColor(const CHtmlElement &elm, CCssStyle &style) const; + + // return meter value bar color based value and optimum range + NLMISC::CRGBA getValueColor(const CHtmlElement &elm, CCssStyle &style) const; + + float value; + float min; + float max; + float low; + float high; + float optimum; + }; + + class HTMLProgressElement + { + public: + HTMLProgressElement() + : value(0.f), max(1.f) + {} + + // read attributes from html element + void readValues(const CHtmlElement &elm); + + // return value ratio to min-max + float getValueRatio() const; + + // return meter bar color + NLMISC::CRGBA getBarColor(const CHtmlElement &elm, CCssStyle &style) const; + + // return meter value bar color based value and optimum range + NLMISC::CRGBA getValueColor(const CHtmlElement &elm, CCssStyle &style) const; + + float value; + float max; + }; + // A mode std::vector _A; inline bool getA() const @@ -509,14 +571,6 @@ namespace NLGUI return _LinkClass.back().c_str(); } - std::vector _BlockLevelElement; - inline bool isBlockLevelElement() const - { - if (_BlockLevelElement.empty()) - return false; - return _BlockLevelElement.back(); - } - // Divs (i.e. interface group) std::vector _Divs; inline CInterfaceGroup *getDiv() const @@ -600,6 +654,9 @@ namespace NLGUI sint InitialSelection; // initial selection for the combo box }; + //
element "id" attribute + std::string id; + // The action the form has to perform std::string Action; @@ -607,6 +664,25 @@ namespace NLGUI std::vector Entries; }; std::vector _Forms; + + // submit buttons added to from + struct SFormSubmitButton + { + SFormSubmitButton(const std::string &form, const std::string &name, const std::string &value, const std::string &type, const std::string &formAction="") + : form(form), name(name), value(value), type(type), formAction(formAction) + { } + + std::string form; // form 'id' + std::string name; // submit button name + std::string value; // submit button value + std::string type; // button type, ie 'image' + + std::string formAction; // override form action attribute (url) + }; + + // submit buttons added to form + std::vector _FormSubmit; + std::vector _Groups; // Cells parameters @@ -819,12 +895,31 @@ namespace NLGUI // apply background from current style (for html, body) void applyBackground(const CHtmlElement &elm); + void insertFormImageButton(const std::string &name, + const std::string &tooltip, + const std::string &src, + const std::string &over, + const std::string &formId, + const std::string &formAction = "", + uint32 minWidth = 0, + const std::string &templateName = ""); + + void insertFormTextButton(const std::string &name, + const std::string &tooltip, + const std::string &value, + const std::string &formId, + const std::string &formAction = "", + uint32 minWidth = 0, + const std::string &templateName = ""); + // HTML elements void htmlA(const CHtmlElement &elm); void htmlAend(const CHtmlElement &elm); void htmlBASE(const CHtmlElement &elm); void htmlBODY(const CHtmlElement &elm); void htmlBR(const CHtmlElement &elm); + void htmlBUTTON(const CHtmlElement &elm); + void htmlBUTTONend(const CHtmlElement &elm); void htmlDD(const CHtmlElement &elm); void htmlDDend(const CHtmlElement &elm); //void htmlDEL(const CHtmlElement &elm); @@ -852,6 +947,7 @@ namespace NLGUI void htmlLUA(const CHtmlElement &elm); void htmlLUAend(const CHtmlElement &elm); void htmlMETA(const CHtmlElement &elm); + void htmlMETER(const CHtmlElement &elm); void htmlOBJECT(const CHtmlElement &elm); void htmlOBJECTend(const CHtmlElement &elm); void htmlOL(const CHtmlElement &elm); @@ -862,6 +958,7 @@ namespace NLGUI void htmlPend(const CHtmlElement &elm); void htmlPRE(const CHtmlElement &elm); void htmlPREend(const CHtmlElement &elm); + void htmlPROGRESS(const CHtmlElement &elm); void htmlSCRIPT(const CHtmlElement &elm); void htmlSCRIPTend(const CHtmlElement &elm); void htmlSELECT(const CHtmlElement &elm); diff --git a/code/nel/include/nel/gui/html_element.h b/code/nel/include/nel/gui/html_element.h index bac681c1c..b7bceb4ab 100644 --- a/code/nel/include/nel/gui/html_element.h +++ b/code/nel/include/nel/gui/html_element.h @@ -47,8 +47,6 @@ namespace NLGUI // defined style and :before/:after pseudo elements TStyle Style; - TStyle StyleBefore; - TStyle StyleAfter; // hierarchy CHtmlElement *parent; @@ -79,6 +77,16 @@ namespace NLGUI // debug std::string toString(bool tree = false, uint depth = 0) const; + + // query, get, set pseudo element style rules + void clearPseudo(); + bool hasPseudo(const std::string &key) const; + TStyle getPseudo(const std::string &key) const; + void setPseudo(const std::string &key, const TStyle &style); + + private: + // pseudo elements like ":before" and ":after" + std::map _Pseudo; }; } diff --git a/code/nel/include/nel/gui/interface_group.h b/code/nel/include/nel/gui/interface_group.h index 01f2b9701..cef9abb45 100644 --- a/code/nel/include/nel/gui/interface_group.h +++ b/code/nel/include/nel/gui/interface_group.h @@ -211,6 +211,11 @@ namespace NLGUI int luaGetNumGroups(CLuaState &ls); int luaGetGroup(CLuaState &ls); + // debug functions + int luaDumpSize(CLuaState &ls); + int luaDumpEltsOrder(CLuaState &ls); + int luaDumpGroups(CLuaState &ls); + void setMaxSizeRef(const std::string &maxSizeRef); std::string getMaxSizeRefAsString() const; @@ -223,6 +228,9 @@ namespace NLGUI REFLECT_LUA_METHOD("delGroup", luaDelGroup); REFLECT_LUA_METHOD("getNumGroups", luaGetNumGroups); REFLECT_LUA_METHOD("getGroup", luaGetGroup); + REFLECT_LUA_METHOD("dumpSize", luaDumpSize); + REFLECT_LUA_METHOD("dumpEltsOrder", luaDumpEltsOrder); + REFLECT_LUA_METHOD("dumpGroups", luaDumpGroups); REFLECT_STRING ("left_click", getLeftClickHandler, setLeftClickHandler); REFLECT_STRING ("right_click", getRightClickHandler, setRightClickHandler); REFLECT_STRING ("left_click_params", getLeftClickHandlerParams, setLeftClickHandlerParams); @@ -274,8 +282,8 @@ namespace NLGUI sint getInsertionOrder(CViewBase *vb) const; // for debug only - void dumpGroups(); - void dumpEltsOrder(); + void dumpGroups() const; + void dumpEltsOrder() const; virtual void renderWiredQuads(CInterfaceElement::TRenderWired type, const std::string &uiFilter); @@ -345,6 +353,9 @@ namespace NLGUI void makeNewClip (sint32 &oldClipX, sint32 &oldClipY, sint32 &oldClipW, sint32 &oldClipH); void restoreClip (sint32 oldSciX, sint32 oldSciY, sint32 oldSciW, sint32 oldSciH); + // Compute clip contribution for current window. This doesn't change the clip window in the driver. + void computeClipContribution(sint32 &newX, sint32 &newY, sint32 &newW, sint32 &newH) const; + // Compute clip contribution for current window, and a previous clipping rectangle. This doesn't change the clip window in the driver. void computeCurrentClipContribution(sint32 prevX, sint32 prevY, sint32 prevW, sint32 prevH, sint32 &newX, sint32 &newY, sint32 &newW, sint32 &newH) const; diff --git a/code/nel/include/nel/gui/view_bitmap.h b/code/nel/include/nel/gui/view_bitmap.h index 4afd37588..ef7735857 100644 --- a/code/nel/include/nel/gui/view_bitmap.h +++ b/code/nel/include/nel/gui/view_bitmap.h @@ -56,8 +56,14 @@ namespace NLGUI _TxtOffsetY = 0; _TxtWidth = -1; _TxtHeight = -1; + + // Support for https://.. textures + _HtmlDownload = false; } + /// Destructor + virtual ~CViewBitmap(); + std::string getProperty( const std::string &name ) const; void setProperty( const std::string &name, const std::string &value ); xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; @@ -132,6 +138,7 @@ namespace NLGUI bool _Flip : 1; bool _Tile : 1; bool _InheritGCAlpha : 1; + bool _HtmlDownload : 1; // For single texture diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index 350abc7f3..6d261ff8d 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -282,9 +282,11 @@ template T trimQuotes (const T &str) typename T::size_type size = str.size(); if (size == 0) return str; - if (str[0] != str[size-1] && (str[0] != '"' || str[0] != '\'')) + if (str[0] != str[size-1]) return str; - return str.substr(1, size - 1); + if (str[0] != '"' && str[0] != '\'') + return str; + return str.substr(1, size - 2); } ////////////////////////////////////////////////////////////////////////// diff --git a/code/nel/include/nel/misc/version_nl.cmake b/code/nel/include/nel/misc/version_nl.cmake index 2e650486e..ee224f723 100644 --- a/code/nel/include/nel/misc/version_nl.cmake +++ b/code/nel/include/nel/misc/version_nl.cmake @@ -2,6 +2,7 @@ #define NL_VERSION_H #define NL_VERSION "${NL_VERSION}" +#define NL_PRODUCT_VERSION "${NL_PRODUCT_VERSION}" #define NL_VERSION_MAJOR ${NL_VERSION_MAJOR} #define NL_VERSION_MINOR ${NL_VERSION_MINOR} #define NL_VERSION_PATCH ${NL_VERSION_PATCH} diff --git a/code/nel/include/nel/sound/audio_decoder_mp3.h b/code/nel/include/nel/sound/audio_decoder_mp3.h index e6ef91326..d9566608d 100644 --- a/code/nel/include/nel/sound/audio_decoder_mp3.h +++ b/code/nel/include/nel/sound/audio_decoder_mp3.h @@ -18,7 +18,7 @@ #define NLSOUND_AUDIO_DECODER_MP3_H #include -#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ +#if !defined(NL_OS_WINDOWS) || (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ #include diff --git a/code/nel/include/nel/sound/decoder/dr_mp3.h b/code/nel/include/nel/sound/decoder/dr_mp3.h index 465438bf5..26aeec56f 100644 --- a/code/nel/include/nel/sound/decoder/dr_mp3.h +++ b/code/nel/include/nel/sound/decoder/dr_mp3.h @@ -1,57 +1,61 @@ -// MP3 audio decoder. Public domain. See "unlicense" statement at the end of this file. -// dr_mp3 - v0.4.1 - 2018-12-30 -// -// David Reid - mackron@gmail.com -// -// Based off minimp3 (https://github.com/lieff/minimp3) which is where the real work was done. See the bottom of this file for -// differences between minimp3 and dr_mp3. +/* +MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file. +dr_mp3 - v0.4.4 - 2019-05-06 -// USAGE -// ===== -// dr_mp3 is a single-file library. To use it, do something like the following in one .c file. -// #define DR_MP3_IMPLEMENTATION -// #include "dr_mp3.h" -// -// You can then #include this file in other parts of the program as you would with any other header file. To decode audio data, -// do something like the following: -// -// drmp3 mp3; -// if (!drmp3_init_file(&mp3, "MySong.mp3", NULL)) { -// // Failed to open file -// } -// -// ... -// -// drmp3_uint64 framesRead = drmp3_read_pcm_frames_f32(pMP3, framesToRead, pFrames); -// -// The drmp3 object is transparent so you can get access to the channel count and sample rate like so: -// -// drmp3_uint32 channels = mp3.channels; -// drmp3_uint32 sampleRate = mp3.sampleRate; -// -// The third parameter of drmp3_init_file() in the example above allows you to control the output channel count and sample rate. It -// is a pointer to a drmp3_config object. Setting any of the variables of this object to 0 will cause dr_mp3 to use defaults. -// -// The example above initializes a decoder from a file, but you can also initialize it from a block of memory and read and seek -// callbacks with drmp3_init_memory() and drmp3_init() respectively. -// -// You do not need to do any annoying memory management when reading PCM frames - this is all managed internally. You can request -// any number of PCM frames in each call to drmp3_read_pcm_frames_f32() and it will return as many PCM frames as it can, up to the -// requested amount. -// -// You can also decode an entire file in one go with drmp3_open_and_read_f32(), drmp3_open_memory_and_read_f32() and -// drmp3_open_file_and_read_f32(). -// -// -// OPTIONS -// ======= -// #define these options before including this file. -// -// #define DR_MP3_NO_STDIO -// Disable drmp3_init_file(), etc. -// -// #define DR_MP3_NO_SIMD -// Disable SIMD optimizations. +David Reid - mackron@gmail.com + +Based off minimp3 (https://github.com/lieff/minimp3) which is where the real work was done. See the bottom of this file for +differences between minimp3 and dr_mp3. +*/ + +/* +USAGE +===== +dr_mp3 is a single-file library. To use it, do something like the following in one .c file. + #define DR_MP3_IMPLEMENTATION + #include "dr_mp3.h" + +You can then #include this file in other parts of the program as you would with any other header file. To decode audio data, +do something like the following: + + drmp3 mp3; + if (!drmp3_init_file(&mp3, "MySong.mp3", NULL)) { + // Failed to open file + } + + ... + + drmp3_uint64 framesRead = drmp3_read_pcm_frames_f32(pMP3, framesToRead, pFrames); + +The drmp3 object is transparent so you can get access to the channel count and sample rate like so: + + drmp3_uint32 channels = mp3.channels; + drmp3_uint32 sampleRate = mp3.sampleRate; + +The third parameter of drmp3_init_file() in the example above allows you to control the output channel count and sample rate. It +is a pointer to a drmp3_config object. Setting any of the variables of this object to 0 will cause dr_mp3 to use defaults. + +The example above initializes a decoder from a file, but you can also initialize it from a block of memory and read and seek +callbacks with drmp3_init_memory() and drmp3_init() respectively. + +You do not need to do any annoying memory management when reading PCM frames - this is all managed internally. You can request +any number of PCM frames in each call to drmp3_read_pcm_frames_f32() and it will return as many PCM frames as it can, up to the +requested amount. + +You can also decode an entire file in one go with drmp3_open_and_read_f32(), drmp3_open_memory_and_read_f32() and +drmp3_open_file_and_read_f32(). + + +OPTIONS +======= +#define these options before including this file. + +#define DR_MP3_NO_STDIO + Disable drmp3_init_file(), etc. + +#define DR_MP3_NO_SIMD + Disable SIMD optimizations. +*/ #ifndef dr_mp3_h #define dr_mp3_h @@ -90,9 +94,20 @@ typedef drmp3_uint32 drmp3_bool32; #define DRMP3_MAX_PCM_FRAMES_PER_MP3_FRAME 1152 #define DRMP3_MAX_SAMPLES_PER_FRAME (DRMP3_MAX_PCM_FRAMES_PER_MP3_FRAME*2) +#ifdef _MSC_VER +#define DRMP3_INLINE __forceinline +#else +#ifdef __GNUC__ +#define DRMP3_INLINE __inline__ __attribute__((always_inline)) +#else +#define DRMP3_INLINE +#endif +#endif -// Low Level Push API -// ================== +/* +Low Level Push API +================== +*/ typedef struct { int frame_bytes, channels, hz, layer, bitrate_kbps; @@ -105,23 +120,30 @@ typedef struct unsigned char header[4], reserv_buf[511]; } drmp3dec; -// Initializes a low level decoder. +/* Initializes a low level decoder. */ void drmp3dec_init(drmp3dec *dec); -// Reads a frame from a low level decoder. +/* Reads a frame from a low level decoder. */ int drmp3dec_decode_frame(drmp3dec *dec, const unsigned char *mp3, int mp3_bytes, void *pcm, drmp3dec_frame_info *info); -// Helper for converting between f32 and s16. +/* Helper for converting between f32 and s16. */ void drmp3dec_f32_to_s16(const float *in, drmp3_int16 *out, int num_samples); - -// Main API (Pull API) -// =================== +/* +Main API (Pull API) +=================== +*/ +#ifndef DR_MP3_DEFAULT_CHANNELS +#define DR_MP3_DEFAULT_CHANNELS 2 +#endif +#ifndef DR_MP3_DEFAULT_SAMPLE_RATE +#define DR_MP3_DEFAULT_SAMPLE_RATE 44100 +#endif typedef struct drmp3_src drmp3_src; -typedef drmp3_uint64 (* drmp3_src_read_proc)(drmp3_src* pSRC, drmp3_uint64 frameCount, void* pFramesOut, void* pUserData); // Returns the number of frames that were read. +typedef drmp3_uint64 (* drmp3_src_read_proc)(drmp3_src* pSRC, drmp3_uint64 frameCount, void* pFramesOut, void* pUserData); /* Returns the number of frames that were read. */ typedef enum { @@ -144,7 +166,7 @@ typedef struct drmp3_uint32 sampleRateOut; drmp3_uint32 channels; drmp3_src_algorithm algorithm; - drmp3_uint32 cacheSizeInFrames; // The number of frames to read from the client at a time. + drmp3_uint32 cacheSizeInFrames; /* The number of frames to read from the client at a time. */ } drmp3_src_config; struct drmp3_src @@ -153,7 +175,7 @@ struct drmp3_src drmp3_src_read_proc onRead; void* pUserData; float bin[256]; - drmp3_src_cache cache; // <-- For simplifying and optimizing client -> memory reading. + drmp3_src_cache cache; /* <-- For simplifying and optimizing client -> memory reading. */ union { struct @@ -173,34 +195,38 @@ typedef enum typedef struct { - drmp3_uint64 seekPosInBytes; // Points to the first byte of an MP3 frame. - drmp3_uint64 pcmFrameIndex; // The index of the PCM frame this seek point targets. - drmp3_uint16 mp3FramesToDiscard; // The number of whole MP3 frames to be discarded before pcmFramesToDiscard. - drmp3_uint16 pcmFramesToDiscard; // The number of leading samples to read and discard. These are discarded after mp3FramesToDiscard. + drmp3_uint64 seekPosInBytes; /* Points to the first byte of an MP3 frame. */ + drmp3_uint64 pcmFrameIndex; /* The index of the PCM frame this seek point targets. */ + drmp3_uint16 mp3FramesToDiscard; /* The number of whole MP3 frames to be discarded before pcmFramesToDiscard. */ + drmp3_uint16 pcmFramesToDiscard; /* The number of leading samples to read and discard. These are discarded after mp3FramesToDiscard. */ } drmp3_seek_point; -// Callback for when data is read. Return value is the number of bytes actually read. -// -// pUserData [in] The user data that was passed to drmp3_init(), drmp3_open() and family. -// pBufferOut [out] The output buffer. -// bytesToRead [in] The number of bytes to read. -// -// Returns the number of bytes actually read. -// -// A return value of less than bytesToRead indicates the end of the stream. Do _not_ return from this callback until -// either the entire bytesToRead is filled or you have reached the end of the stream. +/* +Callback for when data is read. Return value is the number of bytes actually read. + +pUserData [in] The user data that was passed to drmp3_init(), drmp3_open() and family. +pBufferOut [out] The output buffer. +bytesToRead [in] The number of bytes to read. + +Returns the number of bytes actually read. + +A return value of less than bytesToRead indicates the end of the stream. Do _not_ return from this callback until +either the entire bytesToRead is filled or you have reached the end of the stream. +*/ typedef size_t (* drmp3_read_proc)(void* pUserData, void* pBufferOut, size_t bytesToRead); -// Callback for when data needs to be seeked. -// -// pUserData [in] The user data that was passed to drmp3_init(), drmp3_open() and family. -// offset [in] The number of bytes to move, relative to the origin. Will never be negative. -// origin [in] The origin of the seek - the current position or the start of the stream. -// -// Returns whether or not the seek was successful. -// -// Whether or not it is relative to the beginning or current position is determined by the "origin" parameter which -// will be either drmp3_seek_origin_start or drmp3_seek_origin_current. +/* +Callback for when data needs to be seeked. + +pUserData [in] The user data that was passed to drmp3_init(), drmp3_open() and family. +offset [in] The number of bytes to move, relative to the origin. Will never be negative. +origin [in] The origin of the seek - the current position or the start of the stream. + +Returns whether or not the seek was successful. + +Whether or not it is relative to the beginning or current position is determined by the "origin" parameter which +will be either drmp3_seek_origin_start or drmp3_seek_origin_current. +*/ typedef drmp3_bool32 (* drmp3_seek_proc)(void* pUserData, int offset, drmp3_seek_origin origin); typedef struct @@ -218,16 +244,16 @@ typedef struct drmp3_read_proc onRead; drmp3_seek_proc onSeek; void* pUserData; - drmp3_uint32 mp3FrameChannels; // The number of channels in the currently loaded MP3 frame. Internal use only. - drmp3_uint32 mp3FrameSampleRate; // The sample rate of the currently loaded MP3 frame. Internal use only. + drmp3_uint32 mp3FrameChannels; /* The number of channels in the currently loaded MP3 frame. Internal use only. */ + drmp3_uint32 mp3FrameSampleRate; /* The sample rate of the currently loaded MP3 frame. Internal use only. */ drmp3_uint32 pcmFramesConsumedInMP3Frame; drmp3_uint32 pcmFramesRemainingInMP3Frame; - drmp3_uint8 pcmFrames[sizeof(float)*DRMP3_MAX_SAMPLES_PER_FRAME]; // <-- Multipled by sizeof(float) to ensure there's enough room for DR_MP3_FLOAT_OUTPUT. - drmp3_uint64 currentPCMFrame; // The current PCM frame, globally, based on the output sample rate. Mainly used for seeking. - drmp3_uint64 streamCursor; // The current byte the decoder is sitting on in the raw stream. + drmp3_uint8 pcmFrames[sizeof(float)*DRMP3_MAX_SAMPLES_PER_FRAME]; /* <-- Multipled by sizeof(float) to ensure there's enough room for DR_MP3_FLOAT_OUTPUT. */ + drmp3_uint64 currentPCMFrame; /* The current PCM frame, globally, based on the output sample rate. Mainly used for seeking. */ + drmp3_uint64 streamCursor; /* The current byte the decoder is sitting on in the raw stream. */ drmp3_src src; - drmp3_seek_point* pSeekPoints; // NULL by default. Set with drmp3_bind_seek_table(). Memory is owned by the client. dr_mp3 will never attempt to free this pointer. - drmp3_uint32 seekPointCount; // The number of items in pSeekPoints. When set to 0 assumes to no seek table. Defaults to zero. + drmp3_seek_point* pSeekPoints; /* NULL by default. Set with drmp3_bind_seek_table(). Memory is owned by the client. dr_mp3 will never attempt to free this pointer. */ + drmp3_uint32 seekPointCount; /* The number of items in pSeekPoints. When set to 0 assumes to no seek table. Defaults to zero. */ size_t dataSize; size_t dataCapacity; drmp3_uint8* pData; @@ -237,111 +263,155 @@ typedef struct const drmp3_uint8* pData; size_t dataSize; size_t currentReadPos; - } memory; // Only used for decoders that were opened against a block of memory. + } memory; /* Only used for decoders that were opened against a block of memory. */ } drmp3; -// Initializes an MP3 decoder. -// -// onRead [in] The function to call when data needs to be read from the client. -// onSeek [in] The function to call when the read position of the client data needs to move. -// pUserData [in, optional] A pointer to application defined data that will be passed to onRead and onSeek. -// -// Returns true if successful; false otherwise. -// -// Close the loader with drmp3_uninit(). -// -// See also: drmp3_init_file(), drmp3_init_memory(), drmp3_uninit() +/* +Initializes an MP3 decoder. + +onRead [in] The function to call when data needs to be read from the client. +onSeek [in] The function to call when the read position of the client data needs to move. +pUserData [in, optional] A pointer to application defined data that will be passed to onRead and onSeek. + +Returns true if successful; false otherwise. + +Close the loader with drmp3_uninit(). + +See also: drmp3_init_file(), drmp3_init_memory(), drmp3_uninit() +*/ drmp3_bool32 drmp3_init(drmp3* pMP3, drmp3_read_proc onRead, drmp3_seek_proc onSeek, void* pUserData, const drmp3_config* pConfig); -// Initializes an MP3 decoder from a block of memory. -// -// This does not create a copy of the data. It is up to the application to ensure the buffer remains valid for -// the lifetime of the drmp3 object. -// -// The buffer should contain the contents of the entire MP3 file. +/* +Initializes an MP3 decoder from a block of memory. + +This does not create a copy of the data. It is up to the application to ensure the buffer remains valid for +the lifetime of the drmp3 object. + +The buffer should contain the contents of the entire MP3 file. +*/ drmp3_bool32 drmp3_init_memory(drmp3* pMP3, const void* pData, size_t dataSize, const drmp3_config* pConfig); #ifndef DR_MP3_NO_STDIO -// Initializes an MP3 decoder from a file. -// -// This holds the internal FILE object until drmp3_uninit() is called. Keep this in mind if you're caching drmp3 -// objects because the operating system may restrict the number of file handles an application can have open at -// any given time. +/* +Initializes an MP3 decoder from a file. + +This holds the internal FILE object until drmp3_uninit() is called. Keep this in mind if you're caching drmp3 +objects because the operating system may restrict the number of file handles an application can have open at +any given time. +*/ drmp3_bool32 drmp3_init_file(drmp3* pMP3, const char* filePath, const drmp3_config* pConfig); #endif -// Uninitializes an MP3 decoder. +/* +Uninitializes an MP3 decoder. +*/ void drmp3_uninit(drmp3* pMP3); -// Reads PCM frames as interleaved 32-bit IEEE floating point PCM. -// -// Note that framesToRead specifies the number of PCM frames to read, _not_ the number of MP3 frames. +/* +Reads PCM frames as interleaved 32-bit IEEE floating point PCM. + +Note that framesToRead specifies the number of PCM frames to read, _not_ the number of MP3 frames. +*/ drmp3_uint64 drmp3_read_pcm_frames_f32(drmp3* pMP3, drmp3_uint64 framesToRead, float* pBufferOut); -// Seeks to a specific frame. -// -// Note that this is _not_ an MP3 frame, but rather a PCM frame. +/* +Reads PCM frames as interleaved signed 16-bit integer PCM. + +Note that framesToRead specifies the number of PCM frames to read, _not_ the number of MP3 frames. +*/ +drmp3_uint64 drmp3_read_pcm_frames_s16(drmp3* pMP3, drmp3_uint64 framesToRead, drmp3_int16* pBufferOut); + +/* +Seeks to a specific frame. + +Note that this is _not_ an MP3 frame, but rather a PCM frame. +*/ drmp3_bool32 drmp3_seek_to_pcm_frame(drmp3* pMP3, drmp3_uint64 frameIndex); -// Calculates the total number of PCM frames in the MP3 stream. Cannot be used for infinite streams such as internet -// radio. Runs in linear time. Returns 0 on error. +/* +Calculates the total number of PCM frames in the MP3 stream. Cannot be used for infinite streams such as internet +radio. Runs in linear time. Returns 0 on error. +*/ drmp3_uint64 drmp3_get_pcm_frame_count(drmp3* pMP3); -// Calculates the total number of MP3 frames in the MP3 stream. Cannot be used for infinite streams such as internet -// radio. Runs in linear time. Returns 0 on error. +/* +Calculates the total number of MP3 frames in the MP3 stream. Cannot be used for infinite streams such as internet +radio. Runs in linear time. Returns 0 on error. +*/ drmp3_uint64 drmp3_get_mp3_frame_count(drmp3* pMP3); -// Calculates the seekpoints based on PCM frames. This is slow. -// -// pSeekpoint count is a pointer to a uint32 containing the seekpoint count. On input it contains the desired count. -// On output it contains the actual count. The reason for this design is that the client may request too many -// seekpoints, in which case dr_mp3 will return a corrected count. -// -// Note that seektable seeking is not quite sample exact when the MP3 stream contains inconsistent sample rates. +/* +Calculates the total number of MP3 and PCM frames in the MP3 stream. Cannot be used for infinite streams such as internet +radio. Runs in linear time. Returns 0 on error. + +This is equivalent to calling drmp3_get_mp3_frame_count() and drmp3_get_pcm_frame_count() except that it's more efficient. +*/ +drmp3_bool32 drmp3_get_mp3_and_pcm_frame_count(drmp3* pMP3, drmp3_uint64* pMP3FrameCount, drmp3_uint64* pPCMFrameCount); + +/* +Calculates the seekpoints based on PCM frames. This is slow. + +pSeekpoint count is a pointer to a uint32 containing the seekpoint count. On input it contains the desired count. +On output it contains the actual count. The reason for this design is that the client may request too many +seekpoints, in which case dr_mp3 will return a corrected count. + +Note that seektable seeking is not quite sample exact when the MP3 stream contains inconsistent sample rates. +*/ drmp3_bool32 drmp3_calculate_seek_points(drmp3* pMP3, drmp3_uint32* pSeekPointCount, drmp3_seek_point* pSeekPoints); -// Binds a seek table to the decoder. -// -// This does _not_ make a copy of pSeekPoints - it only references it. It is up to the application to ensure this -// remains valid while it is bound to the decoder. -// -// Use drmp3_calculate_seek_points() to calculate the seek points. +/* +Binds a seek table to the decoder. + +This does _not_ make a copy of pSeekPoints - it only references it. It is up to the application to ensure this +remains valid while it is bound to the decoder. + +Use drmp3_calculate_seek_points() to calculate the seek points. +*/ drmp3_bool32 drmp3_bind_seek_table(drmp3* pMP3, drmp3_uint32 seekPointCount, drmp3_seek_point* pSeekPoints); +/* +Opens an decodes an entire MP3 stream as a single operation. -// Opens an decodes an entire MP3 stream as a single operation. -// -// pConfig is both an input and output. On input it contains what you want. On output it contains what you got. -// -// Free the returned pointer with drmp3_free(). +pConfig is both an input and output. On input it contains what you want. On output it contains what you got. + +Free the returned pointer with drmp3_free(). +*/ float* drmp3_open_and_read_f32(drmp3_read_proc onRead, drmp3_seek_proc onSeek, void* pUserData, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount); +drmp3_int16* drmp3_open_and_read_s16(drmp3_read_proc onRead, drmp3_seek_proc onSeek, void* pUserData, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount); + float* drmp3_open_memory_and_read_f32(const void* pData, size_t dataSize, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount); +drmp3_int16* drmp3_open_memory_and_read_s16(const void* pData, size_t dataSize, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount); + #ifndef DR_MP3_NO_STDIO float* drmp3_open_file_and_read_f32(const char* filePath, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount); +drmp3_int16* drmp3_open_file_and_read_s16(const char* filePath, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount); #endif -// Frees any memory that was allocated by a public drmp3 API. +/* +Frees any memory that was allocated by a public drmp3 API. +*/ void drmp3_free(void* p); #ifdef __cplusplus } #endif -#endif // dr_mp3_h +#endif /* dr_mp3_h */ -///////////////////////////////////////////////////// -// -// IMPLEMENTATION -// -///////////////////////////////////////////////////// +/************************************************************************************************************************************************************ + ************************************************************************************************************************************************************ + + IMPLEMENTATION + + ************************************************************************************************************************************************************ + ************************************************************************************************************************************************************/ #ifdef DR_MP3_IMPLEMENTATION #include #include -#include -#include // For INT_MAX +#include /* For INT_MAX */ -// Disable SIMD when compiling with TCC for now. +/* Disable SIMD when compiling with TCC for now. */ #if defined(__TINYC__) #define DR_MP3_NO_SIMD #endif @@ -393,7 +463,7 @@ void drmp3_free(void* p); #define DR_MP3_ONLY_SIMD #endif -#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) || ((defined(__i386__) || defined(__x86_64__)) && defined(__SSE2__)) +#if ((defined(_MSC_VER) && _MSC_VER >= 1400) && (defined(_M_IX86) || defined(_M_X64))) || ((defined(__i386__) || defined(__x86_64__)) && defined(__SSE2__)) #if defined(_MSC_VER) #include #endif @@ -808,8 +878,8 @@ static int drmp3_L3_read_side_info(drmp3_bs *bs, drmp3_L3_gr_info *gr, const drm unsigned tables, scfsi = 0; int main_data_begin, part_23_sum = 0; - int sr_idx = DRMP3_HDR_GET_MY_SAMPLE_RATE(hdr); sr_idx -= (sr_idx != 0); int gr_count = DRMP3_HDR_IS_MONO(hdr) ? 1 : 2; + int sr_idx = DRMP3_HDR_GET_MY_SAMPLE_RATE(hdr); sr_idx -= (sr_idx != 0); if (DRMP3_HDR_TEST_MPEG1(hdr)) { @@ -1098,7 +1168,7 @@ static void drmp3_L3_huffman(float *dst, drmp3_bs *bs, const drmp3_L3_gr_info *g lsb += DRMP3_PEEK_BITS(linbits); DRMP3_FLUSH_BITS(linbits); DRMP3_CHECK_BITS; - *dst = one*drmp3_L3_pow_43(lsb)*((int32_t)bs_cache < 0 ? -1: 1); + *dst = one*drmp3_L3_pow_43(lsb)*((drmp3_int32)bs_cache < 0 ? -1: 1); } else { *dst = g_drmp3_pow43[16 + lsb - 16*(bs_cache >> 31)]*one; @@ -1682,9 +1752,10 @@ typedef drmp3_int16 drmp3d_sample_t; static drmp3_int16 drmp3d_scale_pcm(float sample) { + drmp3_int16 s; if (sample >= 32766.5) return (drmp3_int16) 32767; if (sample <= -32767.5) return (drmp3_int16)-32768; - drmp3_int16 s = (drmp3_int16)(sample + .5f); + s = (drmp3_int16)(sample + .5f); s -= (s < 0); /* away from zero, to be compliant */ return (drmp3_int16)s; } @@ -2022,11 +2093,12 @@ int drmp3dec_decode_frame(drmp3dec *dec, const unsigned char *mp3, int mp3_bytes #ifdef DR_MP3_ONLY_MP3 return 0; #else + drmp3_L12_scale_info sci[1]; + if (pcm == NULL) { return drmp3_hdr_frame_samples(hdr); } - drmp3_L12_scale_info sci[1]; drmp3_L12_read_scale_info(hdr, bs_frame, sci); memset(scratch.grbuf[0], 0, 576*2*sizeof(float)); @@ -2113,11 +2185,11 @@ void drmp3dec_f32_to_s16(const float *in, drmp3_int16 *out, int num_samples) -/////////////////////////////////////////////////////////////////////////////// -// -// Main Public API -// -/////////////////////////////////////////////////////////////////////////////// +/************************************************************************************************************************************************************ + + Main Public API + + ************************************************************************************************************************************************************/ #if defined(SIZE_MAX) #define DRMP3_SIZE_MAX SIZE_MAX @@ -2129,19 +2201,13 @@ void drmp3dec_f32_to_s16(const float *in, drmp3_int16 *out, int num_samples) #endif #endif -// Options. -#ifndef DR_MP3_DEFAULT_CHANNELS -#define DR_MP3_DEFAULT_CHANNELS 2 -#endif -#ifndef DR_MP3_DEFAULT_SAMPLE_RATE -#define DR_MP3_DEFAULT_SAMPLE_RATE 44100 -#endif +/* Options. */ #ifndef DRMP3_SEEK_LEADING_MP3_FRAMES #define DRMP3_SEEK_LEADING_MP3_FRAMES 2 #endif -// Standard library stuff. +/* Standard library stuff. */ #ifndef DRMP3_ASSERT #include #define DRMP3_ASSERT(expression) assert(expression) @@ -2174,16 +2240,17 @@ void drmp3dec_f32_to_s16(const float *in, drmp3_int16 *out, int num_samples) #define drmp3_max(x, y) (((x) > (y)) ? (x) : (y)) #define drmp3_min(x, y) (((x) < (y)) ? (x) : (y)) -#define DRMP3_DATA_CHUNK_SIZE 16384 // The size in bytes of each chunk of data to read from the MP3 stream. minimp3 recommends 16K. +#define DRMP3_DATA_CHUNK_SIZE 16384 /* The size in bytes of each chunk of data to read from the MP3 stream. minimp3 recommends 16K. */ -static inline float drmp3_mix_f32(float x, float y, float a) +static DRMP3_INLINE float drmp3_mix_f32(float x, float y, float a) { return x*(1-a) + y*a; } static void drmp3_blend_f32(float* pOut, float* pInA, float* pInB, float factor, drmp3_uint32 channels) { - for (drmp3_uint32 i = 0; i < channels; ++i) { + drmp3_uint32 i; + for (i = 0; i < channels; ++i) { pOut[i] = drmp3_mix_f32(pInA[i], pInB[i], factor); } } @@ -2200,17 +2267,20 @@ void drmp3_src_cache_init(drmp3_src* pSRC, drmp3_src_cache* pCache) drmp3_uint64 drmp3_src_cache_read_frames(drmp3_src_cache* pCache, drmp3_uint64 frameCount, float* pFramesOut) { + drmp3_uint32 channels; + drmp3_uint64 totalFramesRead = 0; + drmp3_assert(pCache != NULL); drmp3_assert(pCache->pSRC != NULL); drmp3_assert(pCache->pSRC->onRead != NULL); drmp3_assert(frameCount > 0); drmp3_assert(pFramesOut != NULL); - drmp3_uint32 channels = pCache->pSRC->config.channels; + channels = pCache->pSRC->config.channels; - drmp3_uint64 totalFramesRead = 0; while (frameCount > 0) { - // If there's anything in memory go ahead and copy that over first. + /* If there's anything in memory go ahead and copy that over first. */ + drmp3_uint32 framesToReadFromClient; drmp3_uint64 framesRemainingInMemory = pCache->cachedFrameCount - pCache->iNextFrame; drmp3_uint64 framesToReadFromMemory = frameCount; if (framesToReadFromMemory > framesRemainingInMemory) { @@ -2227,14 +2297,14 @@ drmp3_uint64 drmp3_src_cache_read_frames(drmp3_src_cache* pCache, drmp3_uint64 f } - // At this point there are still more frames to read from the client, so we'll need to reload the cache with fresh data. + /* At this point there are still more frames to read from the client, so we'll need to reload the cache with fresh data. */ drmp3_assert(frameCount > 0); pFramesOut += framesToReadFromMemory * channels; pCache->iNextFrame = 0; pCache->cachedFrameCount = 0; - drmp3_uint32 framesToReadFromClient = drmp3_countof(pCache->pCachedFrames) / pCache->pSRC->config.channels; + framesToReadFromClient = drmp3_countof(pCache->pCachedFrames) / pCache->pSRC->config.channels; if (framesToReadFromClient > pCache->pSRC->config.cacheSizeInFrames) { framesToReadFromClient = pCache->pSRC->config.cacheSizeInFrames; } @@ -2242,7 +2312,7 @@ drmp3_uint64 drmp3_src_cache_read_frames(drmp3_src_cache* pCache, drmp3_uint64 f pCache->cachedFrameCount = (drmp3_uint32)pCache->pSRC->onRead(pCache->pSRC, framesToReadFromClient, pCache->pCachedFrames, pCache->pSRC->pUserData); - // Get out of this loop if nothing was able to be retrieved. + /* Get out of this loop if nothing was able to be retrieved. */ if (pCache->cachedFrameCount == 0) { break; } @@ -2257,11 +2327,19 @@ drmp3_uint64 drmp3_src_read_frames_linear(drmp3_src* pSRC, drmp3_uint64 frameCou drmp3_bool32 drmp3_src_init(const drmp3_src_config* pConfig, drmp3_src_read_proc onRead, void* pUserData, drmp3_src* pSRC) { - if (pSRC == NULL) return DRMP3_FALSE; + if (pSRC == NULL) { + return DRMP3_FALSE; + } + drmp3_zero_object(pSRC); - if (pConfig == NULL || onRead == NULL) return DRMP3_FALSE; - if (pConfig->channels == 0 || pConfig->channels > 2) return DRMP3_FALSE; + if (pConfig == NULL || onRead == NULL) { + return DRMP3_FALSE; + } + + if (pConfig->channels == 0 || pConfig->channels > 2) { + return DRMP3_FALSE; + } pSRC->config = *pConfig; pSRC->onRead = onRead; @@ -2277,9 +2355,11 @@ drmp3_bool32 drmp3_src_init(const drmp3_src_config* pConfig, drmp3_src_read_proc drmp3_bool32 drmp3_src_set_input_sample_rate(drmp3_src* pSRC, drmp3_uint32 sampleRateIn) { - if (pSRC == NULL) return DRMP3_FALSE; + if (pSRC == NULL) { + return DRMP3_FALSE; + } - // Must have a sample rate of > 0. + /* Must have a sample rate of > 0. */ if (sampleRateIn == 0) { return DRMP3_FALSE; } @@ -2290,9 +2370,11 @@ drmp3_bool32 drmp3_src_set_input_sample_rate(drmp3_src* pSRC, drmp3_uint32 sampl drmp3_bool32 drmp3_src_set_output_sample_rate(drmp3_src* pSRC, drmp3_uint32 sampleRateOut) { - if (pSRC == NULL) return DRMP3_FALSE; + if (pSRC == NULL) { + return DRMP3_FALSE; + } - // Must have a sample rate of > 0. + /* Must have a sample rate of > 0. */ if (sampleRateOut == 0) { return DRMP3_FALSE; } @@ -2303,16 +2385,20 @@ drmp3_bool32 drmp3_src_set_output_sample_rate(drmp3_src* pSRC, drmp3_uint32 samp drmp3_uint64 drmp3_src_read_frames_ex(drmp3_src* pSRC, drmp3_uint64 frameCount, void* pFramesOut, drmp3_bool32 flush) { - if (pSRC == NULL || frameCount == 0 || pFramesOut == NULL) return 0; + drmp3_src_algorithm algorithm; - drmp3_src_algorithm algorithm = pSRC->config.algorithm; + if (pSRC == NULL || frameCount == 0 || pFramesOut == NULL) { + return 0; + } - // Always use passthrough if the sample rates are the same. + algorithm = pSRC->config.algorithm; + + /* Always use passthrough if the sample rates are the same. */ if (pSRC->config.sampleRateIn == pSRC->config.sampleRateOut) { algorithm = drmp3_src_algorithm_none; } - // Could just use a function pointer instead of a switch for this... + /* Could just use a function pointer instead of a switch for this... */ switch (algorithm) { case drmp3_src_algorithm_none: return drmp3_src_read_frames_passthrough(pSRC, frameCount, pFramesOut, flush); @@ -2332,19 +2418,22 @@ drmp3_uint64 drmp3_src_read_frames_passthrough(drmp3_src* pSRC, drmp3_uint64 fra drmp3_assert(frameCount > 0); drmp3_assert(pFramesOut != NULL); - (void)flush; // Passthrough need not care about flushing. + (void)flush; /* Passthrough need not care about flushing. */ return pSRC->onRead(pSRC, frameCount, pFramesOut, pSRC->pUserData); } drmp3_uint64 drmp3_src_read_frames_linear(drmp3_src* pSRC, drmp3_uint64 frameCount, void* pFramesOut, drmp3_bool32 flush) { + double factor; + drmp3_uint64 totalFramesRead; + drmp3_assert(pSRC != NULL); drmp3_assert(frameCount > 0); drmp3_assert(pFramesOut != NULL); - // For linear SRC, the bin is only 2 frames: 1 prior, 1 future. + /* For linear SRC, the bin is only 2 frames: 1 prior, 1 future. */ - // Load the bin if necessary. + /* Load the bin if necessary. */ if (!pSRC->algo.linear.isPrevFramesLoaded) { drmp3_uint64 framesRead = drmp3_src_cache_read_frames(&pSRC->cache, 1, pSRC->bin); if (framesRead == 0) { @@ -2360,11 +2449,14 @@ drmp3_uint64 drmp3_src_read_frames_linear(drmp3_src* pSRC, drmp3_uint64 frameCou pSRC->algo.linear.isNextFramesLoaded = DRMP3_TRUE; } - double factor = (double)pSRC->config.sampleRateIn / pSRC->config.sampleRateOut; + factor = (double)pSRC->config.sampleRateIn / pSRC->config.sampleRateOut; - drmp3_uint64 totalFramesRead = 0; + totalFramesRead = 0; while (frameCount > 0) { - // The bin is where the previous and next frames are located. + drmp3_uint32 i; + drmp3_uint32 framesToReadFromClient; + + /* The bin is where the previous and next frames are located. */ float* pPrevFrame = pSRC->bin; float* pNextFrame = pSRC->bin + pSRC->config.channels; @@ -2372,19 +2464,23 @@ drmp3_uint64 drmp3_src_read_frames_linear(drmp3_src* pSRC, drmp3_uint64 frameCou pSRC->algo.linear.alpha += factor; - // The new alpha value is how we determine whether or not we need to read fresh frames. - drmp3_uint32 framesToReadFromClient = (drmp3_uint32)pSRC->algo.linear.alpha; + /* The new alpha value is how we determine whether or not we need to read fresh frames. */ + framesToReadFromClient = (drmp3_uint32)pSRC->algo.linear.alpha; pSRC->algo.linear.alpha = pSRC->algo.linear.alpha - framesToReadFromClient; - for (drmp3_uint32 i = 0; i < framesToReadFromClient; ++i) { - for (drmp3_uint32 j = 0; j < pSRC->config.channels; ++j) { + for (i = 0; i < framesToReadFromClient; ++i) { + drmp3_uint64 framesRead; + drmp3_uint32 j; + + for (j = 0; j < pSRC->config.channels; ++j) { pPrevFrame[j] = pNextFrame[j]; } - drmp3_uint64 framesRead = drmp3_src_cache_read_frames(&pSRC->cache, 1, pNextFrame); + framesRead = drmp3_src_cache_read_frames(&pSRC->cache, 1, pNextFrame); if (framesRead == 0) { - for (drmp3_uint32 j = 0; j < pSRC->config.channels; ++j) { - pNextFrame[j] = 0; + drmp3_uint32 k; + for (k = 0; k < pSRC->config.channels; ++k) { + pNextFrame[k] = 0; } if (pSRC->algo.linear.isNextFramesLoaded) { @@ -2403,7 +2499,7 @@ drmp3_uint64 drmp3_src_read_frames_linear(drmp3_src* pSRC, drmp3_uint64 frameCou frameCount -= 1; totalFramesRead += 1; - // If there's no frames available we need to get out of this loop. + /* If there's no frames available we need to get out of this loop. */ if (!pSRC->algo.linear.isNextFramesLoaded && (!flush || !pSRC->algo.linear.isPrevFramesLoaded)) { break; } @@ -2444,7 +2540,7 @@ static drmp3_bool32 drmp3__on_seek_64(drmp3* pMP3, drmp3_uint64 offset, drmp3_se } - // Getting here "offset" is too large for a 32-bit integer. We just keep seeking forward until we hit the offset. + /* Getting here "offset" is too large for a 32-bit integer. We just keep seeking forward until we hit the offset. */ if (!drmp3__on_seek(pMP3, 0x7FFFFFFF, drmp3_seek_origin_start)) { return DRMP3_FALSE; } @@ -2467,152 +2563,41 @@ static drmp3_bool32 drmp3__on_seek_64(drmp3* pMP3, drmp3_uint64 offset, drmp3_se return DRMP3_TRUE; } - - - -static drmp3_uint32 drmp3_decode_next_frame_ex(drmp3* pMP3, drmp3d_sample_t* pPCMFrames, drmp3_bool32 discard) -{ - drmp3_assert(pMP3 != NULL); - drmp3_assert(pMP3->onRead != NULL); - - if (pMP3->atEnd) { - return 0; - } - - drmp3_uint32 pcmFramesRead = 0; - do { - // minimp3 recommends doing data submission in 16K chunks. If we don't have at least 16K bytes available, get more. - if (pMP3->dataSize < DRMP3_DATA_CHUNK_SIZE) { - if (pMP3->dataCapacity < DRMP3_DATA_CHUNK_SIZE) { - pMP3->dataCapacity = DRMP3_DATA_CHUNK_SIZE; - drmp3_uint8* pNewData = (drmp3_uint8*)drmp3_realloc(pMP3->pData, pMP3->dataCapacity); - if (pNewData == NULL) { - return 0; // Out of memory. - } - - pMP3->pData = pNewData; - } - - size_t bytesRead = drmp3__on_read(pMP3, pMP3->pData + pMP3->dataSize, (pMP3->dataCapacity - pMP3->dataSize)); - if (bytesRead == 0) { - if (pMP3->dataSize == 0) { - pMP3->atEnd = DRMP3_TRUE; - return 0; // No data. - } - } - - pMP3->dataSize += bytesRead; - } - - if (pMP3->dataSize > INT_MAX) { - pMP3->atEnd = DRMP3_TRUE; - return 0; // File too big. - } - - drmp3dec_frame_info info; - pcmFramesRead = drmp3dec_decode_frame(&pMP3->decoder, pMP3->pData, (int)pMP3->dataSize, pPCMFrames, &info); // <-- Safe size_t -> int conversion thanks to the check above. - - // Consume the data. - size_t leftoverDataSize = (pMP3->dataSize - (size_t)info.frame_bytes); - if (info.frame_bytes > 0) { - memmove(pMP3->pData, pMP3->pData + info.frame_bytes, leftoverDataSize); - pMP3->dataSize = leftoverDataSize; - } - - // pcmFramesRead will be equal to 0 if decoding failed. If it is zero and info.frame_bytes > 0 then we have successfully - // decoded the frame. A special case is if we are wanting to discard the frame, in which case we return successfully. - if (pcmFramesRead > 0 || (info.frame_bytes > 0 && discard)) { - pcmFramesRead = drmp3_hdr_frame_samples(pMP3->decoder.header); - pMP3->pcmFramesConsumedInMP3Frame = 0; - pMP3->pcmFramesRemainingInMP3Frame = pcmFramesRead; - pMP3->mp3FrameChannels = info.channels; - pMP3->mp3FrameSampleRate = info.hz; - drmp3_src_set_input_sample_rate(&pMP3->src, pMP3->mp3FrameSampleRate); - break; - } else if (info.frame_bytes == 0) { - // Need more data. minimp3 recommends doing data submission in 16K chunks. - if (pMP3->dataCapacity == pMP3->dataSize) { - // No room. Expand. - pMP3->dataCapacity += DRMP3_DATA_CHUNK_SIZE; - drmp3_uint8* pNewData = (drmp3_uint8*)drmp3_realloc(pMP3->pData, pMP3->dataCapacity); - if (pNewData == NULL) { - return 0; // Out of memory. - } - - pMP3->pData = pNewData; - } - - // Fill in a chunk. - size_t bytesRead = drmp3__on_read(pMP3, pMP3->pData + pMP3->dataSize, (pMP3->dataCapacity - pMP3->dataSize)); - if (bytesRead == 0) { - pMP3->atEnd = DRMP3_TRUE; - return 0; // Error reading more data. - } - - pMP3->dataSize += bytesRead; - } - } while (DRMP3_TRUE); - - return pcmFramesRead; -} - -static drmp3_uint32 drmp3_decode_next_frame(drmp3* pMP3) -{ - drmp3_assert(pMP3 != NULL); - return drmp3_decode_next_frame_ex(pMP3, (drmp3d_sample_t*)pMP3->pcmFrames, DRMP3_FALSE); -} - -#if 0 -static drmp3_uint32 drmp3_seek_next_frame(drmp3* pMP3) -{ - drmp3_assert(pMP3 != NULL); - - drmp3_uint32 pcmFrameCount = drmp3_decode_next_frame_ex(pMP3, NULL); - if (pcmFrameCount == 0) { - return 0; - } - - // We have essentially just skipped past the frame, so just set the remaining samples to 0. - pMP3->currentPCMFrame += pcmFrameCount; - pMP3->pcmFramesConsumedInMP3Frame = pcmFrameCount; - pMP3->pcmFramesRemainingInMP3Frame = 0; - - return pcmFrameCount; -} -#endif +static drmp3_uint32 drmp3_decode_next_frame_ex(drmp3* pMP3, drmp3d_sample_t* pPCMFrames, drmp3_bool32 discard); +static drmp3_uint32 drmp3_decode_next_frame(drmp3* pMP3); static drmp3_uint64 drmp3_read_src(drmp3_src* pSRC, drmp3_uint64 frameCount, void* pFramesOut, void* pUserData) { drmp3* pMP3 = (drmp3*)pUserData; - drmp3_assert(pMP3 != NULL); - drmp3_assert(pMP3->onRead != NULL); - float* pFramesOutF = (float*)pFramesOut; drmp3_uint64 totalFramesRead = 0; + drmp3_assert(pMP3 != NULL); + drmp3_assert(pMP3->onRead != NULL); + while (frameCount > 0) { - // Read from the in-memory buffer first. + /* Read from the in-memory buffer first. */ while (pMP3->pcmFramesRemainingInMP3Frame > 0 && frameCount > 0) { drmp3d_sample_t* frames = (drmp3d_sample_t*)pMP3->pcmFrames; #ifndef DR_MP3_FLOAT_OUTPUT if (pMP3->mp3FrameChannels == 1) { if (pMP3->channels == 1) { - // Mono -> Mono. + /* Mono -> Mono. */ pFramesOutF[0] = frames[pMP3->pcmFramesConsumedInMP3Frame] / 32768.0f; } else { - // Mono -> Stereo. + /* Mono -> Stereo. */ pFramesOutF[0] = frames[pMP3->pcmFramesConsumedInMP3Frame] / 32768.0f; pFramesOutF[1] = frames[pMP3->pcmFramesConsumedInMP3Frame] / 32768.0f; } } else { if (pMP3->channels == 1) { - // Stereo -> Mono + /* Stereo -> Mono */ float sample = 0; sample += frames[(pMP3->pcmFramesConsumedInMP3Frame*pMP3->mp3FrameChannels)+0] / 32768.0f; sample += frames[(pMP3->pcmFramesConsumedInMP3Frame*pMP3->mp3FrameChannels)+1] / 32768.0f; pFramesOutF[0] = sample * 0.5f; } else { - // Stereo -> Stereo + /* Stereo -> Stereo */ pFramesOutF[0] = frames[(pMP3->pcmFramesConsumedInMP3Frame*pMP3->mp3FrameChannels)+0] / 32768.0f; pFramesOutF[1] = frames[(pMP3->pcmFramesConsumedInMP3Frame*pMP3->mp3FrameChannels)+1] / 32768.0f; } @@ -2620,22 +2605,22 @@ static drmp3_uint64 drmp3_read_src(drmp3_src* pSRC, drmp3_uint64 frameCount, voi #else if (pMP3->mp3FrameChannels == 1) { if (pMP3->channels == 1) { - // Mono -> Mono. + /* Mono -> Mono. */ pFramesOutF[0] = frames[pMP3->pcmFramesConsumedInMP3Frame]; } else { - // Mono -> Stereo. + /* Mono -> Stereo. */ pFramesOutF[0] = frames[pMP3->pcmFramesConsumedInMP3Frame]; pFramesOutF[1] = frames[pMP3->pcmFramesConsumedInMP3Frame]; } } else { if (pMP3->channels == 1) { - // Stereo -> Mono + /* Stereo -> Mono */ float sample = 0; sample += frames[(pMP3->pcmFramesConsumedInMP3Frame*pMP3->mp3FrameChannels)+0]; sample += frames[(pMP3->pcmFramesConsumedInMP3Frame*pMP3->mp3FrameChannels)+1]; pFramesOutF[0] = sample * 0.5f; } else { - // Stereo -> Stereo + /* Stereo -> Stereo */ pFramesOutF[0] = frames[(pMP3->pcmFramesConsumedInMP3Frame*pMP3->mp3FrameChannels)+0]; pFramesOutF[1] = frames[(pMP3->pcmFramesConsumedInMP3Frame*pMP3->mp3FrameChannels)+1]; } @@ -2655,8 +2640,10 @@ static drmp3_uint64 drmp3_read_src(drmp3_src* pSRC, drmp3_uint64 frameCount, voi drmp3_assert(pMP3->pcmFramesRemainingInMP3Frame == 0); - // At this point we have exhausted our in-memory buffer so we need to re-fill. Note that the sample rate may have changed - // at this point which means we'll also need to update our sample rate conversion pipeline. + /* + At this point we have exhausted our in-memory buffer so we need to re-fill. Note that the sample rate may have changed + at this point which means we'll also need to update our sample rate conversion pipeline. + */ if (drmp3_decode_next_frame(pMP3) == 0) { break; } @@ -2665,42 +2652,8 @@ static drmp3_uint64 drmp3_read_src(drmp3_src* pSRC, drmp3_uint64 frameCount, voi return totalFramesRead; } -drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drmp3_seek_proc onSeek, void* pUserData, const drmp3_config* pConfig) +static drmp3_bool32 drmp3_init_src(drmp3* pMP3) { - drmp3_assert(pMP3 != NULL); - drmp3_assert(onRead != NULL); - - // This function assumes the output object has already been reset to 0. Do not do that here, otherwise things will break. - drmp3dec_init(&pMP3->decoder); - - // The config can be null in which case we use defaults. - drmp3_config config; - if (pConfig != NULL) { - config = *pConfig; - } else { - drmp3_zero_object(&config); - } - - pMP3->channels = config.outputChannels; - if (pMP3->channels == 0) { - pMP3->channels = DR_MP3_DEFAULT_CHANNELS; - } - - // Cannot have more than 2 channels. - if (pMP3->channels > 2) { - pMP3->channels = 2; - } - - pMP3->sampleRate = config.outputSampleRate; - if (pMP3->sampleRate == 0) { - pMP3->sampleRate = DR_MP3_DEFAULT_SAMPLE_RATE; - } - - pMP3->onRead = onRead; - pMP3->onSeek = onSeek; - pMP3->pUserData = pUserData; - - // We need a sample rate converter for converting the sample rate from the MP3 frames to the requested output sample rate. drmp3_src_config srcConfig; drmp3_zero_object(&srcConfig); srcConfig.sampleRateIn = DR_MP3_DEFAULT_SAMPLE_RATE; @@ -2711,11 +2664,190 @@ drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drmp3_seek drmp3_uninit(pMP3); return DRMP3_FALSE; } + + return DRMP3_TRUE; +} + +static drmp3_uint32 drmp3_decode_next_frame_ex(drmp3* pMP3, drmp3d_sample_t* pPCMFrames, drmp3_bool32 discard) +{ + drmp3_uint32 pcmFramesRead = 0; + + drmp3_assert(pMP3 != NULL); + drmp3_assert(pMP3->onRead != NULL); + + if (pMP3->atEnd) { + return 0; + } + + do { + drmp3dec_frame_info info; + size_t leftoverDataSize; + + /* minimp3 recommends doing data submission in 16K chunks. If we don't have at least 16K bytes available, get more. */ + if (pMP3->dataSize < DRMP3_DATA_CHUNK_SIZE) { + size_t bytesRead; + + if (pMP3->dataCapacity < DRMP3_DATA_CHUNK_SIZE) { + drmp3_uint8* pNewData; + + pMP3->dataCapacity = DRMP3_DATA_CHUNK_SIZE; + pNewData = (drmp3_uint8*)drmp3_realloc(pMP3->pData, pMP3->dataCapacity); + if (pNewData == NULL) { + return 0; /* Out of memory. */ + } + + pMP3->pData = pNewData; + } + + bytesRead = drmp3__on_read(pMP3, pMP3->pData + pMP3->dataSize, (pMP3->dataCapacity - pMP3->dataSize)); + if (bytesRead == 0) { + if (pMP3->dataSize == 0) { + pMP3->atEnd = DRMP3_TRUE; + return 0; /* No data. */ + } + } + + pMP3->dataSize += bytesRead; + } + + if (pMP3->dataSize > INT_MAX) { + pMP3->atEnd = DRMP3_TRUE; + return 0; /* File too big. */ + } + + pcmFramesRead = drmp3dec_decode_frame(&pMP3->decoder, pMP3->pData, (int)pMP3->dataSize, pPCMFrames, &info); /* <-- Safe size_t -> int conversion thanks to the check above. */ + + /* Consume the data. */ + leftoverDataSize = (pMP3->dataSize - (size_t)info.frame_bytes); + if (info.frame_bytes > 0) { + memmove(pMP3->pData, pMP3->pData + info.frame_bytes, leftoverDataSize); + pMP3->dataSize = leftoverDataSize; + } + + /* + pcmFramesRead will be equal to 0 if decoding failed. If it is zero and info.frame_bytes > 0 then we have successfully + decoded the frame. A special case is if we are wanting to discard the frame, in which case we return successfully. + */ + if (pcmFramesRead > 0 || (info.frame_bytes > 0 && discard)) { + pcmFramesRead = drmp3_hdr_frame_samples(pMP3->decoder.header); + pMP3->pcmFramesConsumedInMP3Frame = 0; + pMP3->pcmFramesRemainingInMP3Frame = pcmFramesRead; + pMP3->mp3FrameChannels = info.channels; + pMP3->mp3FrameSampleRate = info.hz; + + /* We need to initialize the resampler if we don't yet have the channel count or sample rate. */ + if (pMP3->channels == 0 || pMP3->sampleRate == 0) { + if (pMP3->channels == 0) { + pMP3->channels = info.channels; + } + if (pMP3->sampleRate == 0) { + pMP3->sampleRate = info.hz; + } + drmp3_init_src(pMP3); + } + + drmp3_src_set_input_sample_rate(&pMP3->src, pMP3->mp3FrameSampleRate); + break; + } else if (info.frame_bytes == 0) { + size_t bytesRead; + + /* Need more data. minimp3 recommends doing data submission in 16K chunks. */ + if (pMP3->dataCapacity == pMP3->dataSize) { + drmp3_uint8* pNewData; + + /* No room. Expand. */ + pMP3->dataCapacity += DRMP3_DATA_CHUNK_SIZE; + pNewData = (drmp3_uint8*)drmp3_realloc(pMP3->pData, pMP3->dataCapacity); + if (pNewData == NULL) { + return 0; /* Out of memory. */ + } + + pMP3->pData = pNewData; + } + + /* Fill in a chunk. */ + bytesRead = drmp3__on_read(pMP3, pMP3->pData + pMP3->dataSize, (pMP3->dataCapacity - pMP3->dataSize)); + if (bytesRead == 0) { + pMP3->atEnd = DRMP3_TRUE; + return 0; /* Error reading more data. */ + } + + pMP3->dataSize += bytesRead; + } + } while (DRMP3_TRUE); + + return pcmFramesRead; +} + +static drmp3_uint32 drmp3_decode_next_frame(drmp3* pMP3) +{ + drmp3_assert(pMP3 != NULL); + return drmp3_decode_next_frame_ex(pMP3, (drmp3d_sample_t*)pMP3->pcmFrames, DRMP3_FALSE); +} + +#if 0 +static drmp3_uint32 drmp3_seek_next_frame(drmp3* pMP3) +{ + drmp3_uint32 pcmFrameCount; + + drmp3_assert(pMP3 != NULL); + + pcmFrameCount = drmp3_decode_next_frame_ex(pMP3, NULL); + if (pcmFrameCount == 0) { + return 0; + } + + /* We have essentially just skipped past the frame, so just set the remaining samples to 0. */ + pMP3->currentPCMFrame += pcmFrameCount; + pMP3->pcmFramesConsumedInMP3Frame = pcmFrameCount; + pMP3->pcmFramesRemainingInMP3Frame = 0; + + return pcmFrameCount; +} +#endif + +drmp3_bool32 drmp3_init_internal(drmp3* pMP3, drmp3_read_proc onRead, drmp3_seek_proc onSeek, void* pUserData, const drmp3_config* pConfig) +{ + drmp3_config config; + + drmp3_assert(pMP3 != NULL); + drmp3_assert(onRead != NULL); + + /* This function assumes the output object has already been reset to 0. Do not do that here, otherwise things will break. */ + drmp3dec_init(&pMP3->decoder); + + /* The config can be null in which case we use defaults. */ + if (pConfig != NULL) { + config = *pConfig; + } else { + drmp3_zero_object(&config); + } + + pMP3->channels = config.outputChannels; + + /* Cannot have more than 2 channels. */ + if (pMP3->channels > 2) { + pMP3->channels = 2; + } + + pMP3->sampleRate = config.outputSampleRate; + + pMP3->onRead = onRead; + pMP3->onSeek = onSeek; + pMP3->pUserData = pUserData; + + /* + We need a sample rate converter for converting the sample rate from the MP3 frames to the requested output sample rate. Note that if + we don't yet know the channel count or sample rate we defer this until the first frame is read. + */ + if (pMP3->channels != 0 && pMP3->sampleRate != 0) { + drmp3_init_src(pMP3); + } - // Decode the first frame to confirm that it is indeed a valid MP3 stream. + /* Decode the first frame to confirm that it is indeed a valid MP3 stream. */ if (!drmp3_decode_next_frame(pMP3)) { drmp3_uninit(pMP3); - return DRMP3_FALSE; // Not a valid MP3 stream. + return DRMP3_FALSE; /* Not a valid MP3 stream. */ } return DRMP3_TRUE; @@ -2735,10 +2867,12 @@ drmp3_bool32 drmp3_init(drmp3* pMP3, drmp3_read_proc onRead, drmp3_seek_proc onS static size_t drmp3__on_read_memory(void* pUserData, void* pBufferOut, size_t bytesToRead) { drmp3* pMP3 = (drmp3*)pUserData; + size_t bytesRemaining; + drmp3_assert(pMP3 != NULL); drmp3_assert(pMP3->memory.dataSize >= pMP3->memory.currentReadPos); - size_t bytesRemaining = pMP3->memory.dataSize - pMP3->memory.currentReadPos; + bytesRemaining = pMP3->memory.dataSize - pMP3->memory.currentReadPos; if (bytesToRead > bytesRemaining) { bytesToRead = bytesRemaining; } @@ -2754,26 +2888,27 @@ static size_t drmp3__on_read_memory(void* pUserData, void* pBufferOut, size_t by static drmp3_bool32 drmp3__on_seek_memory(void* pUserData, int byteOffset, drmp3_seek_origin origin) { drmp3* pMP3 = (drmp3*)pUserData; + drmp3_assert(pMP3 != NULL); if (origin == drmp3_seek_origin_current) { if (byteOffset > 0) { if (pMP3->memory.currentReadPos + byteOffset > pMP3->memory.dataSize) { - byteOffset = (int)(pMP3->memory.dataSize - pMP3->memory.currentReadPos); // Trying to seek too far forward. + byteOffset = (int)(pMP3->memory.dataSize - pMP3->memory.currentReadPos); /* Trying to seek too far forward. */ } } else { if (pMP3->memory.currentReadPos < (size_t)-byteOffset) { - byteOffset = -(int)pMP3->memory.currentReadPos; // Trying to seek too far backwards. + byteOffset = -(int)pMP3->memory.currentReadPos; /* Trying to seek too far backwards. */ } } - // This will never underflow thanks to the clamps above. + /* This will never underflow thanks to the clamps above. */ pMP3->memory.currentReadPos += byteOffset; } else { if ((drmp3_uint32)byteOffset <= pMP3->memory.dataSize) { pMP3->memory.currentReadPos = byteOffset; } else { - pMP3->memory.currentReadPos = pMP3->memory.dataSize; // Trying to seek too far forward. + pMP3->memory.currentReadPos = pMP3->memory.dataSize; /* Trying to seek too far forward. */ } } @@ -2848,21 +2983,22 @@ void drmp3_uninit(drmp3* pMP3) drmp3_uint64 drmp3_read_pcm_frames_f32(drmp3* pMP3, drmp3_uint64 framesToRead, float* pBufferOut) { + drmp3_uint64 totalFramesRead = 0; + if (pMP3 == NULL || pMP3->onRead == NULL) { return 0; } - drmp3_uint64 totalFramesRead = 0; - if (pBufferOut == NULL) { float temp[4096]; while (framesToRead > 0) { + drmp3_uint64 framesJustRead; drmp3_uint64 framesToReadRightNow = sizeof(temp)/sizeof(temp[0]) / pMP3->channels; if (framesToReadRightNow > framesToRead) { framesToReadRightNow = framesToRead; } - drmp3_uint64 framesJustRead = drmp3_read_pcm_frames_f32(pMP3, framesToReadRightNow, temp); + framesJustRead = drmp3_read_pcm_frames_f32(pMP3, framesToReadRightNow, temp); if (framesJustRead == 0) { break; } @@ -2878,6 +3014,41 @@ drmp3_uint64 drmp3_read_pcm_frames_f32(drmp3* pMP3, drmp3_uint64 framesToRead, f return totalFramesRead; } +drmp3_uint64 drmp3_read_pcm_frames_s16(drmp3* pMP3, drmp3_uint64 framesToRead, drmp3_int16* pBufferOut) +{ + float tempF32[4096]; + drmp3_uint64 pcmFramesJustRead; + drmp3_uint64 totalPCMFramesRead = 0; + + if (pMP3 == NULL || pMP3->onRead == NULL) { + return 0; + } + + /* Naive implementation: read into a temp f32 buffer, then convert. */ + for (;;) { + drmp3_uint64 pcmFramesToReadThisIteration = (framesToRead - totalPCMFramesRead); + if (pcmFramesToReadThisIteration > drmp3_countof(tempF32)/pMP3->channels) { + pcmFramesToReadThisIteration = drmp3_countof(tempF32)/pMP3->channels; + } + + pcmFramesJustRead = drmp3_read_pcm_frames_f32(pMP3, pcmFramesToReadThisIteration, tempF32); + if (pcmFramesJustRead == 0) { + break; + } + + drmp3dec_f32_to_s16(tempF32, pBufferOut, (int)(pcmFramesJustRead * pMP3->channels)); /* <-- Safe cast since pcmFramesJustRead will be clamped based on the size of tempF32 which is always small. */ + pBufferOut += pcmFramesJustRead * pMP3->channels; + + totalPCMFramesRead += pcmFramesJustRead; + + if (pcmFramesJustRead < pcmFramesToReadThisIteration) { + break; + } + } + + return totalPCMFramesRead; +} + void drmp3_reset(drmp3* pMP3) { drmp3_assert(pMP3 != NULL); @@ -2896,7 +3067,6 @@ void drmp3_reset(drmp3* pMP3) pMP3->src.algo.linear.alpha = 0; pMP3->src.algo.linear.isNextFramesLoaded = 0; pMP3->src.algo.linear.isPrevFramesLoaded = 0; - //drmp3_zero_object(&pMP3->decoder); drmp3dec_init(&pMP3->decoder); } @@ -2905,12 +3075,12 @@ drmp3_bool32 drmp3_seek_to_start_of_stream(drmp3* pMP3) drmp3_assert(pMP3 != NULL); drmp3_assert(pMP3->onSeek != NULL); - // Seek to the start of the stream to begin with. + /* Seek to the start of the stream to begin with. */ if (!drmp3__on_seek(pMP3, 0, drmp3_seek_origin_start)) { return DRMP3_FALSE; } - // Clear any cached data. + /* Clear any cached data. */ drmp3_reset(pMP3); return DRMP3_TRUE; } @@ -2927,26 +3097,31 @@ float drmp3_get_pcm_frames_remaining_in_mp3_frame(drmp3* pMP3) return frameCountPreSRC * factor; } -// NOTE ON SEEKING -// =============== -// The seeking code below is a complete mess and is broken for cases when the sample rate changes. The problem -// is with the resampling and the crappy resampler used by dr_mp3. What needs to happen is the following: -// -// 1) The resampler needs to be replaced. -// 2) The resampler has state which needs to be updated whenever an MP3 frame is decoded outside of -// drmp3_read_pcm_frames_f32(). The resampler needs an API to "flush" some imaginary input so that it's -// state is updated accordingly. +/* +NOTE ON SEEKING +=============== +The seeking code below is a complete mess and is broken for cases when the sample rate changes. The problem +is with the resampling and the crappy resampler used by dr_mp3. What needs to happen is the following: +1) The resampler needs to be replaced. +2) The resampler has state which needs to be updated whenever an MP3 frame is decoded outside of + drmp3_read_pcm_frames_f32(). The resampler needs an API to "flush" some imaginary input so that it's + state is updated accordingly. +*/ drmp3_bool32 drmp3_seek_forward_by_pcm_frames__brute_force(drmp3* pMP3, drmp3_uint64 frameOffset) { + drmp3_uint64 framesRead; + #if 0 - // MP3 is a bit annoying when it comes to seeking because of the bit reservoir. It basically means that an MP3 frame can possibly - // depend on some of the data of prior frames. This means it's not as simple as seeking to the first byte of the MP3 frame that - // contains the sample because that MP3 frame will need the data from the previous MP3 frame (which we just seeked past!). To - // resolve this we seek past a number of MP3 frames up to a point, and then read-and-discard the remainder. + /* + MP3 is a bit annoying when it comes to seeking because of the bit reservoir. It basically means that an MP3 frame can possibly + depend on some of the data of prior frames. This means it's not as simple as seeking to the first byte of the MP3 frame that + contains the sample because that MP3 frame will need the data from the previous MP3 frame (which we just seeked past!). To + resolve this we seek past a number of MP3 frames up to a point, and then read-and-discard the remainder. + */ drmp3_uint64 maxFramesToReadAndDiscard = (drmp3_uint64)(DRMP3_MAX_PCM_FRAMES_PER_MP3_FRAME * 3 * ((float)pMP3->src.config.sampleRateOut / (float)pMP3->src.config.sampleRateIn)); - // Now get rid of leading whole frames. + /* Now get rid of leading whole frames. */ while (frameOffset > maxFramesToReadAndDiscard) { float pcmFramesRemainingInCurrentMP3FrameF = drmp3_get_pcm_frames_remaining_in_mp3_frame(pMP3); drmp3_uint32 pcmFramesRemainingInCurrentMP3Frame = (drmp3_uint32)pcmFramesRemainingInCurrentMP3FrameF; @@ -2965,14 +3140,14 @@ drmp3_bool32 drmp3_seek_forward_by_pcm_frames__brute_force(drmp3* pMP3, drmp3_ui } } - // The last step is to read-and-discard any remaining PCM frames to make it sample-exact. - drmp3_uint64 framesRead = drmp3_read_pcm_frames_f32(pMP3, frameOffset, NULL); + /* The last step is to read-and-discard any remaining PCM frames to make it sample-exact. */ + framesRead = drmp3_read_pcm_frames_f32(pMP3, frameOffset, NULL); if (framesRead != frameOffset) { return DRMP3_FALSE; } #else - // Just using a dumb read-and-discard for now pending updates to the resampler. - drmp3_uint64 framesRead = drmp3_read_pcm_frames_f32(pMP3, frameOffset, NULL); + /* Just using a dumb read-and-discard for now pending updates to the resampler. */ + framesRead = drmp3_read_pcm_frames_f32(pMP3, frameOffset, NULL); if (framesRead != frameOffset) { return DRMP3_FALSE; } @@ -2989,11 +3164,12 @@ drmp3_bool32 drmp3_seek_to_pcm_frame__brute_force(drmp3* pMP3, drmp3_uint64 fram return DRMP3_TRUE; } - // If we're moving foward we just read from where we're at. Otherwise we need to move back to the start of - // the stream and read from the beginning. - //drmp3_uint64 framesToReadAndDiscard; + /* + If we're moving foward we just read from where we're at. Otherwise we need to move back to the start of + the stream and read from the beginning. + */ if (frameIndex < pMP3->currentPCMFrame) { - // Moving backward. Move to the start of the stream and then move forward. + /* Moving backward. Move to the start of the stream and then move forward. */ if (!drmp3_seek_to_start_of_stream(pMP3)) { return DRMP3_FALSE; } @@ -3005,16 +3181,20 @@ drmp3_bool32 drmp3_seek_to_pcm_frame__brute_force(drmp3* pMP3, drmp3_uint64 fram drmp3_bool32 drmp3_find_closest_seek_point(drmp3* pMP3, drmp3_uint64 frameIndex, drmp3_uint32* pSeekPointIndex) { + drmp3_uint32 iSeekPoint; + drmp3_assert(pSeekPointIndex != NULL); + *pSeekPointIndex = 0; + if (frameIndex < pMP3->pSeekPoints[0].pcmFrameIndex) { return DRMP3_FALSE; } - // Linear search for simplicity to begin with while I'm getting this thing working. Once it's all working change this to a binary search. - for (drmp3_uint32 iSeekPoint = 0; iSeekPoint < pMP3->seekPointCount; ++iSeekPoint) { + /* Linear search for simplicity to begin with while I'm getting this thing working. Once it's all working change this to a binary search. */ + for (iSeekPoint = 0; iSeekPoint < pMP3->seekPointCount; ++iSeekPoint) { if (pMP3->pSeekPoints[iSeekPoint].pcmFrameIndex > frameIndex) { - break; // Found it. + break; /* Found it. */ } *pSeekPointIndex = iSeekPoint; @@ -3025,14 +3205,16 @@ drmp3_bool32 drmp3_find_closest_seek_point(drmp3* pMP3, drmp3_uint64 frameIndex, drmp3_bool32 drmp3_seek_to_pcm_frame__seek_table(drmp3* pMP3, drmp3_uint64 frameIndex) { + drmp3_seek_point seekPoint; + drmp3_uint32 priorSeekPointIndex; + drmp3_uint16 iMP3Frame; + drmp3_uint64 leftoverFrames; + drmp3_assert(pMP3 != NULL); drmp3_assert(pMP3->pSeekPoints != NULL); drmp3_assert(pMP3->seekPointCount > 0); - drmp3_seek_point seekPoint; - - // If there is no prior seekpoint it means the target PCM frame comes before the first seek point. Just assume a seekpoint at the start of the file in this case. - drmp3_uint32 priorSeekPointIndex; + /* If there is no prior seekpoint it means the target PCM frame comes before the first seek point. Just assume a seekpoint at the start of the file in this case. */ if (drmp3_find_closest_seek_point(pMP3, frameIndex, &priorSeekPointIndex)) { seekPoint = pMP3->pSeekPoints[priorSeekPointIndex]; } else { @@ -3042,44 +3224,51 @@ drmp3_bool32 drmp3_seek_to_pcm_frame__seek_table(drmp3* pMP3, drmp3_uint64 frame seekPoint.pcmFramesToDiscard = 0; } - // First thing to do is seek to the first byte of the relevant MP3 frame. + /* First thing to do is seek to the first byte of the relevant MP3 frame. */ if (!drmp3__on_seek_64(pMP3, seekPoint.seekPosInBytes, drmp3_seek_origin_start)) { - return DRMP3_FALSE; // Failed to seek. + return DRMP3_FALSE; /* Failed to seek. */ } - // Clear any cached data. + /* Clear any cached data. */ drmp3_reset(pMP3); - // Whole MP3 frames need to be discarded first. - for (drmp3_uint16 iMP3Frame = 0; iMP3Frame < seekPoint.mp3FramesToDiscard; ++iMP3Frame) { - // Pass in non-null for the last frame because we want to ensure the sample rate converter is preloaded correctly. - drmp3d_sample_t* pPCMFrames = NULL; + /* Whole MP3 frames need to be discarded first. */ + for (iMP3Frame = 0; iMP3Frame < seekPoint.mp3FramesToDiscard; ++iMP3Frame) { + drmp3_uint32 pcmFramesReadPreSRC; + drmp3d_sample_t* pPCMFrames; + + /* Pass in non-null for the last frame because we want to ensure the sample rate converter is preloaded correctly. */ + pPCMFrames = NULL; if (iMP3Frame == seekPoint.mp3FramesToDiscard-1) { pPCMFrames = (drmp3d_sample_t*)pMP3->pcmFrames; } - // We first need to decode the next frame, and then we need to flush the resampler. - drmp3_uint32 pcmFramesReadPreSRC = drmp3_decode_next_frame_ex(pMP3, pPCMFrames, DRMP3_TRUE); + /* We first need to decode the next frame, and then we need to flush the resampler. */ + pcmFramesReadPreSRC = drmp3_decode_next_frame_ex(pMP3, pPCMFrames, DRMP3_TRUE); if (pcmFramesReadPreSRC == 0) { return DRMP3_FALSE; } } - // We seeked to an MP3 frame in the raw stream so we need to make sure the current PCM frame is set correctly. + /* We seeked to an MP3 frame in the raw stream so we need to make sure the current PCM frame is set correctly. */ pMP3->currentPCMFrame = seekPoint.pcmFrameIndex - seekPoint.pcmFramesToDiscard; - // Update resampler. This is wrong. Need to instead update it on a per MP3 frame basis. Also broken for cases when - // the sample rate is being reduced in my testing. Should work fine when the input and output sample rate is the same - // or a clean multiple. - pMP3->src.algo.linear.alpha = pMP3->currentPCMFrame * ((double)pMP3->src.config.sampleRateIn / pMP3->src.config.sampleRateOut); + /* + Update resampler. This is wrong. Need to instead update it on a per MP3 frame basis. Also broken for cases when + the sample rate is being reduced in my testing. Should work fine when the input and output sample rate is the same + or a clean multiple. + */ + pMP3->src.algo.linear.alpha = (drmp3_int64)pMP3->currentPCMFrame * ((double)pMP3->src.config.sampleRateIn / pMP3->src.config.sampleRateOut); /* <-- Cast to int64 is required for VC6. */ pMP3->src.algo.linear.alpha = pMP3->src.algo.linear.alpha - (drmp3_uint32)(pMP3->src.algo.linear.alpha); if (pMP3->src.algo.linear.alpha > 0) { pMP3->src.algo.linear.isPrevFramesLoaded = 1; } - // Now at this point we can follow the same process as the brute force technique where we just skip over unnecessary MP3 frames and then - // read-and-discard at least 2 whole MP3 frames. - drmp3_uint64 leftoverFrames = frameIndex - pMP3->currentPCMFrame; + /* + Now at this point we can follow the same process as the brute force technique where we just skip over unnecessary MP3 frames and then + read-and-discard at least 2 whole MP3 frames. + */ + leftoverFrames = frameIndex - pMP3->currentPCMFrame; return drmp3_seek_forward_by_pcm_frames__brute_force(pMP3, leftoverFrames); } @@ -3093,7 +3282,7 @@ drmp3_bool32 drmp3_seek_to_pcm_frame(drmp3* pMP3, drmp3_uint64 frameIndex) return drmp3_seek_to_start_of_stream(pMP3); } - // Use the seek table if we have one. + /* Use the seek table if we have one. */ if (pMP3->pSeekPoints != NULL && pMP3->seekPointCount > 0) { return drmp3_seek_to_pcm_frame__seek_table(pMP3, frameIndex); } else { @@ -3103,46 +3292,58 @@ drmp3_bool32 drmp3_seek_to_pcm_frame(drmp3* pMP3, drmp3_uint64 frameIndex) drmp3_bool32 drmp3_get_mp3_and_pcm_frame_count(drmp3* pMP3, drmp3_uint64* pMP3FrameCount, drmp3_uint64* pPCMFrameCount) { + drmp3_uint64 currentPCMFrame; + drmp3_uint64 totalPCMFrameCount; + drmp3_uint64 totalMP3FrameCount; + float totalPCMFrameCountFractionalPart; + if (pMP3 == NULL) { return DRMP3_FALSE; } - // The way this works is we move back to the start of the stream, iterate over each MP3 frame and calculate the frame count based - // on our output sample rate, the seek back to the PCM frame we were sitting on before calling this function. + /* + The way this works is we move back to the start of the stream, iterate over each MP3 frame and calculate the frame count based + on our output sample rate, the seek back to the PCM frame we were sitting on before calling this function. + */ - // The stream must support seeking for this to work. + /* The stream must support seeking for this to work. */ if (pMP3->onSeek == NULL) { return DRMP3_FALSE; } - // We'll need to seek back to where we were, so grab the PCM frame we're currently sitting on so we can restore later. - drmp3_uint64 currentPCMFrame = pMP3->currentPCMFrame; + /* We'll need to seek back to where we were, so grab the PCM frame we're currently sitting on so we can restore later. */ + currentPCMFrame = pMP3->currentPCMFrame; if (!drmp3_seek_to_start_of_stream(pMP3)) { return DRMP3_FALSE; } - drmp3_uint64 totalPCMFrameCount = 0; - drmp3_uint64 totalMP3FrameCount = 0; + totalPCMFrameCount = 0; + totalMP3FrameCount = 0; - float totalPCMFrameCountFractionalPart = 0; // <-- With resampling there will be a fractional part to each MP3 frame that we need to accumulate. + totalPCMFrameCountFractionalPart = 0; /* <-- With resampling there will be a fractional part to each MP3 frame that we need to accumulate. */ for (;;) { - drmp3_uint32 pcmFramesInCurrentMP3FrameIn = drmp3_decode_next_frame_ex(pMP3, NULL, DRMP3_FALSE); + drmp3_uint32 pcmFramesInCurrentMP3FrameIn; + float srcRatio; + float pcmFramesInCurrentMP3FrameOutF; + drmp3_uint32 pcmFramesInCurrentMP3FrameOut; + + pcmFramesInCurrentMP3FrameIn = drmp3_decode_next_frame_ex(pMP3, NULL, DRMP3_FALSE); if (pcmFramesInCurrentMP3FrameIn == 0) { break; } - float srcRatio = (float)pMP3->mp3FrameSampleRate / (float)pMP3->sampleRate; + srcRatio = (float)pMP3->mp3FrameSampleRate / (float)pMP3->sampleRate; drmp3_assert(srcRatio > 0); - float pcmFramesInCurrentMP3FrameOutF = totalPCMFrameCountFractionalPart + (pcmFramesInCurrentMP3FrameIn / srcRatio); - drmp3_uint32 pcmFramesInCurrentMP3FrameOut = (drmp3_uint32)pcmFramesInCurrentMP3FrameOutF; + pcmFramesInCurrentMP3FrameOutF = totalPCMFrameCountFractionalPart + (pcmFramesInCurrentMP3FrameIn / srcRatio); + pcmFramesInCurrentMP3FrameOut = (drmp3_uint32)pcmFramesInCurrentMP3FrameOutF; totalPCMFrameCountFractionalPart = pcmFramesInCurrentMP3FrameOutF - pcmFramesInCurrentMP3FrameOut; totalPCMFrameCount += pcmFramesInCurrentMP3FrameOut; totalMP3FrameCount += 1; } - // Finally, we need to seek back to where we were. + /* Finally, we need to seek back to where we were. */ if (!drmp3_seek_to_start_of_stream(pMP3)) { return DRMP3_FALSE; } @@ -3183,11 +3384,15 @@ drmp3_uint64 drmp3_get_mp3_frame_count(drmp3* pMP3) void drmp3__accumulate_running_pcm_frame_count(drmp3* pMP3, drmp3_uint32 pcmFrameCountIn, drmp3_uint64* pRunningPCMFrameCount, float* pRunningPCMFrameCountFractionalPart) { - float srcRatio = (float)pMP3->mp3FrameSampleRate / (float)pMP3->sampleRate; + float srcRatio; + float pcmFrameCountOutF; + drmp3_uint32 pcmFrameCountOut; + + srcRatio = (float)pMP3->mp3FrameSampleRate / (float)pMP3->sampleRate; drmp3_assert(srcRatio > 0); - float pcmFrameCountOutF = *pRunningPCMFrameCountFractionalPart + (pcmFrameCountIn / srcRatio); - drmp3_uint32 pcmFrameCountOut = (drmp3_uint32)pcmFrameCountOutF; + pcmFrameCountOutF = *pRunningPCMFrameCountFractionalPart + (pcmFrameCountIn / srcRatio); + pcmFrameCountOut = (drmp3_uint32)pcmFrameCountOutF; *pRunningPCMFrameCountFractionalPart = pcmFrameCountOutF - pcmFrameCountOut; *pRunningPCMFrameCount += pcmFrameCountOut; } @@ -3195,31 +3400,34 @@ void drmp3__accumulate_running_pcm_frame_count(drmp3* pMP3, drmp3_uint32 pcmFram typedef struct { drmp3_uint64 bytePos; - drmp3_uint64 pcmFrameIndex; // <-- After sample rate conversion. + drmp3_uint64 pcmFrameIndex; /* <-- After sample rate conversion. */ } drmp3__seeking_mp3_frame_info; drmp3_bool32 drmp3_calculate_seek_points(drmp3* pMP3, drmp3_uint32* pSeekPointCount, drmp3_seek_point* pSeekPoints) { - if (pMP3 == NULL || pSeekPointCount == NULL || pSeekPoints == NULL) { - return DRMP3_FALSE; // Invalid args. - } - - drmp3_uint32 seekPointCount = *pSeekPointCount; - if (seekPointCount == 0) { - return DRMP3_FALSE; // The client has requested no seek points. Consider this to be invalid arguments since the client has probably not intended this. - } - - // We'll need to seek back to the current sample after calculating the seekpoints so we need to go ahead and grab the current location at the top. - drmp3_uint64 currentPCMFrame = pMP3->currentPCMFrame; - - // We never do more than the total number of MP3 frames and we limit it to 32-bits. + drmp3_uint32 seekPointCount; + drmp3_uint64 currentPCMFrame; drmp3_uint64 totalMP3FrameCount; drmp3_uint64 totalPCMFrameCount; + + if (pMP3 == NULL || pSeekPointCount == NULL || pSeekPoints == NULL) { + return DRMP3_FALSE; /* Invalid args. */ + } + + seekPointCount = *pSeekPointCount; + if (seekPointCount == 0) { + return DRMP3_FALSE; /* The client has requested no seek points. Consider this to be invalid arguments since the client has probably not intended this. */ + } + + /* We'll need to seek back to the current sample after calculating the seekpoints so we need to go ahead and grab the current location at the top. */ + currentPCMFrame = pMP3->currentPCMFrame; + + /* We never do more than the total number of MP3 frames and we limit it to 32-bits. */ if (!drmp3_get_mp3_and_pcm_frame_count(pMP3, &totalMP3FrameCount, &totalPCMFrameCount)) { return DRMP3_FALSE; } - // If there's less than DRMP3_SEEK_LEADING_MP3_FRAMES+1 frames we just report 1 seek point which will be the very start of the stream. + /* If there's less than DRMP3_SEEK_LEADING_MP3_FRAMES+1 frames we just report 1 seek point which will be the very start of the stream. */ if (totalMP3FrameCount < DRMP3_SEEK_LEADING_MP3_FRAMES+1) { seekPointCount = 1; pSeekPoints[0].seekPosInBytes = 0; @@ -3227,69 +3435,88 @@ drmp3_bool32 drmp3_calculate_seek_points(drmp3* pMP3, drmp3_uint32* pSeekPointCo pSeekPoints[0].mp3FramesToDiscard = 0; pSeekPoints[0].pcmFramesToDiscard = 0; } else { + drmp3_uint64 pcmFramesBetweenSeekPoints; + drmp3__seeking_mp3_frame_info mp3FrameInfo[DRMP3_SEEK_LEADING_MP3_FRAMES+1]; + drmp3_uint64 runningPCMFrameCount = 0; + float runningPCMFrameCountFractionalPart = 0; + drmp3_uint64 nextTargetPCMFrame; + drmp3_uint32 iMP3Frame; + drmp3_uint32 iSeekPoint; + if (seekPointCount > totalMP3FrameCount-1) { seekPointCount = (drmp3_uint32)totalMP3FrameCount-1; } - drmp3_uint64 pcmFramesBetweenSeekPoints = totalPCMFrameCount / (seekPointCount+1); + pcmFramesBetweenSeekPoints = totalPCMFrameCount / (seekPointCount+1); - // Here is where we actually calculate the seek points. We need to start by moving the start of the stream. We then enumerate over each - // MP3 frame. + /* + Here is where we actually calculate the seek points. We need to start by moving the start of the stream. We then enumerate over each + MP3 frame. + */ if (!drmp3_seek_to_start_of_stream(pMP3)) { return DRMP3_FALSE; } - // We need to cache the byte positions of the previous MP3 frames. As a new MP3 frame is iterated, we cycle the byte positions in this - // array. The value in the first item in this array is the byte position that will be reported in the next seek point. - drmp3__seeking_mp3_frame_info mp3FrameInfo[DRMP3_SEEK_LEADING_MP3_FRAMES+1]; + /* + We need to cache the byte positions of the previous MP3 frames. As a new MP3 frame is iterated, we cycle the byte positions in this + array. The value in the first item in this array is the byte position that will be reported in the next seek point. + */ - drmp3_uint64 runningPCMFrameCount = 0; - float runningPCMFrameCountFractionalPart = 0; + /* We need to initialize the array of MP3 byte positions for the leading MP3 frames. */ + for (iMP3Frame = 0; iMP3Frame < DRMP3_SEEK_LEADING_MP3_FRAMES+1; ++iMP3Frame) { + drmp3_uint32 pcmFramesInCurrentMP3FrameIn; - // We need to initialize the array of MP3 byte positions for the leading MP3 frames. - for (int iMP3Frame = 0; iMP3Frame < DRMP3_SEEK_LEADING_MP3_FRAMES+1; ++iMP3Frame) { - // The byte position of the next frame will be the stream's cursor position, minus whatever is sitting in the buffer. + /* The byte position of the next frame will be the stream's cursor position, minus whatever is sitting in the buffer. */ drmp3_assert(pMP3->streamCursor >= pMP3->dataSize); mp3FrameInfo[iMP3Frame].bytePos = pMP3->streamCursor - pMP3->dataSize; mp3FrameInfo[iMP3Frame].pcmFrameIndex = runningPCMFrameCount; - // We need to get information about this frame so we can know how many samples it contained. - drmp3_uint32 pcmFramesInCurrentMP3FrameIn = drmp3_decode_next_frame_ex(pMP3, NULL, DRMP3_FALSE); + /* We need to get information about this frame so we can know how many samples it contained. */ + pcmFramesInCurrentMP3FrameIn = drmp3_decode_next_frame_ex(pMP3, NULL, DRMP3_FALSE); if (pcmFramesInCurrentMP3FrameIn == 0) { - return DRMP3_FALSE; // This should never happen. + return DRMP3_FALSE; /* This should never happen. */ } drmp3__accumulate_running_pcm_frame_count(pMP3, pcmFramesInCurrentMP3FrameIn, &runningPCMFrameCount, &runningPCMFrameCountFractionalPart); } - // At this point we will have extracted the byte positions of the leading MP3 frames. We can now start iterating over each seek point and - // calculate them. - drmp3_uint64 nextTargetPCMFrame = 0; - for (drmp3_uint32 iSeekPoint = 0; iSeekPoint < seekPointCount; ++iSeekPoint) { + /* + At this point we will have extracted the byte positions of the leading MP3 frames. We can now start iterating over each seek point and + calculate them. + */ + nextTargetPCMFrame = 0; + for (iSeekPoint = 0; iSeekPoint < seekPointCount; ++iSeekPoint) { nextTargetPCMFrame += pcmFramesBetweenSeekPoints; for (;;) { if (nextTargetPCMFrame < runningPCMFrameCount) { - // The next seek point is in the current MP3 frame. + /* The next seek point is in the current MP3 frame. */ pSeekPoints[iSeekPoint].seekPosInBytes = mp3FrameInfo[0].bytePos; pSeekPoints[iSeekPoint].pcmFrameIndex = nextTargetPCMFrame; pSeekPoints[iSeekPoint].mp3FramesToDiscard = DRMP3_SEEK_LEADING_MP3_FRAMES; pSeekPoints[iSeekPoint].pcmFramesToDiscard = (drmp3_uint16)(nextTargetPCMFrame - mp3FrameInfo[DRMP3_SEEK_LEADING_MP3_FRAMES-1].pcmFrameIndex); break; } else { - // The next seek point is not in the current MP3 frame, so continue on to the next one. The first thing to do is cycle the cached - // MP3 frame info. - for (size_t i = 0; i < drmp3_countof(mp3FrameInfo)-1; ++i) { + size_t i; + drmp3_uint32 pcmFramesInCurrentMP3FrameIn; + + /* + The next seek point is not in the current MP3 frame, so continue on to the next one. The first thing to do is cycle the cached + MP3 frame info. + */ + for (i = 0; i < drmp3_countof(mp3FrameInfo)-1; ++i) { mp3FrameInfo[i] = mp3FrameInfo[i+1]; } - // Cache previous MP3 frame info. + /* Cache previous MP3 frame info. */ mp3FrameInfo[drmp3_countof(mp3FrameInfo)-1].bytePos = pMP3->streamCursor - pMP3->dataSize; mp3FrameInfo[drmp3_countof(mp3FrameInfo)-1].pcmFrameIndex = runningPCMFrameCount; - // Go to the next MP3 frame. This shouldn't ever fail, but just in case it does we just set the seek point and break. If it happens, it - // should only ever do it for the last seek point. - drmp3_uint32 pcmFramesInCurrentMP3FrameIn = drmp3_decode_next_frame_ex(pMP3, NULL, DRMP3_TRUE); + /* + Go to the next MP3 frame. This shouldn't ever fail, but just in case it does we just set the seek point and break. If it happens, it + should only ever do it for the last seek point. + */ + pcmFramesInCurrentMP3FrameIn = drmp3_decode_next_frame_ex(pMP3, NULL, DRMP3_TRUE); if (pcmFramesInCurrentMP3FrameIn == 0) { pSeekPoints[iSeekPoint].seekPosInBytes = mp3FrameInfo[0].bytePos; pSeekPoints[iSeekPoint].pcmFrameIndex = nextTargetPCMFrame; @@ -3303,7 +3530,7 @@ drmp3_bool32 drmp3_calculate_seek_points(drmp3* pMP3, drmp3_uint32* pSeekPointCo } } - // Finally, we need to seek back to where we were. + /* Finally, we need to seek back to where we were. */ if (!drmp3_seek_to_start_of_stream(pMP3)) { return DRMP3_FALSE; } @@ -3323,11 +3550,11 @@ drmp3_bool32 drmp3_bind_seek_table(drmp3* pMP3, drmp3_uint32 seekPointCount, drm } if (seekPointCount == 0 || pSeekPoints == NULL) { - // Unbinding. + /* Unbinding. */ pMP3->seekPointCount = 0; pMP3->pSeekPoints = NULL; } else { - // Binding. + /* Binding. */ pMP3->seekPointCount = seekPointCount; pMP3->pSeekPoints = pSeekPoints; } @@ -3338,13 +3565,13 @@ drmp3_bool32 drmp3_bind_seek_table(drmp3* pMP3, drmp3_uint32 seekPointCount, drm float* drmp3__full_read_and_close_f32(drmp3* pMP3, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount) { - drmp3_assert(pMP3 != NULL); - drmp3_uint64 totalFramesRead = 0; drmp3_uint64 framesCapacity = 0; float* pFrames = NULL; - float temp[4096]; + + drmp3_assert(pMP3 != NULL); + for (;;) { drmp3_uint64 framesToReadRightNow = drmp3_countof(temp) / pMP3->channels; drmp3_uint64 framesJustRead = drmp3_read_pcm_frames_f32(pMP3, framesToReadRightNow, temp); @@ -3352,19 +3579,22 @@ float* drmp3__full_read_and_close_f32(drmp3* pMP3, drmp3_config* pConfig, drmp3_ break; } - // Reallocate the output buffer if there's not enough room. + /* Reallocate the output buffer if there's not enough room. */ if (framesCapacity < totalFramesRead + framesJustRead) { + drmp3_uint64 newFramesBufferSize; + float* pNewFrames; + framesCapacity *= 2; if (framesCapacity < totalFramesRead + framesJustRead) { framesCapacity = totalFramesRead + framesJustRead; } - drmp3_uint64 newFramesBufferSize = framesCapacity*pMP3->channels*sizeof(float); + newFramesBufferSize = framesCapacity*pMP3->channels*sizeof(float); if (newFramesBufferSize > DRMP3_SIZE_MAX) { break; } - float* pNewFrames = (float*)drmp3_realloc(pFrames, (size_t)newFramesBufferSize); + pNewFrames = (float*)drmp3_realloc(pFrames, (size_t)newFramesBufferSize); if (pNewFrames == NULL) { drmp3_free(pFrames); break; @@ -3376,7 +3606,7 @@ float* drmp3__full_read_and_close_f32(drmp3* pMP3, drmp3_config* pConfig, drmp3_ drmp3_copy_memory(pFrames + totalFramesRead*pMP3->channels, temp, (size_t)(framesJustRead*pMP3->channels*sizeof(float))); totalFramesRead += framesJustRead; - // If the number of frames we asked for is less that what we actually read it means we've reached the end. + /* If the number of frames we asked for is less that what we actually read it means we've reached the end. */ if (framesJustRead != framesToReadRightNow) { break; } @@ -3389,10 +3619,77 @@ float* drmp3__full_read_and_close_f32(drmp3* pMP3, drmp3_config* pConfig, drmp3_ drmp3_uninit(pMP3); - if (pTotalFrameCount) *pTotalFrameCount = totalFramesRead; + if (pTotalFrameCount) { + *pTotalFrameCount = totalFramesRead; + } + return pFrames; } +drmp3_int16* drmp3__full_read_and_close_s16(drmp3* pMP3, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount) +{ + drmp3_uint64 totalFramesRead = 0; + drmp3_uint64 framesCapacity = 0; + drmp3_int16* pFrames = NULL; + drmp3_int16 temp[4096]; + + drmp3_assert(pMP3 != NULL); + + for (;;) { + drmp3_uint64 framesToReadRightNow = drmp3_countof(temp) / pMP3->channels; + drmp3_uint64 framesJustRead = drmp3_read_pcm_frames_s16(pMP3, framesToReadRightNow, temp); + if (framesJustRead == 0) { + break; + } + + /* Reallocate the output buffer if there's not enough room. */ + if (framesCapacity < totalFramesRead + framesJustRead) { + drmp3_uint64 newFramesBufferSize; + drmp3_int16* pNewFrames; + + framesCapacity *= 2; + if (framesCapacity < totalFramesRead + framesJustRead) { + framesCapacity = totalFramesRead + framesJustRead; + } + + newFramesBufferSize = framesCapacity*pMP3->channels*sizeof(drmp3_int16); + if (newFramesBufferSize > DRMP3_SIZE_MAX) { + break; + } + + pNewFrames = (drmp3_int16*)drmp3_realloc(pFrames, (size_t)newFramesBufferSize); + if (pNewFrames == NULL) { + drmp3_free(pFrames); + break; + } + + pFrames = pNewFrames; + } + + drmp3_copy_memory(pFrames + totalFramesRead*pMP3->channels, temp, (size_t)(framesJustRead*pMP3->channels*sizeof(drmp3_int16))); + totalFramesRead += framesJustRead; + + /* If the number of frames we asked for is less that what we actually read it means we've reached the end. */ + if (framesJustRead != framesToReadRightNow) { + break; + } + } + + if (pConfig != NULL) { + pConfig->outputChannels = pMP3->channels; + pConfig->outputSampleRate = pMP3->sampleRate; + } + + drmp3_uninit(pMP3); + + if (pTotalFrameCount) { + *pTotalFrameCount = totalFramesRead; + } + + return pFrames; +} + + float* drmp3_open_and_read_f32(drmp3_read_proc onRead, drmp3_seek_proc onSeek, void* pUserData, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount) { drmp3 mp3; @@ -3403,6 +3700,17 @@ float* drmp3_open_and_read_f32(drmp3_read_proc onRead, drmp3_seek_proc onSeek, v return drmp3__full_read_and_close_f32(&mp3, pConfig, pTotalFrameCount); } +drmp3_int16* drmp3_open_and_read_s16(drmp3_read_proc onRead, drmp3_seek_proc onSeek, void* pUserData, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount) +{ + drmp3 mp3; + if (!drmp3_init(&mp3, onRead, onSeek, pUserData, pConfig)) { + return NULL; + } + + return drmp3__full_read_and_close_s16(&mp3, pConfig, pTotalFrameCount); +} + + float* drmp3_open_memory_and_read_f32(const void* pData, size_t dataSize, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount) { drmp3 mp3; @@ -3413,6 +3721,17 @@ float* drmp3_open_memory_and_read_f32(const void* pData, size_t dataSize, drmp3_ return drmp3__full_read_and_close_f32(&mp3, pConfig, pTotalFrameCount); } +drmp3_int16* drmp3_open_memory_and_read_s16(const void* pData, size_t dataSize, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount) +{ + drmp3 mp3; + if (!drmp3_init_memory(&mp3, pData, dataSize, pConfig)) { + return NULL; + } + + return drmp3__full_read_and_close_s16(&mp3, pConfig, pTotalFrameCount); +} + + #ifndef DR_MP3_NO_STDIO float* drmp3_open_file_and_read_f32(const char* filePath, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount) { @@ -3423,6 +3742,16 @@ float* drmp3_open_file_and_read_f32(const char* filePath, drmp3_config* pConfig, return drmp3__full_read_and_close_f32(&mp3, pConfig, pTotalFrameCount); } + +drmp3_int16* drmp3_open_file_and_read_s16(const char* filePath, drmp3_config* pConfig, drmp3_uint64* pTotalFrameCount) +{ + drmp3 mp3; + if (!drmp3_init_file(&mp3, filePath, pConfig)) { + return NULL; + } + + return drmp3__full_read_and_close_s16(&mp3, pConfig, pTotalFrameCount); +} #endif void drmp3_free(void* p) @@ -3432,130 +3761,172 @@ void drmp3_free(void* p) #endif /*DR_MP3_IMPLEMENTATION*/ - -// DIFFERENCES BETWEEN minimp3 AND dr_mp3 -// ====================================== -// - First, keep in mind that minimp3 (https://github.com/lieff/minimp3) is where all the real work was done. All of the -// code relating to the actual decoding remains mostly unmodified, apart from some namespacing changes. -// - dr_mp3 adds a pulling style API which allows you to deliver raw data via callbacks. So, rather than pushing data -// to the decoder, the decoder _pulls_ data from your callbacks. -// - In addition to callbacks, a decoder can be initialized from a block of memory and a file. -// - The dr_mp3 pull API reads PCM frames rather than whole MP3 frames. -// - dr_mp3 adds convenience APIs for opening and decoding entire files in one go. -// - dr_mp3 is fully namespaced, including the implementation section, which is more suitable when compiling projects -// as a single translation unit (aka unity builds). At the time of writing this, a unity build is not possible when -// using minimp3 in conjunction with stb_vorbis. dr_mp3 addresses this. - - -// REVISION HISTORY -// ================ -// -// v0.4.1 - 2018-12-30 -// - Fix a warning. -// -// v0.4.0 - 2018-12-16 -// - API CHANGE: Rename some APIs: -// - drmp3_read_f32 -> to drmp3_read_pcm_frames_f32 -// - drmp3_seek_to_frame -> drmp3_seek_to_pcm_frame -// - drmp3_open_and_decode_f32 -> drmp3_open_and_read_f32 -// - drmp3_open_and_decode_memory_f32 -> drmp3_open_memory_and_read_f32 -// - drmp3_open_and_decode_file_f32 -> drmp3_open_file_and_read_f32 -// - Add drmp3_get_pcm_frame_count(). -// - Add drmp3_get_mp3_frame_count(). -// - Improve seeking performance. -// -// v0.3.2 - 2018-09-11 -// - Fix a couple of memory leaks. -// - Bring up to date with minimp3. -// -// v0.3.1 - 2018-08-25 -// - Fix C++ build. -// -// v0.3.0 - 2018-08-25 -// - Bring up to date with minimp3. This has a minor API change: the "pcm" parameter of drmp3dec_decode_frame() has -// been changed from short* to void* because it can now output both s16 and f32 samples, depending on whether or -// not the DR_MP3_FLOAT_OUTPUT option is set. -// -// v0.2.11 - 2018-08-08 -// - Fix a bug where the last part of a file is not read. -// -// v0.2.10 - 2018-08-07 -// - Improve 64-bit detection. -// -// v0.2.9 - 2018-08-05 -// - Fix C++ build on older versions of GCC. -// - Bring up to date with minimp3. -// -// v0.2.8 - 2018-08-02 -// - Fix compilation errors with older versions of GCC. -// -// v0.2.7 - 2018-07-13 -// - Bring up to date with minimp3. -// -// v0.2.6 - 2018-07-12 -// - Bring up to date with minimp3. -// -// v0.2.5 - 2018-06-22 -// - Bring up to date with minimp3. -// -// v0.2.4 - 2018-05-12 -// - Bring up to date with minimp3. -// -// v0.2.3 - 2018-04-29 -// - Fix TCC build. -// -// v0.2.2 - 2018-04-28 -// - Fix bug when opening a decoder from memory. -// -// v0.2.1 - 2018-04-27 -// - Efficiency improvements when the decoder reaches the end of the stream. -// -// v0.2 - 2018-04-21 -// - Bring up to date with minimp3. -// - Start using major.minor.revision versioning. -// -// v0.1d - 2018-03-30 -// - Bring up to date with minimp3. -// -// v0.1c - 2018-03-11 -// - Fix C++ build error. -// -// v0.1b - 2018-03-07 -// - Bring up to date with minimp3. -// -// v0.1a - 2018-02-28 -// - Fix compilation error on GCC/Clang. -// - Fix some warnings. -// -// v0.1 - 2018-02-xx -// - Initial versioned release. - +/* +DIFFERENCES BETWEEN minimp3 AND dr_mp3 +====================================== +- First, keep in mind that minimp3 (https://github.com/lieff/minimp3) is where all the real work was done. All of the + code relating to the actual decoding remains mostly unmodified, apart from some namespacing changes. +- dr_mp3 adds a pulling style API which allows you to deliver raw data via callbacks. So, rather than pushing data + to the decoder, the decoder _pulls_ data from your callbacks. +- In addition to callbacks, a decoder can be initialized from a block of memory and a file. +- The dr_mp3 pull API reads PCM frames rather than whole MP3 frames. +- dr_mp3 adds convenience APIs for opening and decoding entire files in one go. +- dr_mp3 is fully namespaced, including the implementation section, which is more suitable when compiling projects + as a single translation unit (aka unity builds). At the time of writing this, a unity build is not possible when + using minimp3 in conjunction with stb_vorbis. dr_mp3 addresses this. +*/ /* +REVISION HISTORY +================ +v0.4.4 - 2019-05-06 + - Fixes to the VC6 build. + +v0.4.3 - 2019-05-05 + - Use the channel count and/or sample rate of the first MP3 frame instead of DR_MP3_DEFAULT_CHANNELS and + DR_MP3_DEFAULT_SAMPLE_RATE when they are set to 0. To use the old behaviour, just set the relevant property to + DR_MP3_DEFAULT_CHANNELS or DR_MP3_DEFAULT_SAMPLE_RATE. + - Add s16 reading APIs + - drmp3_read_pcm_frames_s16 + - drmp3_open_memory_and_read_s16 + - drmp3_open_and_read_s16 + - drmp3_open_file_and_read_s16 + - Add drmp3_get_mp3_and_pcm_frame_count() to the public header section. + - Add support for C89. + - Change license to choice of public domain or MIT-0. + +v0.4.2 - 2019-02-21 + - Fix a warning. + +v0.4.1 - 2018-12-30 + - Fix a warning. + +v0.4.0 - 2018-12-16 + - API CHANGE: Rename some APIs: + - drmp3_read_f32 -> to drmp3_read_pcm_frames_f32 + - drmp3_seek_to_frame -> drmp3_seek_to_pcm_frame + - drmp3_open_and_decode_f32 -> drmp3_open_and_read_f32 + - drmp3_open_and_decode_memory_f32 -> drmp3_open_memory_and_read_f32 + - drmp3_open_and_decode_file_f32 -> drmp3_open_file_and_read_f32 + - Add drmp3_get_pcm_frame_count(). + - Add drmp3_get_mp3_frame_count(). + - Improve seeking performance. + +v0.3.2 - 2018-09-11 + - Fix a couple of memory leaks. + - Bring up to date with minimp3. + +v0.3.1 - 2018-08-25 + - Fix C++ build. + +v0.3.0 - 2018-08-25 + - Bring up to date with minimp3. This has a minor API change: the "pcm" parameter of drmp3dec_decode_frame() has + been changed from short* to void* because it can now output both s16 and f32 samples, depending on whether or + not the DR_MP3_FLOAT_OUTPUT option is set. + +v0.2.11 - 2018-08-08 + - Fix a bug where the last part of a file is not read. + +v0.2.10 - 2018-08-07 + - Improve 64-bit detection. + +v0.2.9 - 2018-08-05 + - Fix C++ build on older versions of GCC. + - Bring up to date with minimp3. + +v0.2.8 - 2018-08-02 + - Fix compilation errors with older versions of GCC. + +v0.2.7 - 2018-07-13 + - Bring up to date with minimp3. + +v0.2.6 - 2018-07-12 + - Bring up to date with minimp3. + +v0.2.5 - 2018-06-22 + - Bring up to date with minimp3. + +v0.2.4 - 2018-05-12 + - Bring up to date with minimp3. + +v0.2.3 - 2018-04-29 + - Fix TCC build. + +v0.2.2 - 2018-04-28 + - Fix bug when opening a decoder from memory. + +v0.2.1 - 2018-04-27 + - Efficiency improvements when the decoder reaches the end of the stream. + +v0.2 - 2018-04-21 + - Bring up to date with minimp3. + - Start using major.minor.revision versioning. + +v0.1d - 2018-03-30 + - Bring up to date with minimp3. + +v0.1c - 2018-03-11 + - Fix C++ build error. + +v0.1b - 2018-03-07 + - Bring up to date with minimp3. + +v0.1a - 2018-02-28 + - Fix compilation error on GCC/Clang. + - Fix some warnings. + +v0.1 - 2018-02-xx + - Initial versioned release. +*/ + +/* +This software is available as a choice of the following licenses. Choose +whichever you prefer. + +=============================================================================== +ALTERNATIVE 1 - Public Domain (www.unlicense.org) +=============================================================================== This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, +commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to +this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to + +=============================================================================== +ALTERNATIVE 2 - MIT No Attribution +=============================================================================== +Copyright 2018 David Reid + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. */ /* diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp index 43d33d081..ce63ce2cd 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.cpp @@ -1247,23 +1247,23 @@ bool CDriverD3D::init (uintptr_t windowIcon, emptyProc exitFunc) createCursors(); - _WindowClass = "NLD3D" + toString(windowIcon); + _WindowClass = utf8ToWide("NLD3D" + toString(windowIcon)); // Register a window class - WNDCLASSA wc; + WNDCLASSW wc; memset(&wc,0,sizeof(wc)); wc.style = 0; // CS_HREDRAW | CS_VREDRAW ;//| CS_DBLCLKS; wc.lpfnWndProc = (WNDPROC)WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; - wc.hInstance = GetModuleHandleA(NULL); + wc.hInstance = GetModuleHandleW(NULL); wc.hIcon = (HICON)windowIcon; wc.hCursor = _DefaultCursor; wc.hbrBackground = WHITE_BRUSH; wc.lpszClassName = _WindowClass.c_str(); wc.lpszMenuName = NULL; - if (!RegisterClassA(&wc)) + if (!RegisterClassW(&wc)) { DWORD error = GetLastError(); if (error != ERROR_CLASS_ALREADY_EXISTS) @@ -1416,8 +1416,7 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r AdjustWindowRect(&WndRect,WndFlags,FALSE); // Create - ucstring ustr(_WindowClass); - _HWnd = CreateWindowW((LPCWSTR)ustr.c_str(), L"", WndFlags, CW_USEDEFAULT,CW_USEDEFAULT, WndRect.right-WndRect.left,WndRect.bottom-WndRect.top, NULL, NULL, + _HWnd = CreateWindowW(_WindowClass.c_str(), L"", WndFlags, CW_USEDEFAULT,CW_USEDEFAULT, WndRect.right-WndRect.left,WndRect.bottom-WndRect.top, NULL, NULL, GetModuleHandleW(NULL), NULL); if (!_HWnd) { diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.h b/code/nel/src/3d/driver/direct3d/driver_direct3d.h index 51c21bbc9..8b17fa28b 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.h +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.h @@ -2314,7 +2314,7 @@ private: TShaderDrvInfoPtrList _ShaderDrvInfos; // Windows - std::string _WindowClass; + std::wstring _WindowClass; HWND _HWnd; sint32 _WindowX; sint32 _WindowY; diff --git a/code/nel/src/3d/driver/direct3d/resources.rc b/code/nel/src/3d/driver/direct3d/resources.rc index 4211b6c32..68f4bc55a 100644 --- a/code/nel/src/3d/driver/direct3d/resources.rc +++ b/code/nel/src/3d/driver/direct3d/resources.rc @@ -27,11 +27,11 @@ BEGIN VALUE "OriginalFilename", "nel_drv_direct3d_win_r.dll" #endif VALUE "ProductName", "Ryzom Core" - VALUE "ProductVersion", NL_VERSION + VALUE "ProductVersion", NL_PRODUCT_VERSION END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1252 + VALUE "Translation", 0x9, 1200 END END diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 2e0f2e7a5..6120ecd4c 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -316,7 +316,7 @@ bool CDriverGL::init (uintptr_t windowIcon, emptyProc exitFunc) wc.lpfnWndProc = (WNDPROC)WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; - wc.hInstance = GetModuleHandle(NULL); + wc.hInstance = GetModuleHandleW(NULL); wc.hIcon = (HICON)windowIcon; wc.hCursor = _DefaultCursor; wc.hbrBackground = WHITE_BRUSH; diff --git a/code/nel/src/3d/driver/opengl/resources.rc b/code/nel/src/3d/driver/opengl/resources.rc index 3934c4e19..b0c5a092d 100644 --- a/code/nel/src/3d/driver/opengl/resources.rc +++ b/code/nel/src/3d/driver/opengl/resources.rc @@ -27,11 +27,11 @@ BEGIN VALUE "OriginalFilename", "nel_drv_opengl_win_r.dll" #endif VALUE "ProductName", "Ryzom Core" - VALUE "ProductVersion", NL_VERSION + VALUE "ProductVersion", NL_PRODUCT_VERSION END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1252 + VALUE "Translation", 0x9, 1200 END END diff --git a/code/nel/src/3d/driver/opengles/resources.rc b/code/nel/src/3d/driver/opengles/resources.rc index aa7d66398..1bdf3fa39 100644 --- a/code/nel/src/3d/driver/opengles/resources.rc +++ b/code/nel/src/3d/driver/opengles/resources.rc @@ -27,11 +27,11 @@ BEGIN VALUE "OriginalFilename", "nel_drv_opengles_win_r.dll" #endif VALUE "ProductName", "Ryzom Core" - VALUE "ProductVersion", NL_VERSION + VALUE "ProductVersion", NL_PRODUCT_VERSION END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1252 + VALUE "Translation", 0x9, 1200 END END diff --git a/code/nel/src/gui/css_parser.cpp b/code/nel/src/gui/css_parser.cpp index 0a4288d12..39a4496bc 100644 --- a/code/nel/src/gui/css_parser.cpp +++ b/code/nel/src/gui/css_parser.cpp @@ -463,7 +463,7 @@ namespace NLGUI { if (sel[pos] == '\'' || sel[pos] == '"') { - // value is quoted + // skip over quoted value start = pos; pos++; while(pos < sel.size() && sel[pos] != sel[start]) @@ -476,9 +476,6 @@ namespace NLGUI } if (pos == sel.size()) break; - - value = sel.substr(start + 1, pos - start - 1); - break; } else if (sel[pos] == '\\') { @@ -486,7 +483,6 @@ namespace NLGUI } else if (!quote && sel[pos] == ']') { - // unquoted value value = sel.substr(start, pos - start); break; } @@ -494,17 +490,20 @@ namespace NLGUI pos++; } // while 'value' - // TODO: scan for sel[pos] == ']' - if (pos == sel.size()) break; - // whitespace between quote and ], ie '[ attr $= "val" ]' - if (sel[pos] != ']') - { - while(pos < sel.size() && sel[pos] != ']') - pos++; - } if (pos == sel.size()) break; - current.addAttribute(key.toUtf8(), value.toUtf8(), (char)op); + bool cs = true; + // [value="attr" i] + if (value.size() > 2 && value[value.size()-2] == ' ') + { + ucchar lastChar = value[value.size()-1]; + if (lastChar == 'i' || lastChar == 'I' || lastChar == 's' || lastChar == 'S') + { + value = value.substr(0, value.size()-2); + cs = !((lastChar == 'i' || lastChar == 'I')); + } + } + current.addAttribute(key.toUtf8(), trimQuotes(value).toUtf8(), (char)op, cs); } // op error } // no value @@ -631,18 +630,9 @@ namespace NLGUI { result.clear(); } - else if (result.empty() || !current.empty()) + else if (!current.empty()) { - // pseudo element like ':before' can only be set on the last selector - if (!result.empty() && !pseudoElement.empty()) - { - // failed - result.clear(); - } - else - { - result.push_back(current); - } + result.push_back(current); } return result; diff --git a/code/nel/src/gui/css_selector.cpp b/code/nel/src/gui/css_selector.cpp index 0384f561a..2c9d94559 100644 --- a/code/nel/src/gui/css_selector.cpp +++ b/code/nel/src/gui/css_selector.cpp @@ -71,9 +71,17 @@ namespace NLGUI } } - void CCssSelector::addAttribute(const std::string &key, const std::string &val, char op) + void CCssSelector::addAttribute(const std::string &key, const std::string &val, char op, bool cs) { - Attr.push_back(SAttribute(key, val, op)); + if (cs) + { + // case sensitive match + Attr.push_back(SAttribute(key, val, op, cs)); + } + else + { + Attr.push_back(SAttribute(key, toLower(val), op, cs)); + } } void CCssSelector::addPseudoClass(const std::string &key) @@ -135,6 +143,12 @@ namespace NLGUI if (!elm.hasAttribute(Attr[i].key)) return false; std::string value = elm.getAttribute(Attr[i].key); + // case-insensitive compare, Attr.value is already lowercased + if (!Attr[i].caseSensitive) + { + value = toLower(value); + } + switch(Attr[i].op) { case '=': @@ -310,5 +324,43 @@ namespace NLGUI } } + std::string CCssSelector::toString() const + { + std::string ret; + ret += Element; + ret += Id; + if (!Class.empty()) + { + for(uint i = 0; iProperties); } - else if (i->PseudoElement == ":before") + else { - merge(elm.StyleBefore, i->Properties); - } - else if (i->PseudoElement == ":after") - { - merge(elm.StyleAfter, i->Properties); + elm.setPseudo(i->PseudoElement, i->Properties); } } } @@ -461,6 +456,14 @@ namespace NLGUI if (pos != style.StyleRules.end()) style.StyleRules.erase(pos); } + else + if (it->first == "display") + { + if (it->second == "inherit") + style.DisplayBlock = current.DisplayBlock; + else + style.DisplayBlock = (it->second == "block" || it->second == "table"); + } } } @@ -720,6 +723,8 @@ namespace NLGUI style.Width = tmpf * style.FontSize; else if (unit == "pt") style.FontSize = tmpf / 0.75f; + else if (unit == "%") + style.Width = 0; // TODO: style.WidthRatio else style.Width = tmpf; } @@ -736,6 +741,8 @@ namespace NLGUI style.Height = tmpf * style.FontSize; else if (unit == "pt") style.FontSize = tmpf / 0.75f; + else if (unit == "%") + style.Height = 0; // TODO: style.HeightRatio else style.Height = tmpf; } @@ -752,6 +759,8 @@ namespace NLGUI style.MaxWidth = tmpf * style.FontSize; else if (unit == "pt") style.FontSize = tmpf / 0.75f; + else if (unit == "%") + style.MaxWidth = 0; // TODO: style.MaxWidthRatio else style.MaxWidth = tmpf; } @@ -768,6 +777,8 @@ namespace NLGUI style.MaxHeight = tmpf * style.FontSize; else if (unit == "pt") style.FontSize = tmpf / 0.75f; + else if (unit == "%") + style.MaxHeight = 0; // TODO: style.MaxHeightRatio else style.MaxHeight = tmpf; } diff --git a/code/nel/src/gui/curl_certificates.cpp b/code/nel/src/gui/curl_certificates.cpp index 6d1bc86ee..dbd3005ad 100644 --- a/code/nel/src/gui/curl_certificates.cpp +++ b/code/nel/src/gui/curl_certificates.cpp @@ -332,7 +332,9 @@ namespace NLGUI { ERR_error_string_n(errCode, errorBuffer, 1024); nlwarning("Error adding certificate %s: %s", entry.name.c_str(), errorBuffer); - res = CURLE_SSL_CACERT; + // There seems to be intermittent issues (on windows) where cert loading will fail for same 3 to 5 certs + // with an 'SSL_shutdown while in init' error. It does not seem to be fatal for connection. + //res = CURLE_SSL_CACERT; } } else diff --git a/code/nel/src/gui/group_container.cpp b/code/nel/src/gui/group_container.cpp index 26a23fd9f..a21734fdb 100644 --- a/code/nel/src/gui/group_container.cpp +++ b/code/nel/src/gui/group_container.cpp @@ -2385,7 +2385,7 @@ namespace NLGUI { _W = _Parent->getW(); } - setMaxH (16384); // No scrollbar for container of layer > 0 + setMaxH (std::numeric_limits::max()); // No scrollbar for container of layer > 0 newH = (pLayer->H_T - pLayer->InsetT); } @@ -2468,7 +2468,7 @@ namespace NLGUI else { if (_List != NULL) - _List->setMaxH (16384); + _List->setMaxH (std::numeric_limits::max()); } if (_LayerSetup == 0) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 5e0da0488..558123ee4 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -711,7 +711,6 @@ namespace NLGUI return; } - // TODO: if no image in cache, nothing is visible finalUrl = upgradeInsecureUrl(getAbsoluteUrl(url)); // use requested url for local name (cache) @@ -719,9 +718,15 @@ namespace NLGUI LOG_DL("add to download '%s' dest '%s' img %p", finalUrl.c_str(), dest.c_str(), img); // Display cached image while downloading new - if (type != OverImage && CFile::fileExists(dest)) + if (type != OverImage) { - setImage(img, dest, type); + std::string temp = dest; + if (!CFile::fileExists(temp)) + { + // TODO: placeholder + temp = "web_del.tga"; + } + setImage(img, temp, type); setImageSize(img, style); } @@ -740,6 +745,24 @@ namespace NLGUI pumpCurlQueue(); } + void CGroupHTML::removeImageDownload(CViewBase *img) + { + for(std::list::iterator it = Curls.begin(); it != Curls.end(); ++it) + { + // check all active downloads because image does not keep url around + std::vector::iterator imgIter = it->imgs.begin(); + while(imgIter != it->imgs.end()) + { + if (imgIter->Image == img) + { + it->imgs.erase(imgIter); + break; + } + ++imgIter; + } + } + } + void CGroupHTML::initImageDownload() { LOG_DL("Init Image Download"); @@ -1072,12 +1095,18 @@ namespace NLGUI _AnchorName.push_back(elm.getAttribute("id")); } + if (_Style.Current.DisplayBlock) + { + endParagraph(); + } + switch(elm.ID) { case HTML_A: htmlA(elm); break; case HTML_BASE: htmlBASE(elm); break; case HTML_BODY: htmlBODY(elm); break; case HTML_BR: htmlBR(elm); break; + case HTML_BUTTON: htmlBUTTON(elm); break; case HTML_DD: htmlDD(elm); break; case HTML_DEL: renderPseudoElement(":before", elm); break; case HTML_DIV: htmlDIV(elm); break; @@ -1101,11 +1130,13 @@ namespace NLGUI case HTML_LI: htmlLI(elm); break; case HTML_LUA: htmlLUA(elm); break; case HTML_META: htmlMETA(elm); break; + case HTML_METER: htmlMETER(elm); break; case HTML_OBJECT: htmlOBJECT(elm); break; case HTML_OL: htmlOL(elm); break; case HTML_OPTION: htmlOPTION(elm); break; case HTML_P: htmlP(elm); break; case HTML_PRE: htmlPRE(elm); break; + case HTML_PROGRESS: htmlPROGRESS(elm); break; case HTML_SCRIPT: htmlSCRIPT(elm); break; case HTML_SELECT: htmlSELECT(elm); break; case HTML_SMALL: renderPseudoElement(":before", elm); break; @@ -1137,6 +1168,7 @@ namespace NLGUI case HTML_BASE: break; case HTML_BODY: renderPseudoElement(":after", elm); break; case HTML_BR: break; + case HTML_BUTTON: htmlBUTTONend(elm); break; case HTML_DD: htmlDDend(elm); break; case HTML_DEL: renderPseudoElement(":after", elm); break; case HTML_DIV: htmlDIVend(elm); break; @@ -1160,6 +1192,7 @@ namespace NLGUI case HTML_LI: htmlLIend(elm); break; case HTML_LUA: htmlLUAend(elm); break; case HTML_META: break; + case HTML_METER: break; case HTML_OBJECT: htmlOBJECTend(elm); break; case HTML_OL: htmlOLend(elm); break; case HTML_OPTION: htmlOPTIONend(elm); break; @@ -1184,6 +1217,10 @@ namespace NLGUI break; } + if (_Style.Current.DisplayBlock) + { + endParagraph(); + } _Style.popStyle(); } @@ -1191,26 +1228,20 @@ namespace NLGUI // *************************************************************************** void CGroupHTML::renderPseudoElement(const std::string &pseudo, const CHtmlElement &elm) { - if (pseudo == ":before" && !elm.StyleBefore.empty()) - { - _Style.pushStyle(); - _Style.applyStyle(elm.StyleBefore); - } - else if (pseudo == ":after" && !elm.StyleAfter.empty()) - { - _Style.pushStyle(); - _Style.applyStyle(elm.StyleAfter); - } - else - { - // unknown pseudo element + if (pseudo != ":before" && pseudo != ":after") return; - } + + if (!elm.hasPseudo(pseudo)) + return; + + _Style.pushStyle(); + _Style.applyStyle(elm.getPseudo(pseudo)); // TODO: 'content' should already be tokenized in css parser as it has all the functions for that std::string content = trim(_Style.getStyle("content")); if (toLower(content) == "none" || toLower(content) == "normal") { + _Style.popStyle(); return; } @@ -1341,12 +1372,16 @@ namespace NLGUI beginElement(elm); std::list::iterator it = elm.Children.begin(); - while(it != elm.Children.end()) + if (!_IgnoreChildElements) { - renderDOM(*it); + while(it != elm.Children.end()) + { + renderDOM(*it); - ++it; + ++it; + } } + _IgnoreChildElements = false; endElement(elm); } @@ -1377,6 +1412,7 @@ namespace NLGUI _ParsingLua = false; _LuaHrefHack = false; _IgnoreText = false; + _IgnoreChildElements = false; _BrowseNextTime = false; _PostNextTime = false; _Browsing = false; @@ -2757,6 +2793,9 @@ namespace NLGUI // Translate the tooltip ctrlButton->setDefaultContextHelp(ucstring::makeFromUtf8(getLinkTitle())); ctrlButton->setText(tmpStr); + // empty url / button disabled + bool disabled = string(getLink()).empty(); + ctrlButton->setFrozen(disabled); setTextButtonStyle(ctrlButton, style); } @@ -2997,7 +3036,7 @@ namespace NLGUI CCtrlButton *CGroupHTML::addButton(CCtrlButton::EType type, const std::string &name, const std::string &normalBitmap, const std::string &pushedBitmap, const std::string &overBitmap, const char *actionHandler, const char *actionHandlerParams, - const char *tooltip, const CStyleParams &style) + const std::string &tooltip, const CStyleParams &style) { // In a paragraph ? if (!_Paragraph) @@ -3067,7 +3106,7 @@ namespace NLGUI ctrlButton->setParamsOnLeftClick (actionHandlerParams); // Translate the tooltip or display raw text (tooltip from webig) - if (tooltip) + if (!tooltip.empty()) { if (CI18N::hasTranslation(tooltip)) { @@ -3118,6 +3157,7 @@ namespace NLGUI _Cells.clear(); _TR.clear(); _Forms.clear(); + _FormSubmit.clear(); _Groups.clear(); _Divs.clear(); _Anchors.clear(); @@ -3328,19 +3368,30 @@ namespace NLGUI // *************************************************************************** - void CGroupHTML::submitForm (uint formId, const char *submitButtonType, const char *submitButtonName, const char *submitButtonValue, sint32 x, sint32 y) + void CGroupHTML::submitForm(uint button, sint32 x, sint32 y) { - // Form id valid ? - if (formId < _Forms.size()) + if (button >= _FormSubmit.size()) + return; + + for(uint formId = 0; formId < _Forms.size(); formId++) { - _PostNextTime = true; - _PostFormId = formId; - _PostFormSubmitType = submitButtonType; - _PostFormSubmitButton = submitButtonName; - _PostFormSubmitValue = submitButtonValue; - _PostFormSubmitX = x; - _PostFormSubmitY = y; + // case sensitive search (user id is lowecase, auto id is uppercase) + if (_Forms[formId].id == _FormSubmit[button].form) + { + _PostNextTime = true; + _PostFormId = formId; + _PostFormAction = _FormSubmit[button].formAction; + _PostFormSubmitType = _FormSubmit[button].type; + _PostFormSubmitButton = _FormSubmit[button].name; + _PostFormSubmitValue = _FormSubmit[button].value; + _PostFormSubmitX = x; + _PostFormSubmitY = y; + + return; + } } + + nlwarning("Unable to find form '%s' to submit (button '%s')", _FormSubmit[button].form.c_str(), _FormSubmit[button].name.c_str()); } // *************************************************************************** @@ -3514,7 +3565,8 @@ namespace NLGUI // Ref the form CForm &form = _Forms[_PostFormId]; - _URL = form.Action; + // button can override form action url (and methor, but we only do POST) + _URL = _PostFormAction.empty() ? form.Action : _PostFormAction; CUrlParser uri(_URL); _TrustedDomain = isTrustedDomain(uri.host); @@ -3798,6 +3850,9 @@ namespace NLGUI return; } + // received content from remote + std::string content = trim(_CurlWWW->Content); + // save HSTS header from all requests regardless of HTTP code if (_CurlWWW->hasHSTSHeader()) { @@ -3839,8 +3894,11 @@ namespace NLGUI else if ( (code < 200 || code >= 300) ) { // catches 304 not modified, but html is not in cache anyway - browseError(string("Connection failed\nhttp code " + toString((sint32)code) + ")\nURL '" + _CurlWWW->Url + "'").c_str()); - return; + // if server did not send any error back + if (content.empty()) + { + content = string("ERROR

Connection failed

HTTP code '" + toString((sint32)code) + "'

URL '" + _CurlWWW->Url + "'

"); + } } char *ch; @@ -3851,7 +3909,7 @@ namespace NLGUI contentType = ch; } - htmlDownloadFinished(_CurlWWW->Content, contentType, code); + htmlDownloadFinished(content, contentType, code); // clear curl handler if (MultiCurl) @@ -4861,10 +4919,24 @@ namespace NLGUI css += "small { font-size: smaller;}"; css += "dt { font-weight: bold; }"; css += "hr { color: rgb(120, 120, 120);}"; + // block level elements + css += "address, article, aside, blockquote, details, dialog, dd, div, dl, dt, fieldset, figcaption, figure,"; + css += "footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, li, main, nav, ol, p, pre, section, table,"; + css += "ul { display: block; }"; + css += "table { display: table; }"; // td { padding: 1px;} - overwrites cellpadding attribute // table { border-spacing: 2px;} - overwrites cellspacing attribute css += "table { border-collapse: separate;}"; - + // webkit pseudo elements + css += "meter::-webkit-meter-bar, meter::-webkit-optimum-value, meter::-webkit-suboptimum-value, meter::-webkit-even-less-good-value { background: none; }"; + css += "meter::-webkit-meter-bar { background-color: rgb(100, 100, 100); width: 5em; height: 1em;}"; + css += "meter::-webkit-meter-optimum-value { background-color: rgb(80, 220, 80); }"; + css += "meter::-webkit-meter-suboptimum-value { background-color: rgb(220, 220, 80); }"; + css += "meter::-webkit-meter-even-less-good-value { background-color: rgb(220, 80, 80); }"; + // webkit pseudo elements + css += "progress::-webkit-progress-bar, progress::-webkit-progress-value { background: none; }"; + css += "progress::-webkit-progress-bar { background-color: rgb(230, 230, 230); width: 10em; height: 1em; }"; + css += "progress::-webkit-progress-value { background-color: rgb(0, 100, 180);}"; _Style.parseStylesheet(css); } @@ -4969,6 +5041,177 @@ namespace NLGUI return ret; } + void CGroupHTML::HTMLMeterElement::readValues(const CHtmlElement &elm) + { + if (!elm.hasAttribute("value") || !fromString(elm.getAttribute("value"), value)) + value = 0.f; + if (!elm.hasAttribute("min") || !fromString(elm.getAttribute("min"), min)) + min = 0.f; + if (!elm.hasAttribute("max") || !fromString(elm.getAttribute("max"), max)) + max = 1.f; + + // ensure min < max + if (max < min) + std::swap(min, max); + + if (!elm.hasAttribute("low") || !fromString(elm.getAttribute("low"), low)) + low = min; + if (!elm.hasAttribute("high") || !fromString(elm.getAttribute("high"), high)) + high = max; + + if (!elm.hasAttribute("optimum") || !fromString(elm.getAttribute("optimum"), optimum)) + optimum = (max - min) / 2.f; + + // ensure low < high + if (high < low) + std::swap(low, high); + if (low < min) + low = min; + if (high > max) + max = max; + } + + float CGroupHTML::HTMLMeterElement::getValueRatio() const + { + if (max <= min) + return 0.f; + + return (value - min) / (max - min); + } + + CGroupHTML::HTMLMeterElement::EValueRegion CGroupHTML::HTMLMeterElement::getValueRegion() const + { + if (optimum <= low) + { + // low region is optimum + if (value <= low) + return VALUE_OPTIMUM; + else if (value <= high) + return VALUE_SUB_OPTIMAL; + + return VALUE_EVEN_LESS_GOOD; + } + else if (optimum >= high) + { + // high region is optimum + if (value >= high) + return VALUE_OPTIMUM; + else if (value >= low) + return VALUE_SUB_OPTIMAL; + + return VALUE_EVEN_LESS_GOOD; + } + + // middle region is optimum + if (value >= low && value <= high) + return VALUE_OPTIMUM; + + return VALUE_SUB_OPTIMAL; + } + + NLMISC::CRGBA CGroupHTML::HTMLMeterElement::getBarColor(const CHtmlElement &elm, CCssStyle &style) const + { + // color meter (inactive) bar segment + // firefox:: meter { background:none; background-color: #555; }, + // webkit:: meter::-webkit-meter-bar { background:none; background-color: #555; } + // webkit makes background color visible when padding is added + CRGBA color(150, 150, 150, 255); + + // use webkit pseudo elements as thats easier than firefox pseudo classes + // background-color is expected to be set from browser.css + style.pushStyle(); + style.applyStyle(elm.getPseudo(":-webkit-meter-bar")); + if(style.hasStyle("background-color")) + color = style.Current.BackgroundColor; + style.popStyle(); + + return color; + } + + NLMISC::CRGBA CGroupHTML::HTMLMeterElement::getValueColor(const CHtmlElement &elm, CCssStyle &style) const + { + // background-color is expected to be set from browser.css + CRGBA color; + style.pushStyle(); + switch(getValueRegion()) + { + case VALUE_OPTIMUM: + { + style.applyStyle(elm.getPseudo(":-webkit-meter-optimum-value")); + if (style.hasStyle("background-color")) + color = style.Current.BackgroundColor; + break; + } + case VALUE_SUB_OPTIMAL: + { + style.applyStyle(elm.getPseudo(":-webkit-meter-suboptimum-value")); + if (style.hasStyle("background-color")) + color = style.Current.BackgroundColor; + break; + } + case VALUE_EVEN_LESS_GOOD: // fall through + default: + { + style.applyStyle(elm.getPseudo(":-webkit-meter-even-less-good-value")); + if (style.hasStyle("background-color")) + color = style.Current.BackgroundColor; + break; + } + }//switch + style.popStyle(); + + return color; + } + + // **************************************************************************** + void CGroupHTML::HTMLProgressElement::readValues(const CHtmlElement &elm) + { + if (!elm.hasAttribute("value") || !fromString(elm.getAttribute("value"), value)) + value = 0.f; + if (!elm.hasAttribute("max") || !fromString(elm.getAttribute("max"), max)) + max = 1.f; + + if (value > max) + value = max; + } + + // **************************************************************************** + float CGroupHTML::HTMLProgressElement::getValueRatio() const + { + if (max > 0.f) + return value / max; + return 0.f; + } + + // **************************************************************************** + NLMISC::CRGBA CGroupHTML::HTMLProgressElement::getBarColor(const CHtmlElement &elm, CCssStyle &style) const + { + CRGBA color; + + style.pushStyle(); + style.applyStyle(elm.getPseudo(":-webkit-progress-bar")); + if (style.hasStyle("background-color")) + color = style.Current.BackgroundColor; + style.popStyle(); + + return color; + } + + // **************************************************************************** + NLMISC::CRGBA CGroupHTML::HTMLProgressElement::getValueColor(const CHtmlElement &elm, CCssStyle &style) const + { + CRGBA color; + + style.pushStyle(); + style.applyStyle(elm.getPseudo(":-webkit-progress-value")); + if (style.hasStyle("background-color")) + color = style.Current.BackgroundColor; + style.popStyle(); + + return color; + } + + // **************************************************************************** void CGroupHTML::getCellsParameters(const CHtmlElement &elm, bool inherit) { CGroupHTML::CCellParams cellParams; @@ -5062,6 +5305,71 @@ namespace NLGUI } + // *************************************************************************** + void CGroupHTML::insertFormImageButton(const std::string &name, const std::string &tooltip, const std::string &src, const std::string &over, const std::string &formId, const std::string &action, uint32 minWidth, const std::string &templateName) + { + _FormSubmit.push_back(SFormSubmitButton(formId, name, "", "image")); + // Action handler parameters + std::string param = "name=" + getId() + "|button=" + toString(_FormSubmit.size()-1); + + // Add the ctrl button + addButton (CCtrlButton::PushButton, name, src, src, over, "html_submit_form", param.c_str(), tooltip.c_str(), _Style.Current); + } + + // *************************************************************************** + void CGroupHTML::insertFormTextButton(const std::string &name, const std::string &tooltip, const std::string &value, const std::string &formId, const std::string &formAction, uint32 minWidth, const std::string &templateName) + { + _FormSubmit.push_back(SFormSubmitButton(formId, name, value, "submit")); + // Action handler parameters + string param = "name=" + getId() + "|button=" + toString(_FormSubmit.size()-1); + + // Add the ctrl button + if (!_Paragraph) + { + newParagraph (0); + paragraphChange (); + } + + string buttonTemplate(!templateName.empty() ? templateName : DefaultButtonGroup); + typedef pair TTmplParam; + vector tmplParams; + tmplParams.push_back(TTmplParam("id", name)); + tmplParams.push_back(TTmplParam("onclick", "html_submit_form")); + tmplParams.push_back(TTmplParam("onclick_param", param)); + tmplParams.push_back(TTmplParam("active", "true")); + if (minWidth > 0) tmplParams.push_back(TTmplParam("wmin", toString(minWidth))); + CInterfaceGroup *buttonGroup = CWidgetManager::getInstance()->getParser()->createGroupInstance(buttonTemplate, _Paragraph->getId(), tmplParams); + if (buttonGroup) + { + // Add the ctrl button + CCtrlTextButton *ctrlButton = dynamic_cast(buttonGroup->getCtrl("button")); + if (!ctrlButton) ctrlButton = dynamic_cast(buttonGroup->getCtrl("b")); + if (ctrlButton) + { + ctrlButton->setModulateGlobalColorAll (_Style.Current.GlobalColor); + + // Translate the tooltip + if (!tooltip.empty()) + { + if (CI18N::hasTranslation(tooltip)) + { + ctrlButton->setDefaultContextHelp(CI18N::get(tooltip)); + } + else + { + ctrlButton->setDefaultContextHelp(ucstring(tooltip)); + } + } + + ctrlButton->setText(ucstring::makeFromUtf8(value)); + + setTextButtonStyle(ctrlButton, _Style.Current); + } + getParagraph()->addChild (buttonGroup); + paragraphChange (); + } + } + // *************************************************************************** void CGroupHTML::htmlA(const CHtmlElement &elm) { @@ -5139,12 +5447,64 @@ namespace NLGUI // *************************************************************************** void CGroupHTML::htmlBR(const CHtmlElement &elm) { - endParagraph(); + if (!_Paragraph || _Paragraph->getNumChildren() == 0) + { + ucstring tmp("\n"); + addString(tmp); + } + else + { + endParagraph(); + } + } - // insert zero-width-space (0x200B) to prevent removal of empty lines - ucstring tmp; - tmp.fromUtf8("\xe2\x80\x8b"); - addString(tmp); + // *************************************************************************** + void CGroupHTML::htmlBUTTON(const CHtmlElement &elm) + { + std::string name = elm.getAttribute("name"); + std::string value = elm.getAttribute("value"); + std::string formId = elm.getAttribute("form"); + std::string formAction = elm.getAttribute("formaction"); + std::string tooltip = elm.getAttribute("tooltip"); + bool disabled = elm.hasAttribute("disabled"); + + if (!formAction.empty()) + { + formAction = getAbsoluteUrl(formAction); + } + + _FormSubmit.push_back(SFormSubmitButton(formId, name, value, "text", formAction)); + // Action handler parameters + std::string param; + if (!disabled) + { + if (elm.getAttribute("type") == "submit") + { + param = "ah:html_submit_form&name=" + getId() + "&button=" + toString(_FormSubmit.size()-1); + } + else + { + param = "ah:"; + } + } + + _A.push_back(true); + _Link.push_back(param); + _LinkTitle.push_back(tooltip); + _LinkClass.push_back("ryzom-ui-button"); + + // TODO: this creates separate button element + //renderPseudoElement(":before", elm); + } + void CGroupHTML::htmlBUTTONend(const CHtmlElement &elm) + { + // TODO: this creates separate button element + //renderPseudoElement(":after", elm); + + popIfNotEmpty(_A); + popIfNotEmpty(_Link); + popIfNotEmpty(_LinkTitle); + popIfNotEmpty(_LinkClass); } // *************************************************************************** @@ -5201,8 +5561,6 @@ namespace NLGUI // *************************************************************************** void CGroupHTML::htmlDIV(const CHtmlElement &elm) { - _BlockLevelElement.push_back(true); - _DivName = elm.getAttribute("name"); string instClass = elm.getAttribute("class"); @@ -5225,8 +5583,6 @@ namespace NLGUI { if ((*it).first == "template") templateName = (*it).second; - else if ((*it).first == "display" && (*it).second == "inline-block") - _BlockLevelElement.back() = false; else tmplParams.push_back(TTmplParam((*it).first, (*it).second)); } @@ -5259,8 +5615,6 @@ namespace NLGUI inst->setPosRef(Hotspot_TL); inst->setParentPosRef(Hotspot_TL); getDiv()->addGroup(inst); - - _BlockLevelElement.back() = false; } else { @@ -5272,25 +5626,14 @@ namespace NLGUI } } - if (isBlockLevelElement()) - { - newParagraph(0); - } - renderPseudoElement(":before", elm); } void CGroupHTML::htmlDIVend(const CHtmlElement &elm) { renderPseudoElement(":after", elm); - - if (isBlockLevelElement()) - { - endParagraph(); - } _DivName.clear(); popIfNotEmpty(_Divs); - popIfNotEmpty(_BlockLevelElement); } // *************************************************************************** @@ -5298,7 +5641,6 @@ namespace NLGUI { _DL.push_back(HTMLDListElement()); _LI = _DL.size() > 1 || !_UL.empty(); - endParagraph(); renderPseudoElement(":before", elm); } @@ -5310,8 +5652,6 @@ namespace NLGUI renderPseudoElement(":after", elm); - endParagraph(); - // unclosed DT if (_DL.back().DT) { @@ -5400,6 +5740,12 @@ namespace NLGUI { // Build the form CGroupHTML::CForm form; + // id check is case sensitive and auto id's are uppercase + form.id = toLower(trim(elm.getAttribute("id"))); + if (form.id.empty()) + { + form.id = toString("FORM%d", _Forms.size()); + } // Get the action name if (elm.hasNonEmptyAttribute("action")) @@ -5426,7 +5772,6 @@ namespace NLGUI void CGroupHTML::htmlHend(const CHtmlElement &elm) { renderPseudoElement(":after", elm); - endParagraph(); } // *************************************************************************** @@ -5444,8 +5789,6 @@ namespace NLGUI // *************************************************************************** void CGroupHTML::htmlHR(const CHtmlElement &elm) { - newParagraph(0); - CInterfaceGroup *sep = CWidgetManager::getInstance()->getParser()->createGroupInstance("html_hr", "", NULL, 0); if (sep) { @@ -5467,10 +5810,8 @@ namespace NLGUI } renderPseudoElement(":before", elm); - getParagraph()->addChild(sep); + addHtmlGroup(sep, 0); renderPseudoElement(":after", elm); - - endParagraph(); } } @@ -5479,10 +5820,9 @@ namespace NLGUI { if (elm.hasNonEmptyAttribute("style")) { - _Style.Root = _Style.Current; - _Style.applyRootStyle(elm.getAttribute("style")); - _Style.Current = _Style.Root; + _Style.applyStyle(elm.getAttribute("style")); } + _Style.Root = _Style.Current; applyBackground(elm); } @@ -5523,26 +5863,23 @@ namespace NLGUI // Tooltip // keep "alt" attribute for backward compatibility - std::string strtooltip = elm.getAttribute("alt"); + std::string tooltip = elm.getAttribute("alt"); // tooltip if (elm.hasNonEmptyAttribute("title")) - strtooltip = elm.getAttribute("title"); - - const char *tooltip = NULL; - // note: uses pointer to string data - if (!strtooltip.empty()) - tooltip = strtooltip.c_str(); + tooltip = elm.getAttribute("title"); // Mouse over image string overSrc = elm.getAttribute("data-over-src"); - if (getA() && getParent () && getParent ()->getParent()) + // inside a/button with valid url (ie, button is not disabled) + string url = getLink(); + if (getA() && !url.empty() && getParent() && getParent()->getParent()) { - string params = "name=" + getId() + "|url=" + getLink (); + string params = "name=" + getId() + "|url=" + url; addButton(CCtrlButton::PushButton, id, src, src, overSrc, "browse", params.c_str(), tooltip, _Style.Current); } else - if (tooltip || !overSrc.empty()) + if (!tooltip.empty() || !overSrc.empty()) { addButton(CCtrlButton::PushButton, id, src, src, overSrc, "", "", tooltip, _Style.Current); } @@ -5582,7 +5919,8 @@ namespace NLGUI templateName = elm.getAttribute("z_input_tmpl"); // Widget minimal width - string minWidth = elm.getAttribute("z_input_width"); + uint32 minWidth = 0; + fromString(elm.getAttribute("z_input_width"), minWidth); // std::string type = trim(elm.getAttribute("type")); @@ -5597,96 +5935,23 @@ namespace NLGUI _Style.Current.GlobalColor = true; // Tooltip - std::string strtooltip = elm.getAttribute("alt"); - const char *tooltip = NULL; - // note: uses pointer to strtooltip data - if (!strtooltip.empty()) - tooltip = strtooltip.c_str(); + std::string tooltip = elm.getAttribute("alt"); if (type == "image") { - // The submit button string name = elm.getAttribute("name"); - string normal = elm.getAttribute("src"); - string pushed; - string over; + string src = elm.getAttribute("src"); + string over = elm.getAttribute("data-over-src"); - // Action handler parameters : "name=group_html_id|form=id_of_the_form|submit_button=button_name" - string param = "name=" + getId() + "|form=" + toString (_Forms.size()-1) + "|submit_button=" + name + "|submit_button_type=image"; - - // Add the ctrl button - addButton (CCtrlButton::PushButton, name, normal, pushed.empty()?normal:pushed, over, - "html_submit_form", param.c_str(), tooltip, _Style.Current); + insertFormImageButton(name, tooltip, src, over, _Forms.back().id, "", minWidth, templateName); } else if (type == "button" || type == "submit") { // The submit button string name = elm.getAttribute("name"); - string normal = elm.getAttribute("src"); - string text = elm.getAttribute("value"); - string pushed; - string over; + string value = elm.getAttribute("value"); - string buttonTemplate(!templateName.empty() ? templateName : DefaultButtonGroup ); - - // Action handler parameters : "name=group_html_id|form=id_of_the_form|submit_button=button_name" - string param = "name=" + getId() + "|form=" + toString (_Forms.size()-1) + "|submit_button=" + name + "|submit_button_type=submit"; - if (!text.empty()) - { - // escape AH param separator - string tmp = text; - while(NLMISC::strFindReplace(tmp, "|", "|")) - ; - param = param + "|submit_button_value=" + tmp; - } - - // Add the ctrl button - if (!_Paragraph) - { - newParagraph (0); - paragraphChange (); - } - - typedef pair TTmplParam; - vector tmplParams; - tmplParams.push_back(TTmplParam("id", name)); - tmplParams.push_back(TTmplParam("onclick", "html_submit_form")); - tmplParams.push_back(TTmplParam("onclick_param", param)); - //tmplParams.push_back(TTmplParam("text", text)); - tmplParams.push_back(TTmplParam("active", "true")); - if (!minWidth.empty()) - tmplParams.push_back(TTmplParam("wmin", minWidth)); - CInterfaceGroup *buttonGroup = CWidgetManager::getInstance()->getParser()->createGroupInstance(buttonTemplate, _Paragraph->getId(), tmplParams); - if (buttonGroup) - { - - // Add the ctrl button - CCtrlTextButton *ctrlButton = dynamic_cast(buttonGroup->getCtrl("button")); - if (!ctrlButton) ctrlButton = dynamic_cast(buttonGroup->getCtrl("b")); - if (ctrlButton) - { - ctrlButton->setModulateGlobalColorAll (_Style.Current.GlobalColor); - - // Translate the tooltip - if (tooltip) - { - if (CI18N::hasTranslation(tooltip)) - { - ctrlButton->setDefaultContextHelp(CI18N::get(tooltip)); - } - else - { - ctrlButton->setDefaultContextHelp(ucstring(tooltip)); - } - } - - ctrlButton->setText(ucstring::makeFromUtf8(text)); - - setTextButtonStyle(ctrlButton, _Style.Current); - } - getParagraph()->addChild (buttonGroup); - paragraphChange (); - } + insertFormTextButton(name, tooltip, value, _Forms.back().id, "", minWidth, templateName); } else if (type == "text") { @@ -5906,6 +6171,50 @@ namespace NLGUI } } + // *************************************************************************** + void CGroupHTML::htmlMETER(const CHtmlElement &elm) + { + HTMLMeterElement meter; + meter.readValues(elm); + + std::string id = "meter"; + if (elm.hasAttribute("id")) + id = elm.getAttribute("id"); + + // width: 5em, height: 1em + uint32 width = _Style.Current.Width > -1 ? _Style.Current.Width : _Style.Current.FontSize * 5; + uint32 height = _Style.Current.Height > -1 ? _Style.Current.Height : _Style.Current.FontSize; + uint32 border = _Style.Current.BorderWidth > -1 ? _Style.Current.BorderWidth : 0; + + uint barw = (uint) (width * meter.getValueRatio()); + CRGBA bgColor = meter.getBarColor(elm, _Style); + CRGBA valueColor = meter.getValueColor(elm, _Style); + + typedef pair TTmplParam; + vector tmplParams; + tmplParams.push_back(TTmplParam("id", id)); + tmplParams.push_back(TTmplParam("active", "true")); + tmplParams.push_back(TTmplParam("w", toString(width))); + tmplParams.push_back(TTmplParam("h", toString(height))); + tmplParams.push_back(TTmplParam("border_x2", toString(border*2))); + tmplParams.push_back(TTmplParam("bgtexture", "blank.tga")); + tmplParams.push_back(TTmplParam("bgcolor", bgColor.toString())); + tmplParams.push_back(TTmplParam("value_w", toString(barw))); + tmplParams.push_back(TTmplParam("value_texture", "blank.tga")); + tmplParams.push_back(TTmplParam("value_color", valueColor.toString())); + + CInterfaceGroup *gr = CWidgetManager::getInstance()->getParser()->createGroupInstance("html_meter", getParagraph()->getId(), &tmplParams[0], (uint)tmplParams.size()); + if (gr) + { + renderPseudoElement(":before", elm); + getParagraph()->addChild(gr); + renderPseudoElement(":after", elm); + + // ignore any inner elements + _IgnoreChildElements = true; + } + } + // *************************************************************************** void CGroupHTML::htmlOBJECT(const CHtmlElement &elm) { @@ -5950,7 +6259,6 @@ namespace NLGUI // if LI is already present _LI = _UL.size() > 1 || _DL.size() > 1; _Indent.push_back(getIndent() + ULIndent); - endParagraph(); renderPseudoElement(":before", elm); } @@ -6060,7 +6368,6 @@ namespace NLGUI void CGroupHTML::htmlPend(const CHtmlElement &elm) { renderPseudoElement(":after", elm); - endParagraph(); } // *************************************************************************** @@ -6076,10 +6383,53 @@ namespace NLGUI { renderPseudoElement(":after", elm); - endParagraph(); popIfNotEmpty(_PRE); } + // *************************************************************************** + void CGroupHTML::htmlPROGRESS(const CHtmlElement &elm) + { + HTMLProgressElement progress; + progress.readValues(elm); + + std::string id = "progress"; + if (elm.hasAttribute("id")) + id = elm.getAttribute("id"); + + // width: 10em, height: 1em + uint32 width = _Style.Current.Width > -1 ? _Style.Current.Width : _Style.Current.FontSize * 10; + uint32 height = _Style.Current.Height > -1 ? _Style.Current.Height : _Style.Current.FontSize; + uint32 border = _Style.Current.BorderWidth > -1 ? _Style.Current.BorderWidth : 0; + + uint barw = (uint) (width * progress.getValueRatio()); + CRGBA bgColor = progress.getBarColor(elm, _Style); + CRGBA valueColor = progress.getValueColor(elm, _Style); + + typedef pair TTmplParam; + vector tmplParams; + tmplParams.push_back(TTmplParam("id", id)); + tmplParams.push_back(TTmplParam("active", "true")); + tmplParams.push_back(TTmplParam("w", toString(width))); + tmplParams.push_back(TTmplParam("h", toString(height))); + tmplParams.push_back(TTmplParam("border_x2", toString(border*2))); + tmplParams.push_back(TTmplParam("bgtexture", "blank.tga")); + tmplParams.push_back(TTmplParam("bgcolor", bgColor.toString())); + tmplParams.push_back(TTmplParam("value_w", toString(barw))); + tmplParams.push_back(TTmplParam("value_texture", "blank.tga")); + tmplParams.push_back(TTmplParam("value_color", valueColor.toString())); + + CInterfaceGroup *gr = CWidgetManager::getInstance()->getParser()->createGroupInstance("html_progress", getParagraph()->getId(), &tmplParams[0], (uint)tmplParams.size()); + if (gr) + { + renderPseudoElement(":before", elm); + getParagraph()->addChild(gr); + renderPseudoElement(":after", elm); + + // ignore any inner elements + _IgnoreChildElements = true; + } + } + // *************************************************************************** void CGroupHTML::htmlSCRIPT(const CHtmlElement &elm) { @@ -6249,7 +6599,6 @@ namespace NLGUI popIfNotEmpty(_Indent); renderPseudoElement(":after", elm); - endParagraph(); } // *************************************************************************** @@ -6467,7 +6816,6 @@ namespace NLGUI // if LI is already present _LI = _UL.size() > 1 || _DL.size() > 1; _Indent.push_back(getIndent() + ULIndent); - endParagraph(); renderPseudoElement(":before", elm); } @@ -6479,7 +6827,6 @@ namespace NLGUI renderPseudoElement(":after", elm); - endParagraph(); popIfNotEmpty(_UL); popIfNotEmpty(_Indent); } diff --git a/code/nel/src/gui/group_list.cpp b/code/nel/src/gui/group_list.cpp index 216c8f682..624c68d75 100644 --- a/code/nel/src/gui/group_list.cpp +++ b/code/nel/src/gui/group_list.cpp @@ -1026,7 +1026,6 @@ namespace NLGUI } child->_Parent = this; child->_ParentPos = NULL; - child->_Active = true; child->_X = 0; child->_Y = 0; child->_RenderLayer = this->_RenderLayer; diff --git a/code/nel/src/gui/html_element.cpp b/code/nel/src/gui/html_element.cpp index 215c1c9f5..141fa87af 100644 --- a/code/nel/src/gui/html_element.cpp +++ b/code/nel/src/gui/html_element.cpp @@ -82,6 +82,46 @@ namespace NLGUI } } + // *************************************************************************** + void CHtmlElement::clearPseudo() + { + _Pseudo.clear(); + } + + // *************************************************************************** + bool CHtmlElement::hasPseudo(const std::string &key) const + { + return _Pseudo.find(key) != _Pseudo.end(); + } + + // *************************************************************************** + TStyle CHtmlElement::getPseudo(const std::string &key) const + { + std::map::const_iterator it = _Pseudo.find(key); + if (it != _Pseudo.end()) + return it->second; + + return TStyle(); + } + + // *************************************************************************** + void CHtmlElement::setPseudo(const std::string &key, const TStyle &style) + { + std::map::iterator it = _Pseudo.find(key); + if (it != _Pseudo.end()) + { + // insert into previous, override previous values if they exist + for(TStyle::const_iterator itStyle = style.begin(); itStyle != style.end(); ++itStyle) + { + it->second[itStyle->first] = itStyle->second; + } + } + else + { + _Pseudo[key] = style; + } + } + // *************************************************************************** std::string CHtmlElement::toString(bool tree, uint depth) const { diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index 789030a4a..07b840695 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -51,14 +51,14 @@ namespace NLGUI CInterfaceGroup::CInterfaceGroup(const TCtorParam ¶m) : CCtrlBase(param) { _ParentSizeMax = NULL; - _MaxW = _MaxH = 16384; + _MaxW = _MaxH = std::numeric_limits::max(); _OffsetX = _OffsetY = 0; _Overlappable= true; _ResizeFromChildW= false; _ResizeFromChildH= false; _ResizeFromChildWMargin= 0; _ResizeFromChildHMargin= 0; - _MaxWReal = _MaxHReal = 16384; + _MaxWReal = _MaxHReal = std::numeric_limits::max(); _GroupSizeRef = 0; _Escapable= false; _Priority= WIN_PRIORITY_NORMAL; @@ -829,7 +829,7 @@ namespace NLGUI const std::map< uint32, SLinkData > &linkMap = CWidgetManager::getInstance()->getParser()->getLinkMap(); - + xmlNodePtr node = NULL; std::map< uint32, SLinkData >::const_iterator itr; @@ -847,17 +847,17 @@ namespace NLGUI xmlAddChild( parentNode, node ); xmlSetProp( node, BAD_CAST "expr", BAD_CAST data.expr.c_str() ); - + if( !data.target.empty() ) xmlSetProp( node, BAD_CAST "target", BAD_CAST data.target.c_str() ); - + if( !data.action.empty() ) { xmlSetProp( node, BAD_CAST "action", BAD_CAST data.action.c_str() ); - + if( !data.params.empty() ) xmlSetProp( node, BAD_CAST "params", BAD_CAST data.params.c_str() ); - + if( !data.cond.empty() ) xmlSetProp( node, BAD_CAST "cond", BAD_CAST data.cond.c_str() ); } @@ -1542,12 +1542,8 @@ namespace NLGUI // \todo yoyo: do not know why but don't work if this==scroll_text if(sonGroup && !isGroupScrollText()) { - sint32 oldSciX= -16384; - sint32 oldSciY= -16384; - sint32 oldSciW= 32768; - sint32 oldSciH= 32768; sint32 w, h; - sonGroup->computeCurrentClipContribution(oldSciX, oldSciY, oldSciW, oldSciH, x0, y0, w, h); + sonGroup->computeClipContribution(x0, y0, w, h); x1= x0 + w; y1= y0 + h; } @@ -1792,7 +1788,7 @@ namespace NLGUI CInterfaceGroup *pChild = *itg; if (pChild->getActive()) { - // bool bUnder = + // bool bUnder = pChild->getViewsUnder (x, y, clipX, clipY, clipW, clipH, vVB); // if (bUnder && !vICL.empty()) // return true; @@ -1847,7 +1843,7 @@ namespace NLGUI CInterfaceGroup *pChild = *itg; if (pChild->getActive()) { - // bool bUnder = + // bool bUnder = pChild->getCtrlsUnder (x, y, clipX, clipY, clipW, clipH, vICL); // if (bUnder && !vICL.empty()) // return true; @@ -1903,7 +1899,7 @@ namespace NLGUI CInterfaceGroup *pChild = *itg; if (pChild->getActive()) { - // bool bUnder = + // bool bUnder = pChild->getGroupsUnder (x, y, clipX, clipY, clipW, clipH, vIGL); // if (bUnder && !vICL.empty()) // return true; @@ -1926,8 +1922,7 @@ namespace NLGUI } // ------------------------------------------------------------------------------------------------ - void CInterfaceGroup::computeCurrentClipContribution(sint32 oldSciX, sint32 oldSciY, sint32 oldSciW, sint32 oldSciH, - sint32 &newSciXDest, sint32 &newSciYDest, sint32 &newSciWDest, sint32 &newSciHDest) const + void CInterfaceGroup::computeClipContribution(sint32 &newSciXDest, sint32 &newSciYDest, sint32 &newSciWDest, sint32 &newSciHDest) const { sint32 newSciX = _XReal; sint32 newSciY = _YReal; @@ -1947,6 +1942,21 @@ namespace NLGUI newSciY = _YReal + _HReal - _MaxHReal; newSciH = _MaxHReal; } + // Don't apply margins because HTML list marker is drawn outside group paragraph inner content. + // Should not be an issue because horizontal scolling not used. + newSciXDest = newSciX/* + _MarginLeft*/; + newSciYDest = newSciY; + newSciWDest = newSciW/* - _MarginLeft*/; + newSciHDest = newSciH; + } + + // ------------------------------------------------------------------------------------------------ + void CInterfaceGroup::computeCurrentClipContribution(sint32 oldSciX, sint32 oldSciY, sint32 oldSciW, sint32 oldSciH, + sint32 &newSciXDest, sint32 &newSciYDest, sint32 &newSciWDest, sint32 &newSciHDest) const + { + sint32 newSciX, newSciY, newSciW, newSciH; + computeClipContribution(newSciX, newSciY, newSciW, newSciH); + // Clip Left if (newSciX < oldSciX) { @@ -2149,7 +2159,34 @@ namespace NLGUI } // ------------------------------------------------------------------------------------------------ - void CInterfaceGroup::dumpGroups() + int CInterfaceGroup::luaDumpSize(CLuaState &ls) + { + const char *funcName = "dumpSize"; + CLuaIHM::checkArgCount(ls, funcName, 0); + dumpSize(); + return 0; + } + + // ------------------------------------------------------------------------------------------------ + int CInterfaceGroup::luaDumpEltsOrder(CLuaState &ls) + { + const char *funcName = "dumpEltsOrder"; + CLuaIHM::checkArgCount(ls, funcName, 0); + dumpEltsOrder(); + return 0; + } + + // ------------------------------------------------------------------------------------------------ + int CInterfaceGroup::luaDumpGroups(CLuaState &ls) + { + const char *funcName = "dumpGroups"; + CLuaIHM::checkArgCount(ls, funcName, 0); + dumpGroups(); + return 0; + } + + // ------------------------------------------------------------------------------------------------ + void CInterfaceGroup::dumpGroups() const { nlinfo("Num groups = %d", (int) _ChildrenGroups.size()); for(uint k = 0; k < _ChildrenGroups.size(); ++k) @@ -2166,21 +2203,18 @@ namespace NLGUI } // ------------------------------------------------------------------------------------------------ - void CInterfaceGroup::dumpEltsOrder() + void CInterfaceGroup::dumpEltsOrder() const { - nlinfo("Num elements = %d", (int) _EltOrder.size()); + nlinfo("Num elements = %d, num groups = %d", (int) _EltOrder.size(), _ChildrenGroups.size()); for(uint k = 0; k < _EltOrder.size(); ++k) { - std::string typeName = "???"; - if (_ChildrenGroups[k]) - { - NLGUI::CViewBase *view = _EltOrder[k]; - const type_info &ti = typeid(*view); - typeName = ti.name(); - } CInterfaceElement *el = _EltOrder[k]; if (el) { + std::string typeName; + NLGUI::CViewBase *view = _EltOrder[k]; + const type_info &ti = typeid(*view); + typeName = ti.name(); nlinfo("Element %d, name = %s, type=%s, x=%d, y=%d, parent_name=%s parentposname=%s xreal=%d, yreal=%d, wreal=%d, hreal=%d", k, el->getId().c_str(), typeName.c_str(), el->getX(), el->getY(), el->getParent() ? el->getParent()->getId().c_str() : "no parent", el->getParentPos() ? el->getParentPos()->getId().c_str() : "parent", @@ -2595,7 +2629,7 @@ namespace NLGUI e->setSizeRef(""); e->setParent(p); - + e->setParentPos(p); e->setParentSize(p); e->alignTo(p); diff --git a/code/nel/src/gui/view_bitmap.cpp b/code/nel/src/gui/view_bitmap.cpp index 79b8c32a4..659d8e45d 100644 --- a/code/nel/src/gui/view_bitmap.cpp +++ b/code/nel/src/gui/view_bitmap.cpp @@ -37,6 +37,18 @@ REGISTER_UI_CLASS(CViewBitmap) namespace NLGUI { + CViewBitmap::~CViewBitmap() + { + if (_HtmlDownload) + { + CGroupHTML *groupHtml = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:webig:content:html")); + if (groupHtml) { + _HtmlDownload = false; + groupHtml->removeImageDownload(dynamic_cast(this)); + } + } + } + std::string CViewBitmap::getProperty( const std::string &name ) const { if( name == "color" ) @@ -461,6 +473,7 @@ namespace NLGUI if (!CFile::fileExists(localname)) localname = "web_del.tga"; _TextureId.setTexture (localname.c_str(), _TxtOffsetX, _TxtOffsetY, _TxtWidth, _TxtHeight, false); + _HtmlDownload = true; groupHtml->addImageDownload(TxName, dynamic_cast(this)); } } diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index cf3857102..fc388ec72 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -79,7 +79,7 @@ namespace NLGUI _MultiLine = false; _TextMode = DontClipWord; _MultiLineSpace = 8; - _LineMaxW = 16384; + _LineMaxW = std::numeric_limits::max(); _MultiLineMaxWOnly = false; _MultiLineClipEndSpace = false; _LastMultiLineMaxW = 0; @@ -199,7 +199,7 @@ namespace NLGUI _MultiLine = false; _MultiLineSpace = 8; - _LineMaxW= 16384; + _LineMaxW= std::numeric_limits::max(); _MultiLineMaxWOnly = false; _MultiLineClipEndSpace = false; _LastMultiLineMaxW = 0; @@ -858,7 +858,7 @@ namespace NLGUI } prop = (char*) xmlGetProp( cur, (xmlChar*)"line_maxw" ); - _LineMaxW = 16384; + _LineMaxW = std::numeric_limits::max(); if (prop) fromString((const char*)prop, _LineMaxW); diff --git a/code/nel/src/ligo/zone_bank.cpp b/code/nel/src/ligo/zone_bank.cpp index b1c6b73c6..c26205316 100644 --- a/code/nel/src/ligo/zone_bank.cpp +++ b/code/nel/src/ligo/zone_bank.cpp @@ -508,7 +508,7 @@ bool CZoneBank::initFromPath(const std::string &sPathName, std::string &error) if (ext == "ligozone") { - if (!addElement(NLMISC::CFile::getFilename(files[i]), error)) + if (!addElement(files[i], error)) return false; } } diff --git a/code/nel/src/misc/stdmisc.h b/code/nel/src/misc/stdmisc.h index d7a623465..794fd9050 100644 --- a/code/nel/src/misc/stdmisc.h +++ b/code/nel/src/misc/stdmisc.h @@ -20,8 +20,11 @@ #if defined(_MSC_VER) && defined(_DEBUG) #define _CRTDBG_MAP_ALLOC #include + #include #include #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) +#elif defined(_MSC_VER) + #include #endif #include diff --git a/code/nel/src/misc/string_common.cpp b/code/nel/src/misc/string_common.cpp index ba911c1bc..8f032c7c5 100644 --- a/code/nel/src/misc/string_common.cpp +++ b/code/nel/src/misc/string_common.cpp @@ -144,9 +144,9 @@ std::string winCpToCp(const char *str, size_t len, UINT srcCp, UINT dstCp) wchar_t *tmp = (wchar_t *)_malloca((len + 1) * 4); if (!tmp) return std::string(); - int tmpLen = MultiByteToWideChar(srcCp, MB_PRECOMPOSED, + int tmpLen = MultiByteToWideChar(srcCp, 0, str, (int)(len + 1), /* include null-termination */ - tmp, (int)((len + 1) * 4)); + tmp, (int)((len + 1) * 2)); if (tmpLen <= 1) { _freea(tmp); @@ -170,9 +170,9 @@ std::wstring winCpToWide(const char *str, size_t len, UINT cp) wchar_t *tmp = (wchar_t *)_malloca((len + 1) * 4); if (!tmp) return std::wstring(); - int tmpLen = MultiByteToWideChar(cp, MB_PRECOMPOSED, + int tmpLen = MultiByteToWideChar(cp, 0, str, (int)(len + 1), /* include null-termination */ - tmp, (int)((len + 1) * 4)); + tmp, (int)((len + 1) * 2)); if (tmpLen <= 1) { _freea(tmp); diff --git a/code/nel/src/sound/audio_decoder.cpp b/code/nel/src/sound/audio_decoder.cpp index f56f16a2e..6f558ad91 100644 --- a/code/nel/src/sound/audio_decoder.cpp +++ b/code/nel/src/sound/audio_decoder.cpp @@ -103,7 +103,7 @@ IAudioDecoder *IAudioDecoder::createAudioDecoder(const std::string &type, NLMISC { return new CAudioDecoderVorbis(stream, loop); } -#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ +#if !defined(NL_OS_WINDOWS) || (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ else if (type_lower == "mp3") { return new CAudioDecoderMP3(stream, loop); @@ -146,7 +146,7 @@ bool IAudioDecoder::getInfo(const std::string &filepath, std::string &artist, st nlwarning("Unable to open: '%s'", filepath.c_str()); } -#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ +#if !defined(NL_OS_WINDOWS) || (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ else if (type_lower == "mp3") { CIFile ifile; diff --git a/code/nel/src/sound/audio_decoder_mp3.cpp b/code/nel/src/sound/audio_decoder_mp3.cpp index fd8b1721c..47795ec6e 100644 --- a/code/nel/src/sound/audio_decoder_mp3.cpp +++ b/code/nel/src/sound/audio_decoder_mp3.cpp @@ -17,7 +17,7 @@ #include "stdsound.h" -#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ +#if !defined(NL_OS_WINDOWS) || (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ #include diff --git a/code/nel/src/sound/driver/dsound/resources.rc b/code/nel/src/sound/driver/dsound/resources.rc index 31bf52aed..7e8164dd8 100644 --- a/code/nel/src/sound/driver/dsound/resources.rc +++ b/code/nel/src/sound/driver/dsound/resources.rc @@ -27,11 +27,11 @@ BEGIN VALUE "OriginalFilename", "nel_drv_dsound_win_r.dll" #endif VALUE "ProductName", "Ryzom Core" - VALUE "ProductVersion", NL_VERSION + VALUE "ProductVersion", NL_PRODUCT_VERSION END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1252 + VALUE "Translation", 0x9, 1200 END END diff --git a/code/nel/src/sound/driver/fmod/resources.rc b/code/nel/src/sound/driver/fmod/resources.rc index 8946e3483..39c39268b 100644 --- a/code/nel/src/sound/driver/fmod/resources.rc +++ b/code/nel/src/sound/driver/fmod/resources.rc @@ -27,11 +27,11 @@ BEGIN VALUE "OriginalFilename", "nel_drv_fmod_win_r.dll" #endif VALUE "ProductName", "Ryzom Core" - VALUE "ProductVersion", NL_VERSION + VALUE "ProductVersion", NL_PRODUCT_VERSION END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1252 + VALUE "Translation", 0x9, 1200 END END diff --git a/code/nel/src/sound/driver/openal/resources.rc b/code/nel/src/sound/driver/openal/resources.rc index 97fdc87e9..2d90662ba 100644 --- a/code/nel/src/sound/driver/openal/resources.rc +++ b/code/nel/src/sound/driver/openal/resources.rc @@ -27,11 +27,11 @@ BEGIN VALUE "OriginalFilename", "nel_drv_openal_win_r.dll" #endif VALUE "ProductName", "Ryzom Core" - VALUE "ProductVersion", NL_VERSION + VALUE "ProductVersion", NL_PRODUCT_VERSION END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1252 + VALUE "Translation", 0x9, 1200 END END diff --git a/code/nel/src/sound/driver/xaudio2/resources.rc b/code/nel/src/sound/driver/xaudio2/resources.rc index ef7165456..3f067621d 100644 --- a/code/nel/src/sound/driver/xaudio2/resources.rc +++ b/code/nel/src/sound/driver/xaudio2/resources.rc @@ -27,11 +27,11 @@ BEGIN VALUE "OriginalFilename", "nel_drv_xaudio2_win_r.dll" #endif VALUE "ProductName", "Ryzom Core" - VALUE "ProductVersion", NL_VERSION + VALUE "ProductVersion", NL_PRODUCT_VERSION END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1252 + VALUE "Translation", 0x9, 1200 END END diff --git a/code/nel/tools/3d/anim_builder/CMakeLists.txt b/code/nel/tools/3d/anim_builder/CMakeLists.txt index 61188b461..eec238d39 100644 --- a/code/nel/tools/3d/anim_builder/CMakeLists.txt +++ b/code/nel/tools/3d/anim_builder/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(anim_builder ${SRC}) diff --git a/code/nel/tools/3d/anim_builder/blue_pill.ico b/code/nel/tools/3d/anim_builder/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/anim_builder/blue_pill.ico differ diff --git a/code/nel/tools/3d/anim_builder/main.rc b/code/nel/tools/3d/anim_builder/main.rc new file mode 100644 index 000000000..fe31d676d --- /dev/null +++ b/code/nel/tools/3d/anim_builder/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Anim Builder" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "anim_builder" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/animation_set_builder/CMakeLists.txt b/code/nel/tools/3d/animation_set_builder/CMakeLists.txt index da81b1de3..014b36294 100644 --- a/code/nel/tools/3d/animation_set_builder/CMakeLists.txt +++ b/code/nel/tools/3d/animation_set_builder/CMakeLists.txt @@ -1,9 +1,11 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(animation_set_builder ${SRC}) TARGET_LINK_LIBRARIES(animation_set_builder nel3d nelmisc) -NL_DEFAULT_PROPS(animation_set_builder "NeL, Tools, 3D: anim_set_builder") +NL_DEFAULT_PROPS(animation_set_builder "NeL, Tools, 3D: Animation Set Builder") NL_ADD_RUNTIME_FLAGS(animation_set_builder) INSTALL(TARGETS animation_set_builder RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT tools3d) diff --git a/code/nel/tools/3d/animation_set_builder/gold_pill.ico b/code/nel/tools/3d/animation_set_builder/gold_pill.ico new file mode 100644 index 000000000..618b67a5d Binary files /dev/null and b/code/nel/tools/3d/animation_set_builder/gold_pill.ico differ diff --git a/code/nel/tools/3d/animation_set_builder/main.rc b/code/nel/tools/3d/animation_set_builder/main.rc new file mode 100644 index 000000000..4605665aa --- /dev/null +++ b/code/nel/tools/3d/animation_set_builder/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "gold_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Animation Set Builder" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "animation_set_builder" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/build_clod_bank/CMakeLists.txt b/code/nel/tools/3d/build_clod_bank/CMakeLists.txt index 2bd4846d7..05c730922 100644 --- a/code/nel/tools/3d/build_clod_bank/CMakeLists.txt +++ b/code/nel/tools/3d/build_clod_bank/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_clod_bank ${SRC}) diff --git a/code/nel/tools/3d/build_clodtex/CMakeLists.txt b/code/nel/tools/3d/build_clodtex/CMakeLists.txt index 558962421..956eaf651 100644 --- a/code/nel/tools/3d/build_clodtex/CMakeLists.txt +++ b/code/nel/tools/3d/build_clodtex/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_clodtex ${SRC}) diff --git a/code/nel/tools/3d/build_coarse_mesh/CMakeLists.txt b/code/nel/tools/3d/build_coarse_mesh/CMakeLists.txt index 93eba1bfc..cc51fd4f8 100644 --- a/code/nel/tools/3d/build_coarse_mesh/CMakeLists.txt +++ b/code/nel/tools/3d/build_coarse_mesh/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_coarse_mesh ${SRC}) diff --git a/code/nel/tools/3d/build_far_bank/CMakeLists.txt b/code/nel/tools/3d/build_far_bank/CMakeLists.txt index 7a858d560..59580ec1d 100644 --- a/code/nel/tools/3d/build_far_bank/CMakeLists.txt +++ b/code/nel/tools/3d/build_far_bank/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_far_bank ${SRC}) diff --git a/code/nel/tools/3d/build_interface/CMakeLists.txt b/code/nel/tools/3d/build_interface/CMakeLists.txt index 113fe2b84..66c8ba9b4 100644 --- a/code/nel/tools/3d/build_interface/CMakeLists.txt +++ b/code/nel/tools/3d/build_interface/CMakeLists.txt @@ -1,4 +1,4 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) SOURCE_GROUP("" FILES ${SRC}) diff --git a/code/nel/tools/3d/build_shadow_skin/CMakeLists.txt b/code/nel/tools/3d/build_shadow_skin/CMakeLists.txt index 78bbd712d..fbe504067 100644 --- a/code/nel/tools/3d/build_shadow_skin/CMakeLists.txt +++ b/code/nel/tools/3d/build_shadow_skin/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_shadow_skin ${SRC}) diff --git a/code/nel/tools/3d/build_smallbank/CMakeLists.txt b/code/nel/tools/3d/build_smallbank/CMakeLists.txt index 260f6b9aa..c284e1e2b 100644 --- a/code/nel/tools/3d/build_smallbank/CMakeLists.txt +++ b/code/nel/tools/3d/build_smallbank/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_smallbank ${SRC}) diff --git a/code/nel/tools/3d/cluster_viewer/CMakeLists.txt b/code/nel/tools/3d/cluster_viewer/CMakeLists.txt index a0db8cd68..a1da2d39b 100644 --- a/code/nel/tools/3d/cluster_viewer/CMakeLists.txt +++ b/code/nel/tools/3d/cluster_viewer/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(cluster_viewer WIN32 ${SRC}) diff --git a/code/nel/tools/3d/cluster_viewer/main.rc b/code/nel/tools/3d/cluster_viewer/main.rc new file mode 100644 index 000000000..df6b903d0 --- /dev/null +++ b/code/nel/tools/3d/cluster_viewer/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "red_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Cluster Viewer" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "cluster_viewer" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/cluster_viewer/red_pill.ico b/code/nel/tools/3d/cluster_viewer/red_pill.ico new file mode 100644 index 000000000..c5f250583 Binary files /dev/null and b/code/nel/tools/3d/cluster_viewer/red_pill.ico differ diff --git a/code/nel/tools/3d/get_neighbors/CMakeLists.txt b/code/nel/tools/3d/get_neighbors/CMakeLists.txt index d8de69ff5..dc32cbd0b 100644 --- a/code/nel/tools/3d/get_neighbors/CMakeLists.txt +++ b/code/nel/tools/3d/get_neighbors/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(get_neighbors ${SRC}) diff --git a/code/nel/tools/3d/get_neighbors/blue_pill.ico b/code/nel/tools/3d/get_neighbors/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/get_neighbors/blue_pill.ico differ diff --git a/code/nel/tools/3d/get_neighbors/main.rc b/code/nel/tools/3d/get_neighbors/main.rc new file mode 100644 index 000000000..309d23deb --- /dev/null +++ b/code/nel/tools/3d/get_neighbors/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Get Neighbors" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "get_neighbors" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt b/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt index d2482c276..326871e5b 100644 --- a/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt +++ b/code/nel/tools/3d/hls_bank_maker/CMakeLists.txt @@ -1,5 +1,7 @@ -FILE(GLOB SRC *.cpp *.h ../panoply_maker/hls_bank_texture_info.cpp ../panoply_maker/hls_bank_texture_info.h) - +FILE(GLOB SRC *.cpp *.h ../panoply_maker/hls_bank_texture_info.cpp ../panoply_maker/hls_bank_texture_info.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) + ADD_EXECUTABLE(hls_bank_maker ${SRC}) TARGET_LINK_LIBRARIES(hls_bank_maker s3tc_compressor nelmisc nel3d) diff --git a/code/nel/tools/3d/hls_bank_maker/blue_pill.ico b/code/nel/tools/3d/hls_bank_maker/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/hls_bank_maker/blue_pill.ico differ diff --git a/code/nel/tools/3d/hls_bank_maker/main.rc b/code/nel/tools/3d/hls_bank_maker/main.rc new file mode 100644 index 000000000..418288316 --- /dev/null +++ b/code/nel/tools/3d/hls_bank_maker/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL HLS Bank Maker" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "hls_bank_maker" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/ig_add/CMakeLists.txt b/code/nel/tools/3d/ig_add/CMakeLists.txt index 2ae993d51..6200232c8 100644 --- a/code/nel/tools/3d/ig_add/CMakeLists.txt +++ b/code/nel/tools/3d/ig_add/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(ig_add ${SRC}) diff --git a/code/nel/tools/3d/ig_add/blue_pill.ico b/code/nel/tools/3d/ig_add/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/ig_add/blue_pill.ico differ diff --git a/code/nel/tools/3d/ig_add/main.rc b/code/nel/tools/3d/ig_add/main.rc new file mode 100644 index 000000000..de0c24308 --- /dev/null +++ b/code/nel/tools/3d/ig_add/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL IG Add" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "ig_add" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/ig_elevation/CMakeLists.txt b/code/nel/tools/3d/ig_elevation/CMakeLists.txt index fc584883c..9c3e0fe26 100644 --- a/code/nel/tools/3d/ig_elevation/CMakeLists.txt +++ b/code/nel/tools/3d/ig_elevation/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(ig_elevation ${SRC}) diff --git a/code/nel/tools/3d/ig_elevation/blue_pill.ico b/code/nel/tools/3d/ig_elevation/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/ig_elevation/blue_pill.ico differ diff --git a/code/nel/tools/3d/ig_elevation/main.rc b/code/nel/tools/3d/ig_elevation/main.rc new file mode 100644 index 000000000..fb8391ad1 --- /dev/null +++ b/code/nel/tools/3d/ig_elevation/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL IG Elevation" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "ig_elevation" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/ig_lighter/CMakeLists.txt b/code/nel/tools/3d/ig_lighter/CMakeLists.txt index 54f703566..2f9e05732 100644 --- a/code/nel/tools/3d/ig_lighter/CMakeLists.txt +++ b/code/nel/tools/3d/ig_lighter/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h ../ig_lighter_lib/*.cpp ../ig_lighter_lib/*.h) +FILE(GLOB SRC *.cpp *.h ../ig_lighter_lib/*.cpp ../ig_lighter_lib/*.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(ig_lighter ${SRC}) diff --git a/code/nel/tools/3d/ig_lighter/blue_pill.ico b/code/nel/tools/3d/ig_lighter/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/ig_lighter/blue_pill.ico differ diff --git a/code/nel/tools/3d/ig_lighter/main.rc b/code/nel/tools/3d/ig_lighter/main.rc new file mode 100644 index 000000000..89dcbff5a --- /dev/null +++ b/code/nel/tools/3d/ig_lighter/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL IG Lighter" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "ig_lighter" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt b/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt index 36e5b2aa4..0f2c35074 100644 --- a/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt +++ b/code/nel/tools/3d/lightmap_optimizer/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(lightmap_optimizer ${SRC}) diff --git a/code/nel/tools/3d/lightmap_optimizer/blue_pill.ico b/code/nel/tools/3d/lightmap_optimizer/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/lightmap_optimizer/blue_pill.ico differ diff --git a/code/nel/tools/3d/lightmap_optimizer/main.rc b/code/nel/tools/3d/lightmap_optimizer/main.rc new file mode 100644 index 000000000..eaaaf2b46 --- /dev/null +++ b/code/nel/tools/3d/lightmap_optimizer/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Lightmap Optimizer" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "lightmap_optimizer" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt b/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt index cd2539ee4..a6601f1b0 100644 --- a/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt +++ b/code/nel/tools/3d/ligo/plugin_max/CMakeLists.txt @@ -1,6 +1,8 @@ -FILE(GLOB SRC *.cpp *.h ../../ig_lighter_lib/*.cpp ../../ig_lighter_lib/*.h) +FILE(GLOB SRC *.cpp *.h ../../ig_lighter_lib/*.cpp ../../ig_lighter_lib/*.h *.rc *.rc2 *.def) -ADD_LIBRARY(ligoscape_utility SHARED ligoscape_utility.rc ${SRC} ligoscape_utility.def) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_LIBRARY(ligoscape_utility SHARED ${SRC}) INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) diff --git a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.rc b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.rc index edd4cbb6b..da59ec719 100644 --- a/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.rc +++ b/code/nel/tools/3d/ligo/plugin_max/ligoscape_utility.rc @@ -1,4 +1,4 @@ -//Microsoft Developer Studio generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" @@ -7,19 +7,17 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "windows.h" +#include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) -#endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -27,76 +25,32 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END #endif // APSTUDIO_INVOKED -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,0,0,0 - PRODUCTVERSION 3,0,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileVersion", "3.0.0.0\0" - VALUE "InternalName", "Ligoscape\0" - VALUE "LegalCopyright", "\0" - VALUE "OriginalFilename", "Ligoscape.dlu\0" - VALUE "ProductName", "3D Studio MAX\0" - VALUE "ProductVersion", "3.0.0.0\0" - VALUE "FileDescription", "NeL Ligoscape utility\0" - VALUE "Comments", "TECH: \0" - VALUE "LegalTrademarks", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - ///////////////////////////////////////////////////////////////////////////// // // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN IDS_LIBDESCRIPTION "NeL Ligoscape utility" IDS_CATEGORY "NeL Tools" @@ -105,7 +59,7 @@ BEGIN IDS_SPIN "Spin" END -#endif // English (U.S.) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -115,7 +69,7 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp index a4d41649f..c09158a05 100644 --- a/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp +++ b/code/nel/tools/3d/ligo/plugin_max/max_to_ligo.cpp @@ -134,7 +134,7 @@ bool CMaxToLigo::loadLigoConfigFile (CLigoConfig& config, Interface& it, bool di if (res) { // Path - std::string path = NLMISC::CFile::getPath(MCharStrToUtf8(sModulePath) + "ligoscape.cfg"); + std::string path = NLMISC::CFile::getPath(MCharStrToUtf8(sModulePath)) + "ligoscape.cfg"; try { diff --git a/code/nel/tools/3d/ligo/plugin_max/version.rc2 b/code/nel/tools/3d/ligo/plugin_max/version.rc2 new file mode 100644 index 000000000..56dbaa448 --- /dev/null +++ b/code/nel/tools/3d/ligo/plugin_max/version.rc2 @@ -0,0 +1,55 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" +#include "maxversion.h" +#define STRINGIFY_(x) #x +#define STRINGIFY(x) STRINGIFY_(x) + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "_r" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "NeL is provided under the AGPLv3 with a linking exception for the 3ds Max SDK" + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Ligoscape utility" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT ". Copyright (C) 2000 Nevrax Ltd." + VALUE "OriginalFilename", "nelligoscapeutility" NL_FILEEXT ".dlx" + VALUE "ProductName", "NeL Plugins for 3ds Max " STRINGIFY(MAX_PRODUCT_YEAR_NUMBER) + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/mesh_export/CMakeLists.txt b/code/nel/tools/3d/mesh_export/CMakeLists.txt index 838ce49c2..3a36fa667 100644 --- a/code/nel/tools/3d/mesh_export/CMakeLists.txt +++ b/code/nel/tools/3d/mesh_export/CMakeLists.txt @@ -1,9 +1,10 @@ FILE(GLOB SRCS *.cpp) FILE(GLOB HDRS *.h) +FILE(GLOB RECS *.rc) -SOURCE_GROUP("" FILES ${SRCS} ${HDRS}) +SOURCE_GROUP("" FILES ${SRCS} ${HDRS} ${RECS}) -ADD_EXECUTABLE(mesh_export ${SRCS} ${HDRS}) +ADD_EXECUTABLE(mesh_export ${SRCS} ${HDRS} ${RECS}) TARGET_LINK_LIBRARIES(mesh_export mesh_utils nel3d nelmisc) NL_DEFAULT_PROPS(mesh_export "NeL, Tools, 3D: Mesh Export") diff --git a/code/nel/tools/3d/mesh_export/blue_pill.ico b/code/nel/tools/3d/mesh_export/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/mesh_export/blue_pill.ico differ diff --git a/code/nel/tools/3d/mesh_export/main.rc b/code/nel/tools/3d/mesh_export/main.rc new file mode 100644 index 000000000..b3c77bb67 --- /dev/null +++ b/code/nel/tools/3d/mesh_export/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Mesh Export" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "mesh_export" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/object_viewer/CMakeLists.txt b/code/nel/tools/3d/object_viewer/CMakeLists.txt index 962f0b5bb..4d626f6c9 100644 --- a/code/nel/tools/3d/object_viewer/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer/CMakeLists.txt @@ -1,6 +1,8 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) -ADD_LIBRARY(object_viewer_dll SHARED ${SRC} object_viewer.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_LIBRARY(object_viewer_dll SHARED ${SRC}) TARGET_LINK_LIBRARIES(object_viewer_dll nelmisc diff --git a/code/nel/tools/3d/object_viewer/object_viewer.rc b/code/nel/tools/3d/object_viewer/object_viewer.rc index 3f2b6c65e..3e6353bfd 100644 --- a/code/nel/tools/3d/object_viewer/object_viewer.rc +++ b/code/nel/tools/3d/object_viewer/object_viewer.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -259,19 +259,6 @@ BEGIN "No views were selected ! No snapshot will be taken." END -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - ///////////////////////////////////////////////////////////////////////////// // // Bitmap @@ -2567,58 +2554,14 @@ BEGIN "#include ""res\\object_viewer.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "#include ""l.fra\\afxres.rc"" // Standard components\r\n" "#endif\r\n" + "\r\n" + "#include ""version.rc2""\r\n" "\0" END #endif // APSTUDIO_INVOKED -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,103 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040c04b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "\0" - VALUE "FileDescription", "object_viewer DLL\0" - VALUE "FileVersion", "1, 0, 0, 103\0" - VALUE "InternalName", "object_viewer\0" - VALUE "LegalCopyright", "Copyright (C) 2001\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "object_viewer.DLL\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Bibliothèque de liaison dynamique object_viewer\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x40c, 1200 - END -END - -#endif // !_MAC - - ///////////////////////////////////////////////////////////////////////////// // // Menu @@ -3248,35 +3191,6 @@ BEGIN 0 END - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDR_MAINFRAME "Toto" -END - -STRINGTABLE DISCARDABLE -BEGIN - ID_SHOOT_SCENE "Shoot the scene in a movie" -END - -#endif // French (France) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (Belgium) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRB) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH_BELGIAN -#pragma code_page(1252) -#endif //_WIN32 - ///////////////////////////////////////////////////////////////////////////// // // Dialog @@ -3323,7 +3237,7 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // French (Belgium) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -3347,6 +3261,8 @@ LANGUAGE 12, 1 #include "l.fra\afxres.rc" // Standard components #endif +#include "version.rc2" + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/3d/object_viewer/version.rc2 b/code/nel/tools/3d/object_viewer/version.rc2 new file mode 100644 index 000000000..a4f32756c --- /dev/null +++ b/code/nel/tools/3d/object_viewer/version.rc2 @@ -0,0 +1,51 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "_r" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Object Viewer dynamic library" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "object_viewer" NL_FILEEXT ".dll" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt b/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt index a57a3788a..dd219a319 100644 --- a/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_exe/CMakeLists.txt @@ -1,9 +1,11 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ENABLE_LANGUAGE(RC) ADD_DEFINITIONS(${MFC_DEFINITIONS}) SET(CMAKE_MFC_FLAG 2) -ADD_EXECUTABLE(object_viewer WIN32 ${SRC} object_viewer_exe.rc) +ADD_EXECUTABLE(object_viewer WIN32 ${SRC}) TARGET_LINK_LIBRARIES( object_viewer nelmisc diff --git a/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc b/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc index 54045351c..57bf1d452 100644 --- a/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc +++ b/code/nel/tools/3d/object_viewer_exe/object_viewer_exe.rc @@ -1,4 +1,4 @@ -//Microsoft Developer Studio generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" @@ -7,19 +7,17 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include +#include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) -#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // @@ -28,46 +26,35 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_MAIN_ICON ICON DISCARDABLE "nevraxpill.ico" -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// +IDI_MAIN_ICON ICON "nevraxpill.ico" -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END #endif // APSTUDIO_INVOKED -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -77,7 +64,7 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/3d/object_viewer_exe/resource.h b/code/nel/tools/3d/object_viewer_exe/resource.h index 6cce82541..e82fc81c4 100644 --- a/code/nel/tools/3d/object_viewer_exe/resource.h +++ b/code/nel/tools/3d/object_viewer_exe/resource.h @@ -1,21 +1,5 @@ -// NeL - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// 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 Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - //{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. +// Microsoft Visual C++ generated include file. // Used by object_viewer_exe.rc // #define IDI_ICON1 101 diff --git a/code/nel/tools/3d/object_viewer_exe/version.rc2 b/code/nel/tools/3d/object_viewer_exe/version.rc2 new file mode 100644 index 000000000..ef8efefa5 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_exe/version.rc2 @@ -0,0 +1,51 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Object Viewer" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "object_viewer" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/panoply_maker/CMakeLists.txt b/code/nel/tools/3d/panoply_maker/CMakeLists.txt index 8fd25fef6..c6524a9cc 100644 --- a/code/nel/tools/3d/panoply_maker/CMakeLists.txt +++ b/code/nel/tools/3d/panoply_maker/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(panoply_maker ${SRC}) diff --git a/code/nel/tools/3d/panoply_maker/blue_pill.ico b/code/nel/tools/3d/panoply_maker/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/panoply_maker/blue_pill.ico differ diff --git a/code/nel/tools/3d/panoply_maker/main.rc b/code/nel/tools/3d/panoply_maker/main.rc new file mode 100644 index 000000000..17ec67347 --- /dev/null +++ b/code/nel/tools/3d/panoply_maker/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Panoply Maker" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "panoply_maker" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/panoply_preview/greenpill.ico b/code/nel/tools/3d/panoply_preview/green_pill.ico similarity index 100% rename from code/nel/tools/3d/panoply_preview/greenpill.ico rename to code/nel/tools/3d/panoply_preview/green_pill.ico diff --git a/code/nel/tools/3d/panoply_preview/icon.rc b/code/nel/tools/3d/panoply_preview/icon.rc deleted file mode 100644 index 64e741cac..000000000 --- a/code/nel/tools/3d/panoply_preview/icon.rc +++ /dev/null @@ -1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "greenpill.ico" \ No newline at end of file diff --git a/code/nel/tools/3d/panoply_preview/main.rc b/code/nel/tools/3d/panoply_preview/main.rc new file mode 100644 index 000000000..82afb33ce --- /dev/null +++ b/code/nel/tools/3d/panoply_preview/main.rc @@ -0,0 +1,43 @@ + +#include +#include "config.h" + +IDI_ICON1 ICON DISCARDABLE "green_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Panoply Preview" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "nl_panoply_preview" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt index 9a14d59a6..c903d3a80 100644 --- a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_LIBRARY(nel_3dsmax_shared SHARED ${SRC}) @@ -11,7 +13,7 @@ TARGET_LINK_LIBRARIES(nel_3dsmax_shared ${MAXSDK_LIBRARIES} Version.lib) -NL_DEFAULT_PROPS(nel_3dsmax_shared "MAX Plugin: NeL 3DSMAX Shared") +NL_DEFAULT_PROPS(nel_3dsmax_shared "MAX Plugin: NeL 3ds Max Shared") NL_ADD_RUNTIME_FLAGS(nel_3dsmax_shared) NL_ADD_LIB_SUFFIX(nel_3dsmax_shared) #SET_TARGET_PROPERTIES(nel_export PROPERTIES SUFFIX ".dlx") diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.rc b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.rc new file mode 100644 index 000000000..c02faed7c Binary files /dev/null and b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/nel_3dsmax_shared.rc differ diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/resource.h b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/resource.h new file mode 100644 index 000000000..e36c8f8f2 --- /dev/null +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by nel_3dsmax_shared.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/version.rc2 b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/version.rc2 new file mode 100644 index 000000000..d584d0982 --- /dev/null +++ b/code/nel/tools/3d/plugin_max/nel_3dsmax_shared/version.rc2 @@ -0,0 +1,55 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" +#include "maxversion.h" +#define STRINGIFY_(x) #x +#define STRINGIFY(x) STRINGIFY_(x) + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "_r" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "NeL is provided under the AGPLv3 with a linking exception for the 3ds Max SDK" + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL shared library for 3ds Max" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT ". Copyright (C) 2000 Nevrax Ltd." + VALUE "OriginalFilename", "nel_3dsmax_shared" NL_FILEEXT ".dll" + VALUE "ProductName", "NeL Plugins for 3ds Max " STRINGIFY(MAX_PRODUCT_YEAR_NUMBER) + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp index a44167294..fdedc9a3d 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.cpp @@ -354,7 +354,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP if (RPO::isZone (*pNode, time)) { // Save path - std::string sSavePath = MCharStrToUtf8(pNode->GetName()); + std::string sSavePath = NLMISC::toLower(MCharStrToUtf8(pNode->GetName())); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) @@ -372,7 +372,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP else if (CExportNel::isVegetable (*pNode, time)) { // Save path - std::string sSavePath = MCharStrToUtf8(pNode->GetName()); + std::string sSavePath = NLMISC::toLower(MCharStrToUtf8(pNode->GetName())); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) @@ -391,7 +391,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP else if (CExportNel::isLodCharacter (*pNode, time)) { // Save path - std::string sSavePath = MCharStrToUtf8(pNode->GetName()); + std::string sSavePath = NLMISC::toLower(MCharStrToUtf8(pNode->GetName())); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) @@ -410,7 +410,7 @@ static INT_PTR CALLBACK CNelExportDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP else if (CExportNel::isMesh (*pNode, time)) { // Save path - std::string sSavePath = MCharStrToUtf8(pNode->GetName()); + std::string sSavePath = NLMISC::toLower(MCharStrToUtf8(pNode->GetName())); // Choose a file to export if (!CExportNel::getScriptAppData (pNode, NEL3D_APPDATA_DONTEXPORT, 0)) diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export.rc b/code/nel/tools/3d/plugin_max/nel_export/nel_export.rc index 6118893ec..57c213c2a 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export.rc +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -452,51 +452,13 @@ END 3 TEXTINCLUDE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END #endif // APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0, 12, 0, 0 - PRODUCTVERSION 0, 12, 0, 0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample" - VALUE "CompanyName", "Ryzom Core" - VALUE "FileVersion", "0.12.0\0" - VALUE "InternalName", "CNelExport" - VALUE "OriginalFilename", "CNelExport.dlu" - VALUE "ProductName", "Ryzom Core" - VALUE "ProductVersion", "0.12.0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - ///////////////////////////////////////////////////////////////////////////// // // String Table @@ -511,19 +473,6 @@ BEGIN IDS_SPIN "Spin" END -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - ///////////////////////////////////////////////////////////////////////////// // // Dialog @@ -716,7 +665,7 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -726,7 +675,7 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/3d/plugin_max/nel_export/version.rc2 b/code/nel/tools/3d/plugin_max/nel_export/version.rc2 new file mode 100644 index 000000000..4941b417b --- /dev/null +++ b/code/nel/tools/3d/plugin_max/nel_export/version.rc2 @@ -0,0 +1,55 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" +#include "maxversion.h" +#define STRINGIFY_(x) #x +#define STRINGIFY(x) STRINGIFY_(x) + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "_r" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "NeL is provided under the AGPLv3 with a linking exception for the 3ds Max SDK. Based on Kinetix 3D Studio Max 3.0 plugin sample" + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Export" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT ". Copyright (C) 2000 Nevrax Ltd." + VALUE "OriginalFilename", "nelexport" NL_FILEEXT ".dlm" + VALUE "ProductName", "NeL Plugins for 3ds Max " STRINGIFY(MAX_PRODUCT_YEAR_NUMBER) + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt index 178e70f5d..af0652bfc 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/CMakeLists.txt @@ -1,6 +1,8 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc *.rc2) -ADD_LIBRARY(nel_patch_converter SHARED ${SRC} nel_patch_converter.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_LIBRARY(nel_patch_converter SHARED ${SRC}) INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_patch_converter diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.rc b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.rc index 50fc5a48d..70084bfdc 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.rc +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/nel_patch_converter.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -72,52 +72,13 @@ END 3 TEXTINCLUDE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END #endif // APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0, 12, 0, 0 - PRODUCTVERSION 0, 12, 0, 0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "http://www.ryzomcore.org/" - VALUE "FileDescription", "PatchMesh to RykolPatchMesh" - VALUE "FileVersion", "0.12.0" - VALUE "InternalName", "PatchMesh to RykolPatchMesh" - VALUE "LegalCopyright", "Copyright, 2000 Nevrax Ltd." - VALUE "OriginalFilename", "nel_convert_patch.dlm" - VALUE "ProductName", "NeL Patch Converter" - VALUE "ProductVersion", "0.12.0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - ///////////////////////////////////////////////////////////////////////////// // // String Table @@ -132,7 +93,7 @@ BEGIN IDS_SPIN "Spin" END -#endif // English (U.S.) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -142,7 +103,7 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/3d/plugin_max/nel_patch_converter/version.rc2 b/code/nel/tools/3d/plugin_max/nel_patch_converter/version.rc2 new file mode 100644 index 000000000..57004f301 --- /dev/null +++ b/code/nel/tools/3d/plugin_max/nel_patch_converter/version.rc2 @@ -0,0 +1,55 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" +#include "maxversion.h" +#define STRINGIFY_(x) #x +#define STRINGIFY(x) STRINGIFY_(x) + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "_r" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "NeL is provided under the AGPLv3 with a linking exception for the 3ds Max SDK" + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Patch Converter: PatchMesh to RykolPatchMesh" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT ". Copyright (C) 2000 Nevrax Ltd." + VALUE "OriginalFilename", "nelconvertpatch" NL_FILEEXT ".dlm" + VALUE "ProductName", "NeL Plugins for 3ds Max " STRINGIFY(MAX_PRODUCT_YEAR_NUMBER) + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt index bc2f81f33..a1b3e8b65 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/CMakeLists.txt @@ -1,6 +1,8 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc *.rc2) -ADD_LIBRARY(nel_patch_edit SHARED ${SRC} mods.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_LIBRARY(nel_patch_edit SHARED ${SRC}) INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_patch_edit diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/mods.rc b/code/nel/tools/3d/plugin_max/nel_patch_edit/mods.rc index c687fdd49..41906d3d4 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_edit/mods.rc +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/mods.rc @@ -16,11 +16,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -361,7 +361,7 @@ END 3 TEXTINCLUDE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END @@ -508,47 +508,6 @@ END #endif // APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0, 12, 0, 0 - PRODUCTVERSION 0, 12, 0, 0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0" - VALUE "CompanyName", "Ryzom Core" - VALUE "FileDescription", "NeL Patch Edit" - VALUE "FileVersion", "0.12.0" - VALUE "InternalName", "neleditpatch" - VALUE "LegalCopyright", "Copyright © 2000 Nevrax Ltd. Copyright © 1998 Autodesk Inc." - VALUE "LegalTrademarks", "The following are registered trademarks of Autodesk, Inc.: 3D Studio MAX. The following are trademarks of Autodesk, Inc.: Kinetix, Kinetix(logo), BIPED, Physique, Character Studio, MAX DWG, DWG Unplugged, Heidi, FLI, FLC, DXF." - VALUE "OriginalFilename", "neleditpatch.dlm" - VALUE "ProductName", "Ryzom Core" - VALUE "ProductVersion", "0.12.0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - ///////////////////////////////////////////////////////////////////////////// // // Icon @@ -1277,19 +1236,6 @@ BEGIN IDS_PW_INSTANCEERROR "Error UVW Unwrap cannot be instanced please make it unique" END -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - ///////////////////////////////////////////////////////////////////////////// // // Cursor @@ -1298,7 +1244,7 @@ LANGUAGE LANG_FRENCH, SUBLANG_FRENCH IDC_PICK_COLOR CURSOR "pick_color.cur" IDC_FILL CURSOR "cursor1.cur" IDC_TRICK CURSOR "cur00001.cur" -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -1308,7 +1254,7 @@ IDC_TRICK CURSOR "cur00001.cur" // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/3d/plugin_max/nel_patch_edit/version.rc2 b/code/nel/tools/3d/plugin_max/nel_patch_edit/version.rc2 new file mode 100644 index 000000000..92d5dada7 --- /dev/null +++ b/code/nel/tools/3d/plugin_max/nel_patch_edit/version.rc2 @@ -0,0 +1,55 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" +#include "maxversion.h" +#define STRINGIFY_(x) #x +#define STRINGIFY(x) STRINGIFY_(x) + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "_r" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "NeL is provided under the AGPLv3 with a linking exception for the 3ds Max SDK. Based on Kinetix 3D Studio Max 3.0 plugin sample" + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Patch Edit" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT ". Copyright (C) 2000 Nevrax Ltd. Copyright (C) 1998 Autodesk Inc." + VALUE "OriginalFilename", "neleditpatch" NL_FILEEXT ".dlm" + VALUE "ProductName", "NeL Plugins for 3ds Max " STRINGIFY(MAX_PRODUCT_YEAR_NUMBER) + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt index 388e8b8ef..f7eb99b59 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/CMakeLists.txt @@ -1,8 +1,10 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc *.rc2) -LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/nel_paint.cpp) +LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/nel_paint.cpp) -ADD_LIBRARY(nel_patch_paint SHARED ${SRC} nel_patch_paint.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_LIBRARY(nel_patch_paint SHARED ${SRC}) INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.rc b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.rc index 0093248c4..3552f59bf 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.rc +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/nel_patch_paint.rc @@ -20,7 +20,7 @@ #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -63,7 +63,7 @@ END 3 TEXTINCLUDE DISCARDABLE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END @@ -89,65 +89,6 @@ END #endif // APSTUDIO_INVOKED -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0, 12, 0, 0 - PRODUCTVERSION 0, 12, 0, 0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0" - VALUE "Comments", "TECH: cyril.corvazier\0" - VALUE "CompanyName", "Ryzom Core\0" - VALUE "FileDescription", "NeL Patch Paint\0" - VALUE "FileVersion", "0.12.0\0" - VALUE "InternalName", "mods\0" - VALUE "LegalCopyright", "Copyright © 2000 Nevrax Ltd\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "nelpatchpaint.dlm\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Ryzom Core\0" - VALUE "ProductVersion", "0.12.0\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - ///////////////////////////////////////////////////////////////////////////// // // Cursor @@ -157,7 +98,7 @@ IDC_PICK_COLOR CURSOR DISCARDABLE "pick_color.cur" IDC_FILL CURSOR DISCARDABLE "cursor1.cur" IDC_TRICK CURSOR DISCARDABLE "cur00001.cur" IDC_INSPECT CURSOR DISCARDABLE "pick_col.cur" -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -167,7 +108,7 @@ IDC_INSPECT CURSOR DISCARDABLE "pick_col.cur" // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp index 8f3912b0e..5c5bd82f8 100644 --- a/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/paint.cpp @@ -4063,7 +4063,7 @@ bool loadLigoConfigFile (CLigoConfig& config, Interface& it) if (res) { // Path - std::string modulePath = NLMISC::CFile::getPath(MCharStrToUtf8(sModulePath)); + std::string modulePath = NLMISC::CFile::getPath(MCharStrToUtf8(sModulePath)) + "ligoscape.cfg"; try { diff --git a/code/nel/tools/3d/plugin_max/nel_patch_paint/version.rc2 b/code/nel/tools/3d/plugin_max/nel_patch_paint/version.rc2 new file mode 100644 index 000000000..080d0e24c --- /dev/null +++ b/code/nel/tools/3d/plugin_max/nel_patch_paint/version.rc2 @@ -0,0 +1,55 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" +#include "maxversion.h" +#define STRINGIFY_(x) #x +#define STRINGIFY(x) STRINGIFY_(x) + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "_r" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "NeL is provided under the AGPLv3 with a linking exception for the 3ds Max SDK. Based on Kinetix 3D Studio Max 3.0 plugin sample" + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Patch Paint" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT ". Copyright (C) 2000 Nevrax Ltd." + VALUE "OriginalFilename", "nelpaintpatch" NL_FILEEXT ".dlm" + VALUE "ProductName", "NeL Plugins for 3ds Max " STRINGIFY(MAX_PRODUCT_YEAR_NUMBER) + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt index dc5b6a284..6c7182f2b 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/CMakeLists.txt @@ -1,6 +1,8 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc *.rc2) -ADD_LIBRARY(nel_vertex_tree_paint SHARED ${SRC} vertex_tree_paint.def vertex_tree_paint.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_LIBRARY(nel_vertex_tree_paint SHARED ${SRC}) INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/version.rc2 b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/version.rc2 new file mode 100644 index 000000000..669cb1c15 --- /dev/null +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/version.rc2 @@ -0,0 +1,55 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" +#include "maxversion.h" +#define STRINGIFY_(x) #x +#define STRINGIFY(x) STRINGIFY_(x) + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "_r" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "NeL is provided under the AGPLv3 with a linking exception for the 3ds Max SDK. Based on Kinetix 3D Studio Max 3.1 plugin sample" + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Vertex Tree Paint" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT ". Copyright (C) 2000 Nevrax Ltd. Copyright (C) 1998 Autodesk Inc." + VALUE "OriginalFilename", "nel_vertex_tree_paint" NL_FILEEXT ".dlm" + VALUE "ProductName", "NeL Plugins for 3ds Max " STRINGIFY(MAX_PRODUCT_YEAR_NUMBER) + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.rc b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.rc index fdf00449c..7d4652acc 100644 --- a/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.rc +++ b/code/nel/tools/3d/plugin_max/nel_vertex_tree_paint/vertex_tree_paint.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -103,7 +103,7 @@ END 3 TEXTINCLUDE DISCARDABLE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END @@ -118,50 +118,6 @@ END IDC_PAINTCURSOR CURSOR DISCARDABLE "paintcur.cur" IDC_DROPPER_CURSOR CURSOR DISCARDABLE "dropcurs.cur" -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0, 12, 0, 0 - PRODUCTVERSION 0, 12, 0, 0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Based on Kinetix 3D Studio Max 3.1 plugin sample\0" - VALUE "Comments", "TECH: \0" - VALUE "CompanyName", "Ryzom Core\0" - VALUE "FileDescription", "Vertex Tree Paint\0" - VALUE "FileVersion", "0.12.0\0" - VALUE "InternalName", "VertexTreePaint\0" - VALUE "LegalCopyright", "Copyright © 2000 Nevrax Ltd. Copyright © 1998 Autodesk Inc.\0" - VALUE "LegalTrademarks", "The following are registered trademarks of Autodesk, Inc.: 3D Studio MAX. The following are trademarks of Autodesk, Inc.: Kinetix, Kinetix(logo), BIPED, Physique, Character Studio, MAX DWG, DWG Unplugged, Heidi, FLI, FLC, DXF.\0" - VALUE "OriginalFilename", "nel_vertex_tree_paint.dlm\0" - VALUE "ProductName", "Ryzom Core\0" - VALUE "ProductVersion", "0.12.0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - ///////////////////////////////////////////////////////////////////////////// // @@ -207,7 +163,7 @@ BEGIN IDS_RESTORE_GRADIENT "Vertex Tree Gradient" END -#endif // English (U.S.) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -217,7 +173,7 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt b/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt index 1ea546e38..d18a89f50 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt +++ b/code/nel/tools/3d/plugin_max/tile_utility/CMakeLists.txt @@ -1,6 +1,8 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc *.rc2) -ADD_LIBRARY(tile_utility SHARED ${SRC} tile_utility.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_LIBRARY(tile_utility SHARED ${SRC}) INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(tile_utility diff --git a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.rc b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.rc index cec8df28b..2b30b3c3e 100644 --- a/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.rc +++ b/code/nel/tools/3d/plugin_max/tile_utility/tile_utility.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -110,58 +110,13 @@ END 3 TEXTINCLUDE DISCARDABLE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END #endif // APSTUDIO_INVOKED -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0, 12, 0, 0 - PRODUCTVERSION 0, 12, 0, 0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0" - VALUE "CompanyName", "Ryzom Core\0" - VALUE "FileVersion", "0.12.0\0" - VALUE "InternalName", "Tile_utility\0" - VALUE "LegalCopyright", "\0" - VALUE "OriginalFilename", "Tile_utility.dlu\0" - VALUE "ProductName", "Ryzom Core\0" - VALUE "ProductVersion", "0.12.0\0" - VALUE "FileDescription", "Create material for tiles\0" - VALUE "Comments", "TECH: \0" - VALUE "LegalTrademarks", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - ///////////////////////////////////////////////////////////////////////////// // // String Table @@ -704,7 +659,7 @@ BEGIN 65509 "Amount" END -#endif // English (U.S.) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -714,7 +669,7 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/3d/plugin_max/tile_utility/version.rc2 b/code/nel/tools/3d/plugin_max/tile_utility/version.rc2 new file mode 100644 index 000000000..2c4d7869a --- /dev/null +++ b/code/nel/tools/3d/plugin_max/tile_utility/version.rc2 @@ -0,0 +1,55 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" +#include "maxversion.h" +#define STRINGIFY_(x) #x +#define STRINGIFY(x) STRINGIFY_(x) + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "_r" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "NeL is provided under the AGPLv3 with a linking exception for the 3ds Max SDK. Based on Kinetix 3D Studio Max 3.0 plugin sample" + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Tile Utility: Create material for tiles" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT ". Copyright (C) 2000 Nevrax Ltd." + VALUE "OriginalFilename", "neltileutility" NL_FILEEXT ".dlu" + VALUE "ProductName", "NeL Plugins for 3ds Max " STRINGIFY(MAX_PRODUCT_YEAR_NUMBER) + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/shapes_exporter/CMakeLists.txt b/code/nel/tools/3d/shapes_exporter/CMakeLists.txt index 1df5eafa0..41fea6ade 100644 --- a/code/nel/tools/3d/shapes_exporter/CMakeLists.txt +++ b/code/nel/tools/3d/shapes_exporter/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(shapes_exporter WIN32 ${SRC}) diff --git a/code/nel/tools/3d/shapes_exporter/gold_pill.ico b/code/nel/tools/3d/shapes_exporter/gold_pill.ico new file mode 100644 index 000000000..618b67a5d Binary files /dev/null and b/code/nel/tools/3d/shapes_exporter/gold_pill.ico differ diff --git a/code/nel/tools/3d/shapes_exporter/main.rc b/code/nel/tools/3d/shapes_exporter/main.rc new file mode 100644 index 000000000..5105532ff --- /dev/null +++ b/code/nel/tools/3d/shapes_exporter/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "gold_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Shapes Exporter" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "shapes_exporter" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/tga_2_dds/CMakeLists.txt b/code/nel/tools/3d/tga_2_dds/CMakeLists.txt index 10620af5b..0b59f702c 100644 --- a/code/nel/tools/3d/tga_2_dds/CMakeLists.txt +++ b/code/nel/tools/3d/tga_2_dds/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(tga2dds ${SRC}) diff --git a/code/nel/tools/3d/tga_2_dds/blue_pill.ico b/code/nel/tools/3d/tga_2_dds/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/tga_2_dds/blue_pill.ico differ diff --git a/code/nel/tools/3d/tga_2_dds/main.rc b/code/nel/tools/3d/tga_2_dds/main.rc new file mode 100644 index 000000000..09b6f9b06 --- /dev/null +++ b/code/nel/tools/3d/tga_2_dds/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL TGA to DDS" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "tga2dds" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/tga_cut/CMakeLists.txt b/code/nel/tools/3d/tga_cut/CMakeLists.txt index 6d0147328..d7fc886c4 100644 --- a/code/nel/tools/3d/tga_cut/CMakeLists.txt +++ b/code/nel/tools/3d/tga_cut/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(tga_cut ${SRC}) diff --git a/code/nel/tools/3d/tga_cut/blue_pill.ico b/code/nel/tools/3d/tga_cut/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/tga_cut/blue_pill.ico differ diff --git a/code/nel/tools/3d/tga_cut/main.rc b/code/nel/tools/3d/tga_cut/main.rc new file mode 100644 index 000000000..706d0c58d --- /dev/null +++ b/code/nel/tools/3d/tga_cut/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL TGA Cut" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "tga_cut" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/tile_edit/CMakeLists.txt b/code/nel/tools/3d/tile_edit/CMakeLists.txt index bd29fea37..abbd53b68 100644 --- a/code/nel/tools/3d/tile_edit/CMakeLists.txt +++ b/code/nel/tools/3d/tile_edit/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) FILE(GLOB SRC2 cpu.cpp DllEntry.cpp Popup.* thread_win32.* TileCtrl.* TileList.* TileView.*) LIST(REMOVE_ITEM SRC ${SRC2}) diff --git a/code/nel/tools/3d/tile_edit/tile_edit_exe.rc b/code/nel/tools/3d/tile_edit/tile_edit_exe.rc index 22752b814..e88096ff5 100644 --- a/code/nel/tools/3d/tile_edit/tile_edit_exe.rc +++ b/code/nel/tools/3d/tile_edit/tile_edit_exe.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -91,50 +91,13 @@ END 3 TEXTINCLUDE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END #endif // APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,6,0,0 - PRODUCTVERSION 0,6,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileVersion", "0.6.0.0" - VALUE "InternalName", "tile_edit_exe" - VALUE "OriginalFilename", "tile_edit.exe" - VALUE "ProductName", "NeL Tilebank Editor" - VALUE "ProductVersion", "0.6.0.0" - VALUE "Comments", "http://www.opennel.org/" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - ///////////////////////////////////////////////////////////////////////////// // // Icon @@ -156,19 +119,6 @@ BEGIN IDS_SPIN "Spin" END -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - ///////////////////////////////////////////////////////////////////////////// // // Dialog @@ -412,7 +362,7 @@ IDB_BITMAP2 BITMAP "rot0.bmp" IDB_BITMAP3 BITMAP "rot1.bmp" IDB_BITMAP4 BITMAP "rot2.bmp" IDB_BITMAP5 BITMAP "rot3.bmp" -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -422,7 +372,7 @@ IDB_BITMAP5 BITMAP "rot3.bmp" // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/3d/tile_edit/version.rc2 b/code/nel/tools/3d/tile_edit/version.rc2 new file mode 100644 index 000000000..07f790b1b --- /dev/null +++ b/code/nel/tools/3d/tile_edit/version.rc2 @@ -0,0 +1,51 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Tilebank Editor" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "tile_edit" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/3d/unbuild_interface/CMakeLists.txt b/code/nel/tools/3d/unbuild_interface/CMakeLists.txt index 2a10976d3..8befed3f4 100644 --- a/code/nel/tools/3d/unbuild_interface/CMakeLists.txt +++ b/code/nel/tools/3d/unbuild_interface/CMakeLists.txt @@ -1,11 +1,11 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(unbuild_interface ${SRC}) TARGET_LINK_LIBRARIES(unbuild_interface nelmisc) -NL_DEFAULT_PROPS(unbuild_interface "NeL, Tools, 3D: unbuild_interface") +NL_DEFAULT_PROPS(unbuild_interface "NeL, Tools, 3D: Unbuild Interface") NL_ADD_RUNTIME_FLAGS(unbuild_interface) INSTALL(TARGETS unbuild_interface RUNTIME DESTINATION bin COMPONENT tools3d) diff --git a/code/nel/tools/3d/unbuild_interface/gold_pill.ico b/code/nel/tools/3d/unbuild_interface/gold_pill.ico new file mode 100644 index 000000000..618b67a5d Binary files /dev/null and b/code/nel/tools/3d/unbuild_interface/gold_pill.ico differ diff --git a/code/nel/tools/3d/unbuild_interface/main.rc b/code/nel/tools/3d/unbuild_interface/main.rc new file mode 100644 index 000000000..bd99b4305 --- /dev/null +++ b/code/nel/tools/3d/unbuild_interface/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "gold_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Unbuild Interface" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "unbuild_interface" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/zone_dependencies/CMakeLists.txt b/code/nel/tools/3d/zone_dependencies/CMakeLists.txt index 9efb49f0e..f638f026d 100644 --- a/code/nel/tools/3d/zone_dependencies/CMakeLists.txt +++ b/code/nel/tools/3d/zone_dependencies/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h ../zone_lib/*.cpp ../zone_lib/*.h) +FILE(GLOB SRC *.cpp *.h ../zone_lib/*.cpp ../zone_lib/*.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(zone_dependencies ${SRC}) diff --git a/code/nel/tools/3d/zone_dependencies/blue_pill.ico b/code/nel/tools/3d/zone_dependencies/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/zone_dependencies/blue_pill.ico differ diff --git a/code/nel/tools/3d/zone_dependencies/main.rc b/code/nel/tools/3d/zone_dependencies/main.rc new file mode 100644 index 000000000..ef1fef676 --- /dev/null +++ b/code/nel/tools/3d/zone_dependencies/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Zone Dependencies" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "zone_dependencies" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt b/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt index 30f84cea8..21b332612 100644 --- a/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt +++ b/code/nel/tools/3d/zone_ig_lighter/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h ../zone_lib/*.cpp ../zone_lib/*.h) +FILE(GLOB SRC *.cpp *.h ../zone_lib/*.cpp ../zone_lib/*.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(zone_ig_lighter ${SRC}) diff --git a/code/nel/tools/3d/zone_ig_lighter/blue_pill.ico b/code/nel/tools/3d/zone_ig_lighter/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/zone_ig_lighter/blue_pill.ico differ diff --git a/code/nel/tools/3d/zone_ig_lighter/main.rc b/code/nel/tools/3d/zone_ig_lighter/main.rc new file mode 100644 index 000000000..1362a93c4 --- /dev/null +++ b/code/nel/tools/3d/zone_ig_lighter/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Zone IG Lighter" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "zone_ig_lighter" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/zone_lighter/CMakeLists.txt b/code/nel/tools/3d/zone_lighter/CMakeLists.txt index e0c15f9e8..2fe58d3a2 100644 --- a/code/nel/tools/3d/zone_lighter/CMakeLists.txt +++ b/code/nel/tools/3d/zone_lighter/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h ../zone_lib/*.cpp ../zone_lib/*.h) +FILE(GLOB SRC *.cpp *.h ../zone_lib/*.cpp ../zone_lib/*.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(zone_lighter ${SRC}) diff --git a/code/nel/tools/3d/zone_lighter/blue_pill.ico b/code/nel/tools/3d/zone_lighter/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/zone_lighter/blue_pill.ico differ diff --git a/code/nel/tools/3d/zone_lighter/main.rc b/code/nel/tools/3d/zone_lighter/main.rc new file mode 100644 index 000000000..6aa90827d --- /dev/null +++ b/code/nel/tools/3d/zone_lighter/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Zone Lighter" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "zone_lighter" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/3d/zone_welder/CMakeLists.txt b/code/nel/tools/3d/zone_welder/CMakeLists.txt index 396d22f58..a236627a0 100644 --- a/code/nel/tools/3d/zone_welder/CMakeLists.txt +++ b/code/nel/tools/3d/zone_welder/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h ../zone_lib/*.cpp ../zone_lib/*.h) +FILE(GLOB SRC *.cpp *.h ../zone_lib/*.cpp ../zone_lib/*.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(zone_welder ${SRC}) diff --git a/code/nel/tools/3d/zone_welder/blue_pill.ico b/code/nel/tools/3d/zone_welder/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/3d/zone_welder/blue_pill.ico differ diff --git a/code/nel/tools/3d/zone_welder/main.rc b/code/nel/tools/3d/zone_welder/main.rc new file mode 100644 index 000000000..04e93ac2c --- /dev/null +++ b/code/nel/tools/3d/zone_welder/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Zone Welder" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "zone_welder" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms index a3b28bc02..590dcab75 100755 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms @@ -26,6 +26,26 @@ NEL3D_APPDATA_COLLISION = 1423062613 NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 NEL3D_APPDATA_AUTOMATIC_ANIMATION = 1423062617 +-- Lower case +fn lowercase instring = +( + local upper, lower, outstring + upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + lower="abcdefghijklmnopqrstuvwxyz" + + outstring = copy instring + + for iii = 1 to outstring.count do + ( + jjj = findString upper outstring[iii] + if (jjj != undefined) then + outstring[iii] = lower[jjj] + else + outstring[iii] = instring[iii] + ) + return outstring -- value of outstring will be returned as function result +) + -- This node is n accelerator ? fn isAccelerator node = ( @@ -287,9 +307,9 @@ fn runNelMaxExportSub inputMaxFile retryCount = ( -- Output directory if (haveCoarseMesh node) == true then - output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape") + output = ("%OutputDirectoryWithCoarseMesh%/" + lowercase(node.name) + ".shape") else - output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape") + output = ("%OutputDirectoryWithoutCoarseMesh%/" + lowercase(node.name) + ".shape") -- Compare file date if (NeLTestFileDate output inputMaxFile) == true then diff --git a/code/nel/tools/build_gamedata/processes/ligo/1_export.py b/code/nel/tools/build_gamedata/processes/ligo/1_export.py index 09be53494..e0f9bab77 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/1_export.py +++ b/code/nel/tools/build_gamedata/processes/ligo/1_export.py @@ -29,7 +29,9 @@ sys.path.append("../../configuration") if os.path.isfile("log.log"): os.remove("log.log") -log = open("log.log", "w") +if os.path.isfile("temp_log.log"): + os.remove("temp_log.log") +log = open("temp_log.log", "w") from scripts import * from buildsite import * from process import * @@ -61,8 +63,9 @@ if LigoExportLand == "" or LigoExportOnePass == 1: mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemZoneLigoExportDirectory) mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemCmbExportDirectory) mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) - mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory) - if (needUpdateDirByTagLogFiltered(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory, ".max.tag", [ "zonematerial", "zonetransition", "zonespecial" ])): + tagDirectory = ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory + mkPath(log, tagDirectory) + if (needUpdateDirByTagLogFiltered(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", tagDirectory, ".max.tag", [ "zonematerial", "zonetransition", "zonespecial" ])): printLog(log, "WRITE " + ligoIniPath) ligoIni = open(ligoIniPath, "w") ligoIni.write("[LigoConfig]\n") @@ -71,34 +74,77 @@ if LigoExportLand == "" or LigoExportOnePass == 1: ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory[0] + "/\n") ligoIni.close() - outDirTag = ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory - logFile = ScriptDirectory + "/processes/ligo/log.log" + outputLogfile = ScriptDirectory + "/processes/ligo/log.log" smallBank = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank" + maxRunningTagFile = tagDirectory + "/max_running.tag" scriptSrc = "maxscript/nel_ligo_export.ms" scriptDst = MaxUserDirectory + "/scripts/nel_ligo_export.ms" + tagList = findFiles(log, tagDirectory, "", ".max.tag") + tagLen = len(tagList) + if os.path.isfile(scriptDst): os.remove(scriptDst) + tagDiff = 1 printLog(log, "WRITE " + scriptDst) sSrc = open(scriptSrc, "r") sDst = open(scriptDst, "w") for line in sSrc: - newline = line.replace("output_logfile", logFile) - newline = newline.replace("output_directory_tag", outDirTag) - newline = newline.replace("bankFilename", smallBank) + newline = line.replace("%OutputLogfile%", outputLogfile) + newline = newline.replace("%TagDirectory%", tagDirectory) + newline = newline.replace("%SmallBankFilename%", smallBank) sDst.write(newline) sSrc.close() sDst.close() - printLog(log, "MAXSCRIPT " + scriptDst) - subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-mip" ]) + zeroRetryLimit = 3 + while tagDiff > 0: + mrt = open(maxRunningTagFile, "w") + mrt.write("moe-moe-kyun") + mrt.close() + printLog(log, "MAXSCRIPT " + scriptDst) + subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-mip" ]) + if os.path.exists(outputLogfile): + try: + lSrc = open(outputLogfile, "r") + for line in lSrc: + lineStrip = line.strip() + if (len(lineStrip) > 0): + printLog(log, lineStrip) + lSrc.close() + os.remove(outputLogfile) + except Exception: + printLog(log, "ERROR Failed to read 3dsmax log") + else: + printLog(log, "WARNING No 3dsmax log") + tagList = findFiles(log, tagDirectory, "", ".max.tag") + newTagLen = len(tagList) + tagDiff = newTagLen - tagLen + tagLen = newTagLen + addTagDiff = 0 + if os.path.exists(maxRunningTagFile): + printLog(log, "FAIL 3ds Max crashed and/or file export failed!") + if tagDiff == 0: + if zeroRetryLimit > 0: + zeroRetryLimit = zeroRetryLimit - 1 + addTagDiff = 1 + else: + printLog(log, "FAIL Retry limit reached!") + else: + addTagDiff = 1 + os.remove(maxRunningTagFile) + printLog(log, "Exported " + str(tagDiff) + " .max files!") + tagDiff += addTagDiff os.remove(scriptDst) printLog(log, "") log.close() +if os.path.isfile("log.log"): + os.remove("log.log") +shutil.move("temp_log.log", "log.log") # end of file diff --git a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms index 07d032809..90f8b1b26 100755 --- a/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms +++ b/code/nel/tools/build_gamedata/processes/ligo/maxscript/nel_ligo_export.ms @@ -16,6 +16,7 @@ TransitionNumBis = #( 5, 4, 2, 3, 7, 6, 0, 1, 8) NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group tagThisFile = true +removeRunningTag = true -- Unhide layers fn unhidelayers = @@ -83,9 +84,12 @@ fn lowercase instring = ) -- Allocate 20 Me for the script -heapSize += 15000000 +heapSize += 30000000 -nlErrorFilename = "output_logfile" +-- In case of error just abort the app and don't show nel report window +NelForceQuitOnMsgDisplayer() + +nlErrorFilename = "%OutputLogfile%" nlErrorStream = openFile nlErrorFilename mode:"a" if nlErrorStream == undefined then nlErrorStream = createFile nlErrorFilename @@ -233,16 +237,19 @@ fn isToBeExportedCollision node = return false ) --- Export collisions from the current loaded zone -fn exportCollisionsFromZone outputNelDir filename = +fn selectCollisionsForExport = ( -- Select all collision mesh max select none clearSelection() + anySelected = false; for m in geometry do ( if (isToBeExportedCollision m) == true then + ( selectmore m + anySelected = true + ) ) for node in objects where classOf node == XRefObject do ( @@ -250,10 +257,18 @@ fn exportCollisionsFromZone outputNelDir filename = if (superclassOf sourceObject == GeometryClass) then ( if (isToBeExportedCollision node) == true then + ( selectmore node + anySelected = true + ) ) ) - + return anySelected +) + +-- Export collisions from the current loaded zone +fn exportCollisionsFromZone outputNelDir filename = +( -- Export the collision if (NelExportCollision ($selection as array) outputNelDir) == false then ( @@ -384,8 +399,8 @@ fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSi output = (outputPath + ig_array[ig] + ".ig") -- Check date - if (NeLTestFileDate output inputFile) == true then - ( + -- if (NeLTestFileDate output inputFile) == true then + -- ( -- Select none max select none clearSelection() @@ -456,12 +471,12 @@ fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSi nlerror ("ERROR fatal error exporting ig "+ig_array[ig]+" in file "+inputFile) tagThisFile = false ) - ) - else - ( - nlerror ("SKIPPED ligo ig "+output) - tagThisFile = false - ) + -- ) + -- else + -- ( + -- nlerror ("SKIPPED ligo ig "+output) + -- tagThisFile = false + -- ) ) ) ) @@ -484,7 +499,7 @@ MaxFilesList = getFiles (ligo_root_path + "*.max") try ( -- Set the bank pathname - bank_filename = "bankFilename" + bank_filename = "%SmallBankFilename%" NelSetTileBank bank_filename cellSize = NeLLigoGetCellSize () @@ -500,7 +515,7 @@ try if (tokenArray.count == 3) and (tokenArray[1] == "zonematerial") then ( -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + tag = ("%TagDirectory%/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") -- Compare date with the tag file if (NeLTestFileDate tag curFileName) == true then @@ -511,8 +526,17 @@ try resetMAXFile #noprompt nlerror ("Scanning file "+curFileName+" ...") - mergeMaxFile curFileName quiet:true - objXRefMgr.UpdateAllRecords() + loadMaxFile curFileName quiet:true + try + ( + nlerror("Update XRef records...") + objXRefMgr.UpdateAllRecords() + ) + catch + ( + nlerror("ERROR Failed to update XRef! (DON'T TAG)...") + tagThisFile = false + ) -- Unhide category unhidelayers() @@ -580,25 +604,32 @@ try ) -- export collisions - try + if selectCollisionsForExport() then ( - nlerror("exportCollisionsFromZone " + curFileName) - exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName - ) - catch - ( - nlerror("couldn't export collision for " + curFileName) - tagThisFile = false + try + ( + nlerror("exportCollisionsFromZone " + curFileName) + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + nlerror("past exportCollisionsFromZone") + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) ) -- Write a tag file + nlerror("check to write tag") if tagThisFile == true then ( - nlerror("tagThisFile " + curFileName) + nlerror("TAG " + curFileName) + nlerror("TAGFILE " + tag) tagFile = createFile tag if tagFile == undefined then ( nlerror ("WARNING can't create tag file "+tag) + removeRunningTag = false ) else ( @@ -606,6 +637,11 @@ try close tagFile ) ) + else + ( + nlerror("NOT TAGGING " + curFileName) + removeRunningTag = false + ) resetMAXFile #noprompt gc () @@ -648,7 +684,7 @@ try ) -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + tag = ("%TagDirectory%/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") -- Compare date with the tag file if (NeLTestFileDate tag curFileName) == true then @@ -659,8 +695,17 @@ try resetMAXFile #noprompt nlerror ("Scanning file "+curFileName+" ...") - mergeMaxFile curFileName quiet:true - objXRefMgr.UpdateAllRecords() + loadMaxFile curFileName quiet:true + try + ( + nlerror("Update XRef records...") + objXRefMgr.UpdateAllRecords() + ) + catch + ( + nlerror("ERROR Failed to update XRef! (DON'T TAG)...") + tagThisFile = false + ) -- Unhide category unhidelayers() @@ -804,6 +849,7 @@ try -- export igs try ( + nlerror("exportInstanceGroupFromZone " + curFileName) exportInstanceGroupFromZone curFileName (ligo_export_path + "igs\\") (lowercase (zoneBaseName)) zone cellSize ) catch @@ -813,14 +859,18 @@ try ) -- export collisions - try + if selectCollisionsForExport() then ( - exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName - ) - catch - ( - nlerror("couldn't export collision for " + curFileName) - tagThisFile = false + try + ( + nlerror("exportCollisionsFromZone " + curFileName) + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) ) ) ) @@ -828,10 +878,13 @@ try -- Write a tag file if tagThisFile == true then ( + nlerror("TAG " + curFileName) + nlerror("TAGFILE " + tag) tagFile = createFile tag if tagFile == undefined then ( nlerror ("WARNING can't create tag file "+tag) + removeRunningTag = false ) else ( @@ -839,6 +892,11 @@ try close tagFile ) ) + else + ( + nlerror("NOT TAGGING " + curFileName) + removeRunningTag = false + ) ) resetMAXFile #noprompt @@ -864,7 +922,7 @@ try if (tokenArray.count == 2) and (tokenArray[1] == "zonespecial") then ( -- Get the tag file name - tag = ("output_directory_tag/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") + tag = ("%TagDirectory%/"+(getFilenameFile curFileName)+(getFilenameType curFileName)+".tag") -- Compare date with the tag file if (NeLTestFileDate tag curFileName) == true then @@ -875,8 +933,17 @@ try resetMAXFile #noprompt nlerror ("Scanning file "+curFileName+" ...") - mergeMaxFile curFileName quiet:true - objXRefMgr.UpdateAllRecords() + loadMaxFile curFileName quiet:true + try + ( + nlerror("Update XRef records...") + objXRefMgr.UpdateAllRecords() + ) + catch + ( + nlerror("ERROR Failed to update XRef! (DON'T TAG)...") + tagThisFile = false + ) -- Unhide category unhidelayers() @@ -930,6 +997,7 @@ try -- export matching igs try ( + nlerror("exportInstanceGroupFromZone " + curFileName) exportInstanceGroupFromZone curFileName (ligo_export_path + "igs\\") "" 0 cellSize ) catch @@ -939,23 +1007,30 @@ try ) -- export collisions - try + if selectCollisionsForExport() then ( - exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName - ) - catch - ( - nlerror("couldn't export collision for " + curFileName) - tagThisFile = false + try + ( + nlerror("exportCollisionsFromZone " + curFileName) + exportCollisionsFromZone (ligo_export_path + "cmb\\") curFileName + ) + catch + ( + nlerror("couldn't export collision for " + curFileName) + tagThisFile = false + ) ) -- Write a tag file if tagThisFile == true then ( + nlerror("TAG " + curFileName) + nlerror("TAGFILE " + tag) tagFile = createFile tag if tagFile == undefined then ( nlerror ("WARNING can't create tag file "+tag) + removeRunningTag = false ) else ( @@ -963,6 +1038,11 @@ try close tagFile ) ) + else + ( + nlerror("NOT TAGGING " + curFileName) + removeRunningTag = false + ) resetMAXFile #noprompt gc () @@ -978,13 +1058,38 @@ try catch ( -- Error - nlerror ("ERROR fatal error exporting ligo zone in folder"+ligo_root_path) + nlerror("ERROR fatal error exporting ligo zone in folder"+ligo_root_path) + nlerror("FAIL Fatal error occurred") + NelForceQuitRightNow() + removeRunningTag = false tagThisFile = false ) +try +( + if (removeRunningTag) then + ( + resetMAXFile #noPrompt + ) +) +catch +( + nlerror("FAIL Last reset fails") + removeRunningTag = false +) +if (removeRunningTag) then +( + nlerror("SUCCESS All .max files have been successfully exported") + deleteFile("%TagDirectory%/max_running.tag") +) +else +( + nlerror("FAIL One or more issues occurred") + NelForceQuitRightNow() +) -resetMAXFile #noprompt +nlerror("BYE") quitMAX #noPrompt quitMAX () #noPrompt diff --git a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms index 375fe8eea..9df535d1d 100755 --- a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms +++ b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms @@ -102,6 +102,26 @@ NEL3D_APPDATA_COLLISION = 1423062613 NEL3D_APPDATA_COLLISION_EXTERIOR = 1423062614 NEL3D_APPDATA_AUTOMATIC_ANIMATION = 1423062617 +-- Lower case +fn lowercase instring = +( + local upper, lower, outstring + upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" + lower="abcdefghijklmnopqrstuvwxyz" + + outstring = copy instring + + for iii = 1 to outstring.count do + ( + jjj = findString upper outstring[iii] + if (jjj != undefined) then + outstring[iii] = lower[jjj] + else + outstring[iii] = instring[iii] + ) + return outstring -- value of outstring will be returned as function result +) + -- This node is n accelerator ? fn isAccelerator node = ( @@ -363,9 +383,9 @@ fn runNelMaxExportSub inputMaxFile retryCount = ( -- Output directory if (haveCoarseMesh node) == true then - output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape") + output = ("%OutputDirectoryWithCoarseMesh%/" + lowercase(node.name) + ".shape") else - output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape") + output = ("%OutputDirectoryWithoutCoarseMesh%/" + lowercase(node.name) + ".shape") -- Compare file date if (NeLTestFileDate output inputMaxFile) == true then diff --git a/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt b/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt index 455cb2d8f..a2f0deb5e 100644 --- a/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt +++ b/code/nel/tools/logic/logic_editor_exe/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(logic_editor WIN32 ${SRC}) diff --git a/code/nel/tools/logic/logic_editor_exe/main.rc b/code/nel/tools/logic/logic_editor_exe/main.rc new file mode 100644 index 000000000..5915a8119 --- /dev/null +++ b/code/nel/tools/logic/logic_editor_exe/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "red_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Logic Editor" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "logic_editor" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/logic/logic_editor_exe/red_pill.ico b/code/nel/tools/logic/logic_editor_exe/red_pill.ico new file mode 100644 index 000000000..c5f250583 Binary files /dev/null and b/code/nel/tools/logic/logic_editor_exe/red_pill.ico differ diff --git a/code/nel/tools/misc/bnp_make/CMakeLists.txt b/code/nel/tools/misc/bnp_make/CMakeLists.txt index d27252fb6..a917d4e1d 100644 --- a/code/nel/tools/misc/bnp_make/CMakeLists.txt +++ b/code/nel/tools/misc/bnp_make/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(bnp_make ${SRC}) diff --git a/code/nel/tools/misc/bnp_make/blue_pill.ico b/code/nel/tools/misc/bnp_make/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/misc/bnp_make/blue_pill.ico differ diff --git a/code/nel/tools/misc/bnp_make/main.rc b/code/nel/tools/misc/bnp_make/main.rc new file mode 100644 index 000000000..f4b2740d1 --- /dev/null +++ b/code/nel/tools/misc/bnp_make/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL BNP Make" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "bnp_make" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/misc/branch_patcher/CMakeLists.txt b/code/nel/tools/misc/branch_patcher/CMakeLists.txt index 010e7defd..29b432990 100644 --- a/code/nel/tools/misc/branch_patcher/CMakeLists.txt +++ b/code/nel/tools/misc/branch_patcher/CMakeLists.txt @@ -1,6 +1,8 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) -ADD_EXECUTABLE(branch_patcher WIN32 ${SRC} branch_patcher.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_EXECUTABLE(branch_patcher WIN32 ${SRC}) #TARGET_LINK_LIBRARIES(branch_patcher ${PLATFORM_LINKFLAGS}) NL_DEFAULT_PROPS(branch_patcher "NeL, Tools, Misc: branch_patcher") diff --git a/code/nel/tools/misc/branch_patcher/branch_patcher.rc b/code/nel/tools/misc/branch_patcher/branch_patcher.rc index 9e9abef1c..c2d1a1693 100644 --- a/code/nel/tools/misc/branch_patcher/branch_patcher.rc +++ b/code/nel/tools/misc/branch_patcher/branch_patcher.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -53,52 +53,6 @@ BEGIN END -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Nevrax\0" - VALUE "FileDescription", "branch_patcher MFC Application\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "branch_patcher\0" - VALUE "LegalCopyright", "Copyright (C) 2003\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "branch_patcher.EXE\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Nevrax Branch Patcher\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -115,22 +69,8 @@ BEGIN BOTTOMMARGIN, 274 END END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE @@ -162,6 +102,8 @@ BEGIN "#include ""res\\branch_patcher.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "#include ""afxres.rc"" // Standard components\r\n" "#endif\r\n" + "\r\n" + "#include ""version.rc2""\r\n" "\0" END @@ -176,7 +118,7 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDR_MAINFRAME ICON DISCARDABLE "res\\nevrax_pill_3d_rgba.ico" -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -200,6 +142,8 @@ LANGUAGE 9, 1 #include "afxres.rc" // Standard components #endif +#include "version.rc2" + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/misc/branch_patcher/version.rc2 b/code/nel/tools/misc/branch_patcher/version.rc2 new file mode 100644 index 000000000..1159ec99c --- /dev/null +++ b/code/nel/tools/misc/branch_patcher/version.rc2 @@ -0,0 +1,51 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Branch Patcher" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "branch_patcher" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/misc/crash_report/crash_report.rc b/code/nel/tools/misc/crash_report/crash_report.rc index e4949fd8f..74f260bc6 100644 --- a/code/nel/tools/misc/crash_report/crash_report.rc +++ b/code/nel/tools/misc/crash_report/crash_report.rc @@ -3,33 +3,40 @@ IDI_MAIN_ICON ICON DISCARDABLE "nevraxpill.ico" -VS_VERSION_INFO VERSIONINFO -FILEVERSION NL_VERSION_RC -PRODUCTVERSION NL_VERSION_RC -FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG -FILEFLAGS VS_FF_DEBUG +#define NL_FILEEXT "_d" #else -FILEFLAGS 0x0L +#define NL_FILEEXT "" #endif -FILEOS VOS__WINDOWS32 -FILETYPE VFT_APP -FILESUBTYPE 0x0L + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN - VALUE "FileDescription", "Crash Report" + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Crash Report" VALUE "FileVersion", NL_VERSION VALUE "LegalCopyright", COPYRIGHT - VALUE "OriginalFilename", "crash_report.exe" - VALUE "ProductName", "Ryzom Core" - VALUE "ProductVersion", NL_VERSION + VALUE "OriginalFilename", "crash_report" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1252 + VALUE "Translation", 0x9, 1200 END END diff --git a/code/nel/tools/misc/data_mirror/CMakeLists.txt b/code/nel/tools/misc/data_mirror/CMakeLists.txt index 9727576ba..7d13892a2 100644 --- a/code/nel/tools/misc/data_mirror/CMakeLists.txt +++ b/code/nel/tools/misc/data_mirror/CMakeLists.txt @@ -1,6 +1,8 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) -ADD_EXECUTABLE(data_mirror WIN32 ${SRC} data_mirror.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_EXECUTABLE(data_mirror WIN32 ${SRC}) TARGET_LINK_LIBRARIES(data_mirror nelmisc) NL_DEFAULT_PROPS(data_mirror "NeL, Tools, Misc: data_mirror") diff --git a/code/nel/tools/misc/data_mirror/data_mirror.rc b/code/nel/tools/misc/data_mirror/data_mirror.rc index 7846fc021..70ad5a542 100644 --- a/code/nel/tools/misc/data_mirror/data_mirror.rc +++ b/code/nel/tools/misc/data_mirror/data_mirror.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -71,49 +71,6 @@ BEGIN END -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "data_mirror MFC Application\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "data_mirror\0" - VALUE "LegalCopyright", "Copyright (C) 2003\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "data_mirror.EXE\0" - VALUE "ProductName", "data_mirror Application\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -174,18 +131,6 @@ BEGIN IDS_NEW_DATE "New Date" END -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -219,12 +164,14 @@ BEGIN "#include ""res\\data_mirror.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "#include ""afxres.rc"" // Standard components\r\n" "#endif\r\n" + "\r\n" + "#include ""version.rc2""\r\n" "\0" END #endif // APSTUDIO_INVOKED -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -248,6 +195,8 @@ LANGUAGE 9, 1 #include "afxres.rc" // Standard components #endif +#include "version.rc2" + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/misc/data_mirror/version.rc2 b/code/nel/tools/misc/data_mirror/version.rc2 new file mode 100644 index 000000000..801c6c575 --- /dev/null +++ b/code/nel/tools/misc/data_mirror/version.rc2 @@ -0,0 +1,51 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Data Mirror" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "data_mirror" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/misc/exec_timeout/CMakeLists.txt b/code/nel/tools/misc/exec_timeout/CMakeLists.txt index 18654e169..75f4329f0 100644 --- a/code/nel/tools/misc/exec_timeout/CMakeLists.txt +++ b/code/nel/tools/misc/exec_timeout/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(exec_timeout ${SRC}) diff --git a/code/nel/tools/misc/exec_timeout/main.rc b/code/nel/tools/misc/exec_timeout/main.rc new file mode 100644 index 000000000..fffb991c9 --- /dev/null +++ b/code/nel/tools/misc/exec_timeout/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "yellow_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Exec Timeout" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "exec_timeout" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/misc/exec_timeout/yellow_pill.ico b/code/nel/tools/misc/exec_timeout/yellow_pill.ico new file mode 100644 index 000000000..a8056d9d2 Binary files /dev/null and b/code/nel/tools/misc/exec_timeout/yellow_pill.ico differ diff --git a/code/nel/tools/misc/log_analyser/CMakeLists.txt b/code/nel/tools/misc/log_analyser/CMakeLists.txt index e852de2bc..55824bc26 100644 --- a/code/nel/tools/misc/log_analyser/CMakeLists.txt +++ b/code/nel/tools/misc/log_analyser/CMakeLists.txt @@ -1,6 +1,8 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) -ADD_EXECUTABLE(log_analyser WIN32 ${SRC} log_analyser.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_EXECUTABLE(log_analyser WIN32 ${SRC}) TARGET_LINK_LIBRARIES(log_analyser nelmisc) NL_DEFAULT_PROPS(log_analyser "NeL, Tools, Misc: log_analyser") diff --git a/code/nel/tools/misc/log_analyser/log_analyser.rc b/code/nel/tools/misc/log_analyser/log_analyser.rc index 1f6242bf2..e05ee685b 100644 --- a/code/nel/tools/misc/log_analyser/log_analyser.rc +++ b/code/nel/tools/misc/log_analyser/log_analyser.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -109,52 +109,6 @@ BEGIN END -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,5,0,1 - PRODUCTVERSION 1,5,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Nevrax\0" - VALUE "FileDescription", "NeL Log Analyser\0" - VALUE "FileVersion", "1, 5, 0, 1\0" - VALUE "InternalName", "log_analyser\0" - VALUE "LegalCopyright", "Copyright (C) 2002-2003 Nevrax\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "NeL Log Analyser\0" - VALUE "ProductVersion", "1, 5, 0, 1\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -205,18 +159,6 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -250,6 +192,8 @@ BEGIN "#include ""res\\log_analyser.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "#include ""afxres.rc"" // Standard components\r\n" "#endif\r\n" + "\r\n" + "#include ""version.rc2""\r\n" "\0" END @@ -264,7 +208,7 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDR_MAINFRAME ICON DISCARDABLE "res\\log_analyser.ico" -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -288,6 +232,8 @@ LANGUAGE 9, 1 #include "afxres.rc" // Standard components #endif +#include "version.rc2" + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/misc/log_analyser/version.rc2 b/code/nel/tools/misc/log_analyser/version.rc2 new file mode 100644 index 000000000..b7600f5da --- /dev/null +++ b/code/nel/tools/misc/log_analyser/version.rc2 @@ -0,0 +1,51 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Log Analyser" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "log_analyser" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/misc/make_sheet_id/CMakeLists.txt b/code/nel/tools/misc/make_sheet_id/CMakeLists.txt index 553f7fddb..9c779f08e 100644 --- a/code/nel/tools/misc/make_sheet_id/CMakeLists.txt +++ b/code/nel/tools/misc/make_sheet_id/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(make_sheet_id ${SRC}) diff --git a/code/nel/tools/misc/make_sheet_id/blue_pill.ico b/code/nel/tools/misc/make_sheet_id/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/nel/tools/misc/make_sheet_id/blue_pill.ico differ diff --git a/code/nel/tools/misc/make_sheet_id/main.rc b/code/nel/tools/misc/make_sheet_id/main.rc new file mode 100644 index 000000000..771a866cc --- /dev/null +++ b/code/nel/tools/misc/make_sheet_id/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Make Sheet ID" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "make_sheet_id" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/misc/message_box/CMakeLists.txt b/code/nel/tools/misc/message_box/CMakeLists.txt index 764071d9d..4833b9264 100644 --- a/code/nel/tools/misc/message_box/CMakeLists.txt +++ b/code/nel/tools/misc/message_box/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(message_box WIN32 ${SRC}) diff --git a/code/nel/tools/misc/message_box/main.rc b/code/nel/tools/misc/message_box/main.rc new file mode 100644 index 000000000..94c0ac4e6 --- /dev/null +++ b/code/nel/tools/misc/message_box/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "yellow_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Message Box" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "message_box" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/misc/message_box/yellow_pill.ico b/code/nel/tools/misc/message_box/yellow_pill.ico new file mode 100644 index 000000000..a8056d9d2 Binary files /dev/null and b/code/nel/tools/misc/message_box/yellow_pill.ico differ diff --git a/code/nel/tools/misc/message_box_qt/CMakeLists.txt b/code/nel/tools/misc/message_box_qt/CMakeLists.txt index be4dd2b63..a21ef6cf7 100644 --- a/code/nel/tools/misc/message_box_qt/CMakeLists.txt +++ b/code/nel/tools/misc/message_box_qt/CMakeLists.txt @@ -5,7 +5,9 @@ ENDIF() INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) -FILE(GLOB MESSAGE_BOX_SRC *.cpp) +FILE(GLOB MESSAGE_BOX_SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${MESSAGE_BOX_SRC}) SET( QT_USE_QT3SUPPORT TRUE) SET( QT_USE_QTXML TRUE) diff --git a/code/nel/tools/misc/message_box_qt/main.rc b/code/nel/tools/misc/message_box_qt/main.rc new file mode 100644 index 000000000..ed934c572 --- /dev/null +++ b/code/nel/tools/misc/message_box_qt/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "yellow_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Message Box" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "message_box_qt" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/misc/message_box_qt/yellow_pill.ico b/code/nel/tools/misc/message_box_qt/yellow_pill.ico new file mode 100644 index 000000000..a8056d9d2 Binary files /dev/null and b/code/nel/tools/misc/message_box_qt/yellow_pill.ico differ diff --git a/code/nel/tools/misc/multi_cd_setup_fix/CMakeLists.txt b/code/nel/tools/misc/multi_cd_setup_fix/CMakeLists.txt index 3a5f7da4e..3b79aaf4c 100644 --- a/code/nel/tools/misc/multi_cd_setup_fix/CMakeLists.txt +++ b/code/nel/tools/misc/multi_cd_setup_fix/CMakeLists.txt @@ -1,6 +1,8 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) -ADD_EXECUTABLE(multi_cd_setup_fix WIN32 ${SRC} multi_cd_setup_fix.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_EXECUTABLE(multi_cd_setup_fix WIN32 ${SRC}) #TARGET_LINK_LIBRARIES(multi_cd_setup_fix ${PLATFORM_LINKFLAGS}) NL_DEFAULT_PROPS(multi_cd_setup_fix "NeL, Tools, Misc: multi_cd_setup_fix") diff --git a/code/nel/tools/misc/multi_cd_setup_fix/multi_cd_setup_fix.rc b/code/nel/tools/misc/multi_cd_setup_fix/multi_cd_setup_fix.rc index 2249f5130..9e8475879 100644 --- a/code/nel/tools/misc/multi_cd_setup_fix/multi_cd_setup_fix.rc +++ b/code/nel/tools/misc/multi_cd_setup_fix/multi_cd_setup_fix.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// French (France) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) #ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -49,7 +49,7 @@ END 3 TEXTINCLUDE DISCARDABLE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END @@ -89,7 +89,7 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -99,7 +99,7 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/misc/multi_cd_setup_fix/version.rc2 b/code/nel/tools/misc/multi_cd_setup_fix/version.rc2 new file mode 100644 index 000000000..1983b77ab --- /dev/null +++ b/code/nel/tools/misc/multi_cd_setup_fix/version.rc2 @@ -0,0 +1,51 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Multi CD Setup Fix" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "multi_cd_setup_fix" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/misc/probe_timers/CMakeLists.txt b/code/nel/tools/misc/probe_timers/CMakeLists.txt index cb17490df..9ce75c0ab 100644 --- a/code/nel/tools/misc/probe_timers/CMakeLists.txt +++ b/code/nel/tools/misc/probe_timers/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(nl_probe_timers ${SRC}) diff --git a/code/nel/tools/misc/probe_timers/gold_pill.ico b/code/nel/tools/misc/probe_timers/gold_pill.ico new file mode 100644 index 000000000..618b67a5d Binary files /dev/null and b/code/nel/tools/misc/probe_timers/gold_pill.ico differ diff --git a/code/nel/tools/misc/probe_timers/main.rc b/code/nel/tools/misc/probe_timers/main.rc new file mode 100644 index 000000000..4d9c2e214 --- /dev/null +++ b/code/nel/tools/misc/probe_timers/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "gold_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Probe Timers" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "nl_probe_timers" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/nel/tools/misc/words_dic/CMakeLists.txt b/code/nel/tools/misc/words_dic/CMakeLists.txt index a2d0293ad..d9acfd66a 100644 --- a/code/nel/tools/misc/words_dic/CMakeLists.txt +++ b/code/nel/tools/misc/words_dic/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(words_dic WIN32 ${SRC} words_dic.rc) diff --git a/code/nel/tools/misc/words_dic/version.rc2 b/code/nel/tools/misc/words_dic/version.rc2 new file mode 100644 index 000000000..d63e8a608 --- /dev/null +++ b/code/nel/tools/misc/words_dic/version.rc2 @@ -0,0 +1,51 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Words Dictionary" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "words_dic" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/nel/tools/misc/words_dic/words_dic.rc b/code/nel/tools/misc/words_dic/words_dic.rc index 978991d33..35813c5a5 100644 --- a/code/nel/tools/misc/words_dic/words_dic.rc +++ b/code/nel/tools/misc/words_dic/words_dic.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -48,52 +48,6 @@ BEGIN END -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Nevrax\0" - VALUE "FileDescription", "\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "words_dic\0" - VALUE "LegalCopyright", "Copyright (C) 2003\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Nevrax Words Dictionary\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -110,22 +64,7 @@ BEGIN BOTTOMMARGIN, 242 END END -#endif // APSTUDIO_INVOKED -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE @@ -157,6 +96,8 @@ BEGIN "#include ""res\\words_dic.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "#include ""afxres.rc"" // Standard components\r\n" "#endif\r\n" + "\r\n" + "#include ""version.rc2""\r\n" "\0" END @@ -203,7 +144,7 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -227,6 +168,8 @@ LANGUAGE 9, 1 #include "afxres.rc" // Standard components #endif +#include "version.rc2" + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/nel/tools/misc/words_dic_qt/CMakeLists.txt b/code/nel/tools/misc/words_dic_qt/CMakeLists.txt index fc2ced95e..c31de9100 100644 --- a/code/nel/tools/misc/words_dic_qt/CMakeLists.txt +++ b/code/nel/tools/misc/words_dic_qt/CMakeLists.txt @@ -1,14 +1,13 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) -FILE(GLOB WORDS_DIC_SRC *.cpp *.h) +FILE(GLOB WORDS_DIC_SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${WORDS_DIC_SRC}) + SET(WORDS_DIC_HDR words_dicDlg.h) SET(WORDS_DIC_UIS words_dic_Qt.ui) SET(WORDS_DIC_RCS words_dic_Qt.qrc) -IF(WIN32) - SET(WORDS_DIC_RC words_dic.rc) -ENDIF() - ADD_DEFINITIONS(-DNL_WORDS_DIC_CFG="\\"${NL_ETC_PREFIX}/\\"") IF(WITH_QT) @@ -29,7 +28,7 @@ ELSE() QT5_WRAP_CPP(WORDS_DIC_MOC_SRCS ${WORDS_DIC_HDR}) ENDIF() -ADD_EXECUTABLE(words_dic_qt WIN32 ${WORDS_DIC_SRC} ${WORDS_DIC_MOC_SRCS} ${WORDS_DIC_RC_SRCS} ${WORDS_DIC_UI_HDRS} ${WORDS_DIC_RC}) +ADD_EXECUTABLE(words_dic_qt WIN32 ${WORDS_DIC_SRC} ${WORDS_DIC_MOC_SRCS} ${WORDS_DIC_RC_SRCS} ${WORDS_DIC_UI_HDRS}) TARGET_LINK_LIBRARIES(words_dic_qt ${QT_LIBRARIES} nelmisc) NL_DEFAULT_PROPS(words_dic_qt "NeL, Tools, Misc: Qt Words Dic") diff --git a/code/nel/tools/misc/words_dic_qt/words_dic.rc b/code/nel/tools/misc/words_dic_qt/words_dic.rc index 0211a6c22..a6fee59c2 100644 --- a/code/nel/tools/misc/words_dic_qt/words_dic.rc +++ b/code/nel/tools/misc/words_dic_qt/words_dic.rc @@ -1,46 +1,48 @@ #include "resource.h" #include +#include "config.h" ///////////////////////////////////////////////////////////////////////////// // // Version // -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL #ifdef _DEBUG - FILEFLAGS 0x1L +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG #else FILEFLAGS 0x0L #endif - FILEOS 0x4L - FILETYPE 0x1L + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Nevrax\0" - VALUE "FileDescription", "\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "words_dic\0" - VALUE "LegalCopyright", "Copyright (C) 2003\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Nevrax Words Dictionary\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - VALUE "SpecialBuild", "\0" + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "NeL Words Dictionary" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "words_dic_qt" NL_FILEEXT ".exe" + VALUE "ProductName", "NeL Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1200 + VALUE "Translation", 0x9, 1200 END END diff --git a/code/nel/tools/pacs/build_ig_boxes/CMakeLists.txt b/code/nel/tools/pacs/build_ig_boxes/CMakeLists.txt index fb2feedbe..cfeb3069e 100644 --- a/code/nel/tools/pacs/build_ig_boxes/CMakeLists.txt +++ b/code/nel/tools/pacs/build_ig_boxes/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_ig_boxes ${SRC}) diff --git a/code/nel/tools/pacs/build_indoor_rbank/CMakeLists.txt b/code/nel/tools/pacs/build_indoor_rbank/CMakeLists.txt index 85f1984bf..4d39639a2 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/CMakeLists.txt +++ b/code/nel/tools/pacs/build_indoor_rbank/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_indoor_rbank ${SRC}) diff --git a/code/nel/tools/pacs/build_rbank/CMakeLists.txt b/code/nel/tools/pacs/build_rbank/CMakeLists.txt index 65e86394d..9b493b762 100644 --- a/code/nel/tools/pacs/build_rbank/CMakeLists.txt +++ b/code/nel/tools/pacs/build_rbank/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_rbank ${SRC}) diff --git a/code/nel/tools/sound/build_samplebank/CMakeLists.txt b/code/nel/tools/sound/build_samplebank/CMakeLists.txt index b86e1e3e7..dfe20b9d6 100644 --- a/code/nel/tools/sound/build_samplebank/CMakeLists.txt +++ b/code/nel/tools/sound/build_samplebank/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_samplebank ${SRC}) diff --git a/code/nel/tools/sound/build_sound/CMakeLists.txt b/code/nel/tools/sound/build_sound/CMakeLists.txt index 5a5d81e81..15b6d76bd 100644 --- a/code/nel/tools/sound/build_sound/CMakeLists.txt +++ b/code/nel/tools/sound/build_sound/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_sound ${SRC}) diff --git a/code/nel/tools/sound/build_soundbank/CMakeLists.txt b/code/nel/tools/sound/build_soundbank/CMakeLists.txt index 310e6a2c5..c1988aa81 100644 --- a/code/nel/tools/sound/build_soundbank/CMakeLists.txt +++ b/code/nel/tools/sound/build_soundbank/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_soundbank ${SRC}) diff --git a/code/nelns/login_service/mysql_helper.cpp b/code/nelns/login_service/mysql_helper.cpp index 208faf41e..5ae04e8b5 100644 --- a/code/nelns/login_service/mysql_helper.cpp +++ b/code/nelns/login_service/mysql_helper.cpp @@ -157,7 +157,7 @@ static void cbDatabaseVar(CConfigFile::CVar &var) #endif - sqlQuery("set names utf8"); + sqlQuery("set names utf8mb4"); } void sqlInit() diff --git a/code/ryzom/client/client_default.cfg b/code/ryzom/client/client_default.cfg index 9f1b4611e..cd390adda 100644 --- a/code/ryzom/client/client_default.cfg +++ b/code/ryzom/client/client_default.cfg @@ -368,6 +368,10 @@ SoundGameMusicVolume_min = 0.0; SoundGameMusicVolume_max = 1.0; SoundGameMusicVolume_step = 0.001; +// MP3 player +MediaPlayerDirectory = "music"; +MediaPlayerAutoPlay = false; + // MISC PreDataPath = { "user", "patch", "data", "examples" }; NeedComputeVS = 0; diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml b/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml index 6d7ac1fa7..eecc764ae 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml @@ -1025,4 +1025,30 @@ force_inside_screen="false"> + + + + diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/widgets.xml b/code/ryzom/client/data/gamedev/interfaces_v3/widgets.xml index 5ac02437f..afde8540e 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/widgets.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/widgets.xml @@ -7252,4 +7252,30 @@ force_inside_screen="false"> + + + + diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index 2c894a65e..2b9359285 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -180,6 +180,7 @@ int main(int argc, char **argv) Args.addAdditionalArg("login", "Login to use", true, false); Args.addAdditionalArg("password", "Password to use", true, false); Args.addAdditionalArg("shard_id", "Shard ID to use", true, false); + Args.addAdditionalArg("slot", "Char slot to use", true, false); #ifdef TEST_CRASH_COUNTER Args.addArg("", "crash", "", "Crash client before init"); @@ -220,6 +221,12 @@ int main(int argc, char **argv) if (Args.haveAdditionalArg("shard_id")) sLoginShardId = Args.getAdditionalArg("shard_id").front(); + + if (Args.haveAdditionalArg("slot")) + { + if (!fromString(Args.getAdditionalArg("slot").front(), LoginCharsel)) + LoginCharsel = -1; + } } } diff --git a/code/ryzom/client/src/client_cfg.cpp b/code/ryzom/client/src/client_cfg.cpp index e6b98a053..091c5558f 100644 --- a/code/ryzom/client/src/client_cfg.cpp +++ b/code/ryzom/client/src/client_cfg.cpp @@ -468,6 +468,10 @@ CClientConfig::CClientConfig() ColorShout = CRGBA(150,0,0,255); // Default Shout color. ColorTalk = CRGBA(255,255,255,255); // Default Talk color. + // MP3 player + MediaPlayerDirectory = "music"; + MediaPlayerAutoPlay = false; + // PreDataPath.push_back("data/gamedev/language/"); // Default Path for the language data // DataPath.push_back("data/"); // Default Path for the Data. @@ -1237,6 +1241,10 @@ void CClientConfig::setValues() // Max track READ_INT_FV(MaxTrack) + // MP3 Player + READ_STRING_FV(MediaPlayerDirectory); + READ_BOOL_FV(MediaPlayerAutoPlay); + ///////////////// // USER COLORS // // Shout Color diff --git a/code/ryzom/client/src/client_cfg.h b/code/ryzom/client/src/client_cfg.h index c9c75a152..af2e97bd3 100644 --- a/code/ryzom/client/src/client_cfg.h +++ b/code/ryzom/client/src/client_cfg.h @@ -366,6 +366,10 @@ struct CClientConfig /// The max number of track we want to use. uint MaxTrack; + // MP3 Player + string MediaPlayerDirectory; + bool MediaPlayerAutoPlay; + /// Pre Data Path. std::vector PreDataPath; /// Data Path. diff --git a/code/ryzom/client/src/connection.cpp b/code/ryzom/client/src/connection.cpp index 045822370..dd776b7fb 100644 --- a/code/ryzom/client/src/connection.cpp +++ b/code/ryzom/client/src/connection.cpp @@ -144,14 +144,13 @@ ucstring PlayerSelectedHomeShardName; ucstring PlayerSelectedHomeShardNameWithParenthesis; extern std::string CurrentCookie; - ucstring NewKeysCharNameWanted; // name of the character for which a new keyset must be created ucstring NewKeysCharNameValidated; std::string GameKeySet = "keys.xml"; std::string RingEditorKeySet = "keys_r2ed.xml"; string ScenarioFileName; - +sint LoginCharsel = -1; static const char *KeySetVarName = "BuiltInKeySets"; @@ -1095,8 +1094,15 @@ TInterfaceState globalMenu() noUserChar = userChar = false; if( FarTP.isReselectingChar() || !FarTP.isServerHopInProgress() ) // if doing a Server Hop, expect serverReceivedReady without action from the user { + sint charSelect = -1; + if (ClientCfg.SelectCharacter != -1) + charSelect = ClientCfg.SelectCharacter; + + if (LoginCharsel != -1) + charSelect = LoginCharsel; + WaitServerAnswer = false; - if (ClientCfg.SelectCharacter == -1) + if (charSelect == -1) { CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp("UI:SERVER_RECEIVED_CHARS", false); if (pNL != NULL) @@ -1112,7 +1118,7 @@ TInterfaceState globalMenu() else { // check that the pre selected character is available - if (CharacterSummaries[ClientCfg.SelectCharacter].People == EGSPD::CPeople::Unknown) + if (CharacterSummaries[charSelect].People == EGSPD::CPeople::Unknown || charSelect > 4) { // BAD ! preselected char does not exist, use the first available or fail uint i; @@ -1132,12 +1138,14 @@ TInterfaceState globalMenu() if (ret == UDriver::noId) exit(-1); else - ClientCfg.SelectCharacter = i; + charSelect = i; } } - // Auto-selection for fast launching (dev only) - CAHManager::getInstance()->runActionHandler("launch_game", NULL, toString("slot=%d|edit_mode=0", ClientCfg.SelectCharacter)); + CAHManager::getInstance()->runActionHandler("launch_game", NULL, toString("slot=%d|edit_mode=0", charSelect)); + + if (LoginCharsel == -1) + ClientCfg.SelectCharacter = charSelect; } } diff --git a/code/ryzom/client/src/connection.h b/code/ryzom/client/src/connection.h index 92dfa859e..a424e80e9 100644 --- a/code/ryzom/client/src/connection.h +++ b/code/ryzom/client/src/connection.h @@ -34,6 +34,7 @@ extern ucstring PlayerSelectedHomeShardName; // The home shard name (aniro, extern ucstring PlayerSelectedHomeShardNameWithParenthesis; // Same with parenthesis extern std::vector CharacterSummaries; extern std::string UserPrivileges; +extern sint LoginCharsel; extern ucstring NewKeysCharNameWanted; extern ucstring NewKeysCharNameValidated; diff --git a/code/ryzom/client/src/continent_manager.cpp b/code/ryzom/client/src/continent_manager.cpp index c4b5cc693..cb8e11dbd 100644 --- a/code/ryzom/client/src/continent_manager.cpp +++ b/code/ryzom/client/src/continent_manager.cpp @@ -628,8 +628,8 @@ void CContinentManager::readFrom(xmlNodePtr node) for(uint i = 0; i< itContinent->second->UserLandMarks.size(); ++i) { const CUserLandMark& test = itContinent->second->UserLandMarks[i]; - uint xdiff = abs(test.Pos.x - lm.Pos.x) * 100; - uint ydiff = abs(test.Pos.y - lm.Pos.y) * 100; + uint xdiff = fabs(test.Pos.x - lm.Pos.x) * 100.f; + uint ydiff = fabs(test.Pos.y - lm.Pos.y) * 100.f; if (xdiff == 0 && ydiff == 0) { add = false; diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index bfe014fc3..0001c897d 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -53,6 +53,7 @@ #include "action_handler_tools.h" #include "../connection.h" #include "../client_chat_manager.h" +#include "group_compas.h" // Game specific includes #include "../motion/user_controls.h" @@ -2472,6 +2473,17 @@ class CAHTarget : public IActionHandler if (entity && entity->properties().selectable() && !entity->getDisplayName().empty()) { UserEntity->selection(entity->slot()); + CGroupCompas *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:compass")); + if (gc) + { + CCompassTarget ct; + ct.setType(CCompassTarget::Selection); + + gc->setActive(true); + gc->setTarget(ct); + gc->blink(); + CWidgetManager::getInstance()->setTopWindow(gc); + } } else if (!quiet) { @@ -2481,6 +2493,33 @@ class CAHTarget : public IActionHandler }; REGISTER_ACTION_HANDLER (CAHTarget, "target"); +// *************************************************************************** +class CAHTargetLandmark : public IActionHandler +{ + virtual void execute (CCtrlBase * /* pCaller */, const string &Params) + { + string search = getParam(Params, "search"); + if (search.empty()) return; + + bool startsWith = false; + if (search.size() > 0 && (search[0] == '\'' || search[0] == '"') && search[0] == search[search.size()-1]) + { + startsWith = true; + search = trimQuotes(search); + } + + const std::string mapid = "ui:interface:map:content:map_content:actual_map"; + CGroupMap* cgMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(mapid)); + if (cgMap) + { + if (!cgMap->targetLandmarkByName(search, startsWith)) + { + CInterfaceManager::getInstance()->displaySystemInfo(CI18N::get("uiTargetErrorCmd")); + } + } + } +}; +REGISTER_ACTION_HANDLER (CAHTargetLandmark, "target_landmark"); class CAHAddShape : public IActionHandler diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index 1f7f6979a..a9ef65c2d 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -1103,20 +1103,18 @@ REGISTER_ACTION_HANDLER( CHandlerBrowseRefresh, "browse_refresh"); // *************************************************************************** -/** Build the help window for a pact/item/brick and open it. - */ class CHandlerHTMLSubmitForm : public IActionHandler { void execute (CCtrlBase *pCaller, const std::string &sParams) { string container = getParam (sParams, "name"); - uint form; - fromString(getParam (sParams, "form"), form); - - string submit_button = getParam (sParams, "submit_button"); - string type = getParam (sParams, "submit_button_type"); - string value = getParam (sParams, "submit_button_value"); + uint button; + if (!fromString(getParam(sParams, "button"), button)) + { + nlwarning("Invalid button index: '%s', expected integer", getParam(sParams, "button").c_str()); + return; + } sint32 x = pCaller->getEventX(); sint32 y = pCaller->getEventY(); @@ -1127,8 +1125,7 @@ class CHandlerHTMLSubmitForm : public IActionHandler CGroupHTML *groupHtml = dynamic_cast(element); if (groupHtml) { - // Submit the form the url - groupHtml->submitForm (form, type.c_str(), submit_button.c_str(), value.c_str(), x, y); + groupHtml->submitForm(button, x, y); } } } @@ -2339,11 +2336,11 @@ void setupCosmetic(CSheetHelpSetup &setup, CItemSheet *pIS) void setupItemPreview(CSheetHelpSetup &setup, CItemSheet *pIS) { nlassert(pIS); - + CInterfaceManager *pIM = CInterfaceManager::getInstance(); CCDBNodeBranch *dbBranch = NLGUI::CDBManager::getInstance()->getDbBranch( setup.SrcSheet->getSheet() ); - - + + CInterfaceElement *elt = setup.HelpWindow->getElement(setup.HelpWindow->getId()+setup.PrefixForExtra+INFO_ITEM_PREVIEW); if (elt == NULL) return; @@ -2357,12 +2354,12 @@ void setupItemPreview(CSheetHelpSetup &setup, CItemSheet *pIS) static sint32 helpWidth = setup.HelpWindow->getW(); bool scene_inactive = ! NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:SHOW_3D_ITEM_PREVIEW")->getValueBool(); - if (scene_inactive || - (pIS->Family != ITEMFAMILY::ARMOR && - pIS->Family != ITEMFAMILY::MELEE_WEAPON && - pIS->Family != ITEMFAMILY::RANGE_WEAPON && + if (scene_inactive || + (pIS->Family != ITEMFAMILY::ARMOR && + pIS->Family != ITEMFAMILY::MELEE_WEAPON && + pIS->Family != ITEMFAMILY::RANGE_WEAPON && pIS->Family != ITEMFAMILY::SHIELD)) - { + { setup.HelpWindow->setW(helpWidth); ig->setActive(false); return; @@ -2372,7 +2369,7 @@ void setupItemPreview(CSheetHelpSetup &setup, CItemSheet *pIS) setup.HelpWindow->setW(helpWidth + ITEM_PREVIEW_WIDTH); ig->setActive(true); } - + CInterface3DScene *sceneI = dynamic_cast(ig->getGroup("scene_item_preview")); if (!sceneI) { @@ -2458,7 +2455,7 @@ void setupItemPreview(CSheetHelpSetup &setup, CItemSheet *pIS) cs.VisualPropA.PropertySubData.HatColor = color->getValue32(); SCharacter3DSetup::setupDBFromCharacterSummary("UI:TEMP:CHAR3D", cs); camHeight = -0.35f; - } + } } else if (pIS->Family == ITEMFAMILY::SHIELD) { diff --git a/code/ryzom/client/src/interface_v3/group_html_webig.cpp b/code/ryzom/client/src/interface_v3/group_html_webig.cpp index c7ee1a6c3..8f5c6da01 100644 --- a/code/ryzom/client/src/interface_v3/group_html_webig.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_webig.cpp @@ -30,6 +30,7 @@ #include "../connection.h" #include +#include "nel/gui/curl_certificates.h" using namespace std; using namespace NLMISC; @@ -168,6 +169,17 @@ public: _Thread = NULL; curl_global_init(CURL_GLOBAL_ALL); + Curl = NULL; + //nlinfo("ctor CWebigNotificationThread"); + } + + void init() + { + if (Curl) + { + return; + } + Curl = curl_easy_init(); if(!Curl) return; curl_easy_setopt(Curl, CURLOPT_COOKIEFILE, ""); @@ -175,7 +187,8 @@ public: curl_easy_setopt(Curl, CURLOPT_USERAGENT, getUserAgent().c_str()); curl_easy_setopt(Curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(Curl, CURLOPT_WRITEFUNCTION, writeDataFromCurl); - //nlinfo("ctor CWebigNotificationThread"); + + NLGUI::CCurlCertificates::useCertificates(Curl); } ~CWebigNotificationThread() @@ -183,7 +196,7 @@ public: if(Curl) { curl_easy_cleanup(Curl); - Curl = 0; + Curl = NULL; } if (_Thread) { @@ -275,6 +288,9 @@ public: void startThread() { + // initialize curl outside thread + init(); + if (!_Thread) { _Thread = IThread::create(this); @@ -286,7 +302,6 @@ public: { nlwarning("WebIgNotification thread already started"); } - } void stopThread() @@ -305,7 +320,7 @@ public: } } - bool isRunning() const + bool isRunning() const { return _Running; } diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index e9864b61b..87dbb38f5 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -100,6 +100,12 @@ const uint32 ISLAND_PIXEL_PER_METER = 2; static void setupFromZoom(CViewBase *pVB, CContLandMark::TContLMType t, float fMeterPerPixel); +// calculate distance (squared) between two points +static float distsqr(const CVector2f a, const CVector2f b) +{ + return pow(a.x - b.x, 2) + pow(a.y - b.y, 2); +} + // popup the landmark name dialog static void popupLandMarkNameDialog() @@ -2671,21 +2677,38 @@ void CGroupMap::updateLandMarkButton(CLandMarkButton *lmb, const CLandMarkOption } //============================================================================================================ -bool CGroupMap::filterLandmark(const ucstring &title) const +bool CGroupMap::filterLandmark(const ucstring &title, const std::vector filter, bool startsWith) const { - if (_LandmarkFilter.size() > 0) + if (filter.size() > 0) { ucstring lcTitle = toLower(title); - for(uint i = 0; i< _LandmarkFilter.size(); ++i) { - if (lcTitle.find(_LandmarkFilter[i]) == ucstring::npos) { + if (startsWith) + { + if (lcTitle.find(filter[0]) != 0) + { return false; } } + else + { + for(uint i = 0; i< filter.size(); ++i) + { + if (lcTitle.find(filter[i]) == ucstring::npos) + { + return false; + } + } + } } - return true; } +//============================================================================================================ +bool CGroupMap::filterLandmark(const ucstring &title) const +{ + return filterLandmark(title, _LandmarkFilter); +} + //============================================================================================================ void CGroupMap::addLandMark(TLandMarkButtonVect &destList, const NLMISC::CVector2f &pos, const ucstring &title, const CLandMarkOptions &options) { @@ -3186,6 +3209,129 @@ void CGroupMap::targetLandmarkResult(uint32 index) } } +//========================================================================================================= +CGroupMap::CLandMarkButton* CGroupMap::findClosestLandmark(const CVector2f ¢er, const ucstring &search, bool startsWith, const TLandMarkButtonVect &landmarks, float &closest) const +{ + CLandMarkButton *ret = NULL; + + std::vector keywords; + if (startsWith) + keywords.push_back(search); + else + splitUCString(toLower(search), ucstring(" "), keywords); + + closest = std::numeric_limits::max(); + for(TLandMarkButtonVect::const_iterator it = landmarks.begin(); it != landmarks.end(); ++it) + { + ucstring lc; + (*it)->getContextHelp(lc); + if(filterLandmark(lc, keywords, startsWith)) { + CVector2f pos; + mapToWorld(pos, (*it)->Pos); + float dist = distsqr(center, pos); + if (dist < closest) + { + ret = (*it); + closest = dist; + } + } + } + + return ret; +} + +//========================================================================================================= +CGroupMap::CLandMarkText* CGroupMap::findClosestLandmark(const CVector2f ¢er, const ucstring &search, bool startsWith, const TLandMarkTextVect &landmarks, float &closest) const +{ + CLandMarkText *ret = NULL; + + std::vector keywords; + if (startsWith) + keywords.push_back(search); + else + splitUCString(toLower(search), ucstring(" "), keywords); + + closest = std::numeric_limits::max(); + for(TLandMarkTextVect::const_iterator it = landmarks.begin(); it != landmarks.end(); ++it) + { + ucstring lc; + lc = (*it)->getText(); + if(filterLandmark(lc, keywords, startsWith)) { + CVector2f pos; + mapToWorld(pos, (*it)->Pos); + float dist = distsqr(center, pos); + if (dist < closest) + { + ret = (*it); + closest = dist; + } + } + } + + return ret; +} + +bool CGroupMap::targetLandmarkByName(const ucstring &search, bool startsWith) const +{ + CCompassTarget ct; + CLandMarkButton* lm; + float dist; + float closest = std::numeric_limits::max(); + bool found = false; + CVector2f center; + mapToWorld(center, _PlayerPos); + + lm = findClosestLandmark(center, search, startsWith, _UserLM, dist); + if (lm && dist < closest) + { + ct.setType(CCompassTarget::UserLandMark); + mapToWorld(ct.Pos, lm->Pos); + lm->getContextHelp(ct.Name); + closest = dist; + found = true; + } + + // only check other types if user landmark was not found + if (!found) + { + lm = findClosestLandmark(center, search, startsWith, _ContinentLM, dist); + if (lm && dist < closest) + { + ct.setType(CCompassTarget::ContinentLandMark); + mapToWorld(ct.Pos, lm->Pos); + lm->getContextHelp(ct.Name); + closest = dist; + found = true; + } + + CLandMarkText* lmt; + lmt = findClosestLandmark(center, search, startsWith, _ContinentText, dist); + if (lmt && dist < closest) + { + ct.setType(CCompassTarget::ContinentLandMark); + mapToWorld(ct.Pos, lmt->Pos); + ct.Name = lmt->getText(); + closest = dist; + found = true; + } + } + + if (found) + { + CInterfaceManager *im = CInterfaceManager::getInstance(); + CGroupCompas *gc = dynamic_cast(CWidgetManager::getInstance()->getElementFromId(_CompassId)); + if (gc) + { + gc->setActive(true); + gc->setTarget(ct); + gc->blink(); + CWidgetManager::getInstance()->setTopWindow(gc); + } + } + + return found; +} + //========================================================================================================= void CGroupMap::getLandmarkPosition(const CCtrlButton *lm, NLMISC::CVector2f &worldPos) { diff --git a/code/ryzom/client/src/interface_v3/group_map.h b/code/ryzom/client/src/interface_v3/group_map.h index baf273779..ebfde5c36 100644 --- a/code/ryzom/client/src/interface_v3/group_map.h +++ b/code/ryzom/client/src/interface_v3/group_map.h @@ -192,6 +192,8 @@ public: // target the given landmark void targetLandmark(CCtrlButton *lm); void targetLandmarkResult(uint32 index); + // search matching landmark and target it. return true if landmark was targeted + bool targetLandmarkByName(const ucstring &search, bool startsWith) const; // get the world position of a landmark or return vector Null if not found void getLandmarkPosition(const CCtrlButton *lm, NLMISC::CVector2f &worldPos); @@ -551,6 +553,12 @@ private: // Test title against landmark filter bool filterLandmark(const ucstring &title) const; + bool filterLandmark(const ucstring &title, const std::vector filter, bool startsWith = false) const; + + // return closest landmark which matches (case insensitive) search string + // center position must be in world coordindates + CLandMarkButton* findClosestLandmark(const NLMISC::CVector2f ¢er, const ucstring &search, bool startsWith, const TLandMarkButtonVect &landmarks, float &closest) const; + CLandMarkText* findClosestLandmark(const NLMISC::CVector2f ¢er, const ucstring &search, bool startsWith, const TLandMarkTextVect &landmarks, float &closest) const; // update the scale depending on the window size and the user scale void updateScale(); diff --git a/code/ryzom/client/src/interface_v3/music_player.cpp b/code/ryzom/client/src/interface_v3/music_player.cpp index 3243cdb5b..fe97dd937 100644 --- a/code/ryzom/client/src/interface_v3/music_player.cpp +++ b/code/ryzom/client/src/interface_v3/music_player.cpp @@ -23,6 +23,7 @@ #include "../input.h" #include "../sound_manager.h" #include "interface_manager.h" +#include "../client_cfg.h" using namespace std; using namespace NLMISC; @@ -43,8 +44,6 @@ extern UDriver *Driver; #define MP3_SAVE_SHUFFLE "UI:SAVE:MP3_SHUFFLE" #define MP3_SAVE_REPEAT "UI:SAVE:MP3_REPEAT" -static const std::string MediaPlayerDirectory("music/"); - CMusicPlayer MusicPlayer; // *************************************************************************** @@ -396,7 +395,7 @@ public: // Recursive scan for files from media directory vector filesToProcess; - string newPath = CPath::standardizePath(MediaPlayerDirectory); + string newPath = CPath::standardizePath(ClientCfg.MediaPlayerDirectory); CPath::getPathContent (newPath, true, false, true, filesToProcess); uint i; diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index d45ac7e26..1eb6ec867 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -61,6 +61,7 @@ #include "game_share/bg_downloader_msg.h" #include "misc.h" +#include "user_agent.h" void ConnectToShard(); @@ -783,6 +784,15 @@ void initLoginScreen() ClientApp = ClientCfg.ConfigFile.getVar("Application").asString(0); + // version + std::string ext; + if (ClientApp.find("ryzom_") != ucstring::npos) + ext = " (" + ClientApp.substr(6) + ")"; + + CViewText *pV = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:ver_value")); + if (pV) + pV->setHardText(getDisplayVersion() + (ext.empty() ? "" : ext)); + // give priority to login specified as argument string l = !LoginLogin.empty() ? LoginLogin:ClientCfg.LastLogin; diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index 32b76391b..981bc7c72 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -1081,6 +1081,8 @@ bool mainLoop() ProgressBar.finish(); + bool musicTriggerAutoPlay = true; + // Main loop. If the window is no more Active -> Exit. while( !UserEntity->permanentDeath() && !game_exit ) @@ -1733,7 +1735,7 @@ bool mainLoop() bool wantTraversals = !StereoDisplay || StereoDisplay->isSceneFirst(); bool keepTraversals = StereoDisplay && !StereoDisplay->isSceneLast(); doRenderScene(wantTraversals, keepTraversals); - + if (!StereoDisplay || StereoDisplay->isSceneLast()) { if (fullDetail) @@ -1803,7 +1805,7 @@ bool mainLoop() { displayPACSPrimitive(); } - + // display Sound box if (SoundBox) { @@ -2418,6 +2420,17 @@ bool mainLoop() // Update ingame duration and stat report sending updateStatReport (); + // Auto play once on character login + if (musicTriggerAutoPlay) + { + musicTriggerAutoPlay = false; + if (ClientCfg.SoundOn && ClientCfg.MediaPlayerAutoPlay) + { + MusicPlayer.stop(); + CAHManager::getInstance()->runActionHandler("music_player", NULL, "play_songs"); + MusicPlayer.play(); + } + } // Update the music player MusicPlayer.update (); @@ -2453,6 +2466,9 @@ bool mainLoop() // we have just completed init main loop, after reselecting character // repeat the steps before the main loop itself + // new char, retrigger music autoplay + musicTriggerAutoPlay = true; + // pre main loop in mainLoop resetIngameTime (); diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index e2fa509e2..2f2c8bbad 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -25,7 +25,6 @@ #include "game_share/generic_xml_msg_mngr.h" #include "game_share/msg_client_server.h" #include "game_share/bot_chat_types.h" -#include "game_share/news_types.h" #include "game_share/mode_and_behaviour.h" #include "game_share/chat_group.h" #include "game_share/character_summary.h" diff --git a/code/ryzom/common/data_common/database.xml b/code/ryzom/common/data_common/database.xml index b308427ec..fc7bdd9f6 100644 --- a/code/ryzom/common/data_common/database.xml +++ b/code/ryzom/common/data_common/database.xml @@ -1537,7 +1537,7 @@ type="I4" /> + type="I5" /> diff --git a/code/ryzom/common/data_common/msg.xml b/code/ryzom/common/data_common/msg.xml index 5fb971a17..bf31e7081 100644 --- a/code/ryzom/common/data_common/msg.xml +++ b/code/ryzom/common/data_common/msg.xml @@ -561,6 +561,10 @@ sendto="EGS" format="s" description="client asks EGS to set the guild message of the day" /> + diff --git a/code/ryzom/common/src/game_share/news_types.h b/code/ryzom/common/src/game_share/news_types.h deleted file mode 100644 index e9427766a..000000000 --- a/code/ryzom/common/src/game_share/news_types.h +++ /dev/null @@ -1,36 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// 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 Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#ifndef RY_NEWS_TYPES_H -#define RY_NEWS_TYPES_H - -namespace NEWSTYPE -{ - enum TNewsType - { - Unknown, - General, - FyrosWorker, - FyrosTrainer, - FyrosGeneral, - }; -}; - -#endif // RY_NEWS_TYPES_H - -/* End of news_types.h */ diff --git a/code/ryzom/server/src/admin_modules/as_module.cpp b/code/ryzom/server/src/admin_modules/as_module.cpp index b5f8c6fd1..30dad668d 100644 --- a/code/ryzom/server/src/admin_modules/as_module.cpp +++ b/code/ryzom/server/src/admin_modules/as_module.cpp @@ -221,6 +221,13 @@ namespace ADMIN fclose(fp); } + string rrddirname = CPath::standardizePath (IService::getInstance()->ConfigFile.getVar("RRDVarPath").asString()); + if (!NLMISC::CFile::isExists(rrddirname)) + { + CFile::createDirectory(rrddirname); + CFile::setRWAccess(rrddirname); + } + return true; } diff --git a/code/ryzom/server/src/ai_service/aids_interface.h b/code/ryzom/server/src/ai_service/aids_interface.h index 21b8c76bd..3e9d9898f 100644 --- a/code/ryzom/server/src/ai_service/aids_interface.h +++ b/code/ryzom/server/src/ai_service/aids_interface.h @@ -23,7 +23,6 @@ // Nel Misc #include "nel/misc/types_nl.h" #include "nel/misc/entity_id.h" -#include "game_share/news_types.h" #include "game_share/bot_chat_types.h" // the class diff --git a/code/ryzom/server/src/ai_service/bot_chat_interface.cpp b/code/ryzom/server/src/ai_service/bot_chat_interface.cpp deleted file mode 100644 index 36dc9aa42..000000000 --- a/code/ryzom/server/src/ai_service/bot_chat_interface.cpp +++ /dev/null @@ -1,1160 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// 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 Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#include "stdpch.h" -#if 0 -#error "Deprecated" -//#include "bot_chat_interface.h" -#include "game_share/synchronised_message.h" -#include "game_share/bot_chat_types.h" - -/* -// Nel Misc -#include "nel/net/unified_network.h" - -// Game share -#include "game_share/news_types.h" -#include "game_share/bot_chat_types.h" - -// Local includes -#include "bot_chat_interface.h" -*/ - -using namespace NLMISC; -using namespace NLNET; -using namespace std; - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -// the parent class for bot chat page type classes - -class CBotChatPageType -{ -public: - // virtual interface ---------------------------------------------------- - virtual bool open(const CEntityId &player, const CEntityId &bot)=0; - virtual bool close(const CEntityId &player, const CEntityId &bot)=0; -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for bot chat pages - -struct SBotChatPage -{ - // ctor ----------------------------------------------------------------- - SBotChatPage( - BOTCHATTYPE::TBotChatInterfaceId clientInterfaceId, - CBotChatPageType * chatPageType, - uint numOptions - ) - { - ClientInterfaceId= clientInterfaceId; - PageType= chatPageType; - NumOptions= numOptions; - } - - // data ----------------------------------------------------------------- - BOTCHATTYPE::TBotChatInterfaceId ClientInterfaceId; // id of interface to display on client - CBotChatPageType * PageType; // type of chat page - uint NumOptions; // number of options for player to click on -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for a state for bot chat automatons - -struct SBotChatAutomatonState -{ - // public data ---------------------------------------------------------- - SBotChatPage *Page; - uint On[5]; // value to return on player click of slot 0..4 - - // ctor ----------------------------------------------------------------- - SBotChatAutomatonState(SBotChatPage *page,uint on0=std::numeric_limits::max(),uint on1=std::numeric_limits::max(),uint on2=std::numeric_limits::max(),uint on3=std::numeric_limits::max(),uint on4=std::numeric_limits::max()) - { - Page=page; - On[0]=on0; - On[1]=on1; - On[2]=on2; - On[3]=on3; - On[4]=on4; - - // make sure the number of arguments supplied corresponds to the - // number of options prresent on the user interfac page - nlassert(page->NumOptions>=0 && page->NumOptions<=4); - nlassert(page->NumOptions==0 || On[page->NumOptions-1]!=std::numeric_limits::max()); - nlassert(page->NumOptions==4 || On[page->NumOptions]==std::numeric_limits::max()); - } -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for a bot chat automatons & a singleton for indexing -// automatons by name - -struct SBotChatAutomaton -{ - // public data ---------------------------------------------------------- - string Name; - SBotChatAutomatonState *States; - uint Size; - - // ctor ----------------------------------------------------------------- - SBotChatAutomaton(string name, SBotChatAutomatonState *states,uint size) - { - Name=name; - States=states; - Size=size; - - if (NameMap.find(name)!=NameMap.end()) - { - nlwarning("SBotChatAutomaton::SBotChatAutomaton(): More than one instance with name: %s",name.c_str()); - return; - } - NameMap[name]=this; - } - - // dtor ----------------------------------------------------------------- - ~SBotChatAutomaton() - { - map ::iterator it=NameMap.find(Name); - if (it!=NameMap.end() && (*it).second==this) - NameMap.erase(it); - // don't try to display a warning in a dtor as the warning system is - // probably already down - } - - - // singleton methods ---------------------------------------------------- - static SBotChatAutomaton *getAutomatonByName(string name) - { - map ::iterator it=NameMap.find(name); - if (it==NameMap.end()) - return NULL; - return (*it).second; - } - - // singleton data ------------------------------------------------------- - static map NameMap; -}; -map SBotChatAutomaton::NameMap; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Implementation of different code modules for handling different bot -// chat page types - -////////////////////////////////////////////////////////////////////////////// -// this is a dummy page used to terminate chats - -class CBotChatPageTypeDone: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return false; // stop the bot chat! - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return false; - } -} -BotChatPageTypeDone; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that contains static text and buttons for -// player to click on/ select - -class CBotChatPageTypeTextOnly: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return true; - } -} -BotChatPageTypeTextOnly; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays NEWS as well as other text - -class CBotChatPageTypeNews: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return true; - } -} -BotChatPageTypeNews; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays a SHOP interface - -class CBotChatPageTypeShop: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("player %s entered trade page", player.toString().c_str()); - CMessage msgout( "TRADE_BEGIN" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("end of trade with player %s", player.toString().c_str()); - CMessage msgout( "TRADE_END" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - sendMessageViaMirror( "EGS", msgout ); - return true; - } -} -BotChatPageTypeShop; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays a MISSION SHOP interface - -class CBotChatPageTypeMissionShop: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("player %s entered mission page", player.toString().c_str()); - CMessage msgout( "MISSION_LIST_BEGIN" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("end of mission page with player %s", player.toString().c_str()); - CMessage msgout( "MISSION_LIST_END" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "EGS", msgout ); - return true; - } -} -BotChatPageTypeMissionShop; - - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Definitions of bot chat pages and automatons - -// define the usable bot chat pages ------------------------------------------ -SBotChatPage BotChatPageIntro (BOTCHATTYPE::Intro, &BotChatPageTypeTextOnly, 4); -SBotChatPage BotChatPageFriendly (BOTCHATTYPE::FriendlyMainPage, &BotChatPageTypeNews, 4); -SBotChatPage BotChatPageNeutral (BOTCHATTYPE::NeutralMainPage, &BotChatPageTypeNews, 3); -SBotChatPage BotChatPageHostile (BOTCHATTYPE::NastyMainPage, &BotChatPageTypeTextOnly, 1); -SBotChatPage BotChatPageMoreNews (BOTCHATTYPE::MoreNewsPage, &BotChatPageTypeNews, 2); -SBotChatPage BotChatPageShop (BOTCHATTYPE::BuySellPage, &BotChatPageTypeShop, 2); -SBotChatPage BotChatPageMissionShop (BOTCHATTYPE::MissionsPage, &BotChatPageTypeMissionShop, 2); -SBotChatPage BotChatPageDone (BOTCHATTYPE::Done, &BotChatPageTypeDone, 0); - -// the default automaton ----------------------------------------------------- -SBotChatAutomatonState BotChatStatesDefault[]= -{ - SBotChatAutomatonState(&BotChatPageIntro,2,3,4,1), // 0 - friendly/ neutral/ hostile/ done - SBotChatAutomatonState(&BotChatPageDone), // 1 - SBotChatAutomatonState(&BotChatPageFriendly,5,6,7,1), // 2 - more news/ buy sell/ mission/ done - SBotChatAutomatonState(&BotChatPageNeutral,6,7,1), // 3 - buy sell/ mission/ done - SBotChatAutomatonState(&BotChatPageHostile,1), // 4 - done - SBotChatAutomatonState(&BotChatPageMoreNews,2,1), // 5 - friendly/ done - SBotChatAutomatonState(&BotChatPageShop,3,1), // 6 - neutral/ done - SBotChatAutomatonState(&BotChatPageMissionShop,3,1), // 7 - neutral/ done -}; -SBotChatAutomaton BotChatDefault("default",BotChatStatesDefault,sizeof(BotChatStatesDefault)/sizeof(BotChatStatesDefault[0])); - -// the automaton for merchants ----------------------------------------------- -SBotChatAutomatonState BotChatStatesMerchant[]= -{ - SBotChatAutomatonState(&BotChatPageMoreNews,2,1), // 0 - shop/ done - SBotChatAutomatonState(&BotChatPageDone), // 1 - SBotChatAutomatonState(&BotChatPageShop,0,1), // 2 - news/ done -}; -SBotChatAutomaton BotChatMerchant("merchant",BotChatStatesMerchant,sizeof(BotChatStatesMerchant)/sizeof(BotChatStatesMerchant[0])); - -// the automaton for walkers and talkers ------------------------------------- -SBotChatAutomatonState BotChatStatesWalkerTalker[]= -{ - SBotChatAutomatonState(&BotChatPageHostile,1), // 0 - SBotChatAutomatonState(&BotChatPageDone) // 1 -}; -SBotChatAutomaton BotChatWalkerTalker("walker talker",BotChatStatesWalkerTalker,sizeof(BotChatStatesMerchant)/sizeof(BotChatStatesMerchant[0])); - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Represetnation of a conversation between a player and a bot -// includes conversation automaton state data - -struct CBotChat -{ - CBotChat () : Player(CEntityId::Unknown), Bot(CEntityId::Unknown) { } - CBotChat (CEntityId player, CEntityId bot, SBotChatAutomaton *automaton) - { - Player=player; - Bot=bot; - setAutomaton(automaton); - } - - void setState(uint32 state) - { - if (state>=Automaton->Size && state!=std::numeric_limits::max()) - { - nlwarning("CBotChatEntry()::setState: Invalid state: %d",state); - return; - } - - // if there is already a page open close it - if (CurrentStateSize) - Automaton->States[CurrentState].Page->PageType->close(Player,Bot); - - // open the new page - CurrentState=state; - if (state==std::numeric_limits::max()) - Done=true; - else - Done=!Automaton->States[CurrentState].Page->PageType->open(Player,Bot); - - // transmit the new page id to the client - uint32 happyness=10; - BOTCHATTYPE::TBotChatInterfaceId interfaceId=Done?BOTCHATTYPE::Done:Automaton->States[CurrentState].Page->ClientInterfaceId; - NEWSTYPE::TNewsType newsType=NEWSTYPE::Unknown; - - CMessage msgout("BOT_CHAT_SELECT_INTERFACE"); - msgout.serial (Player); - msgout.serial (happyness); - msgout.serialEnum (interfaceId); - msgout.serialEnum (newsType); - sendMessageViaMirror("IOS", msgout); - } - - void setAutomaton(SBotChatAutomaton *automaton) - { - Automaton=automaton; - CurrentState=std::numeric_limits::max(); // set this to a ~0 so that setState doesn't try to clse existing page - setState(0); - } - - void selectEntry (sint8 userInput) - { - // select the new page - if ((unsigned)userInput >= Automaton->States[CurrentState].Page->NumOptions) - { - nlwarning ("CBotChatEntry::selectEntry: For player %s: input out of bounds: %d", Player.toString().c_str(), userInput); - return; - } - - // advance through the state table - setState(Automaton->States[CurrentState].On[userInput]); - } - - void endChat () - { - setState(std::numeric_limits::max()); - } - - CEntityId Player; - CEntityId Bot; - SBotChatAutomaton *Automaton; - uint32 CurrentState; - bool Done; -}; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Singleton manager class central to the bot chat system - -class CBotChatManager -{ -public: - - static void newChat(CEntityId player, CEntityId bot) - { - // make sure the player isn't already chatting - map::iterator it = BotChatMap.find (player); - if (it != BotChatMap.end()) - return; - - // a bit of logging - nlinfo ("new chat between player %s and bot %s", player.toString().c_str(), bot.toString().c_str()); - - // call the CbBegin() callback to get the name of the automaton to use - string automatonName; - if (CbBegin!=NULL) - automatonName=CbBegin(player,bot); - else - automatonName="default"; - SBotChatAutomaton *automaton=SBotChatAutomaton::getAutomatonByName(automatonName); - if (automaton==NULL) - { - nlwarning("- ignoring bot chat request as automaton '%s' not found",automatonName.c_str()); - return; - } - - // setup the new chat - BotChatMap[player] = CBotChat(player, bot, automaton); - } - - static void endChat(CEntityId player) - { - CEntityId bot; // for use in callback ... at end of routine - - map::iterator it = BotChatMap.find (player); - if (it != BotChatMap.end()) - { - bot=(*it).second.Bot; - - nlinfo ("end of bot chat between player %s and bot %s", player.toString().c_str(),bot.toString().c_str()); - - // if the chat is still active then stop it - if ((*it).second.Done) - (*it).second.endChat(); - - // remove the map entry - BotChatMap.erase (it); - - // **** this code may be dodgy 'cos its in a dtor - // **** if it is dodgy then we need to migrate from an STL map - // **** to some kind of custom structure that we can guarantee OK - } - - if (CbEnd!=NULL) - CbEnd(player,bot); - } - - static void treatInput(CEntityId player, sint8 userInput) - { - // locate the bot chat for the given player - map::iterator it = BotChatMap.find (player); - if (it == BotChatMap.end()) - { - nlwarning ("No bot chat with the player %s", player.toString().c_str()); - return; - } - - // pass the player input to the bot chat handler - (*it).second.selectEntry(userInput); - - // check whether the bot chat is finished - if ((*it).second.Done) - endChat(player); - } - - - // static data for the singleton ----------------------------------------- - static CBotChatInterface::TCallbackBegin CbBegin; - static CBotChatInterface::TCallbackEnd CbEnd; - static map BotChatMap; -}; -CBotChatInterface::TCallbackBegin CBotChatManager::CbBegin; -CBotChatInterface::TCallbackEnd CBotChatManager::CbEnd; -map CBotChatManager::BotChatMap; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// message callbacks and callback table - -static void cbBotChatStart (CMessage& msgin, const string &serviceName, uint16 serviceId ) -{ - CEntityId player, bot; - - msgin.serial( player ); - msgin.serial( bot ); - - CBotChatManager::newChat (player, bot); -} - -static void cbBotChatSelectAnswer (CMessage& msgin, const string &serviceName, uint16 serviceId ) -{ - CEntityId player, bot; - sint8 answer; - - msgin.serial( player ); - msgin.serial( answer ); - - CBotChatManager::treatInput (player, answer); -} - - -static TUnifiedCallbackItem CbArray[]= -{ - { "BOT_CHAT_START", cbBotChatStart }, - { "BOT_CHAT_SELECT_ANSWER", cbBotChatSelectAnswer }, -}; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Interface class providing API for bot chat system - -void CBotChatInterface::init(CBotChatInterface::TCallbackBegin cbBegin,CBotChatInterface::TCallbackEnd cbEnd) -{ - CBotChatManager::CbBegin=cbBegin; - CBotChatManager::CbEnd=cbEnd; - CUnifiedNetwork::getInstance()->addCallbackArray(CbArray, sizeof (CbArray) / sizeof (CbArray[0])); -} - -void CBotChatInterface::release() -{ -} - -void CBotChatInterface::getBotChatPartners(CEntityId bot,vector &result) -{ - map::iterator it; - for (it=CBotChatManager::BotChatMap.begin();it!=CBotChatManager::BotChatMap.end();++it) - if ((*it).second.Bot==bot) - result.push_back((*it).first); -} - -void CBotChatInterface::endChatForPlayer(CEntityId player) -{ - CBotChatManager::endChat(player); -} - -void CBotChatInterface::endAllChatForBot(CEntityId bot) -{ - map::iterator it=CBotChatManager::BotChatMap.begin(); - while (it!=CBotChatManager::BotChatMap.end()) - { - map::iterator next=it; - if ((*it).second.Bot==bot) - CBotChatManager::endChat((*it).first); - it=next; - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -////////////////////// -/// The following is probably out of date but I'm copying it here just in case... - - - -#if 0 - - - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -// the parent class for bot chat page type classes - -class CBotChatPageType -{ -public: - // virtual interface ---------------------------------------------------- - virtual bool open(const CEntityId &player, const CEntityId &bot)=0; - virtual bool close(const CEntityId &player, const CEntityId &bot)=0; -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for bot chat pages - -struct SBotChatPage -{ - // ctor ----------------------------------------------------------------- - SBotChatPage( - BOTCHATTYPE::TBotChatInterfaceId clientInterfaceId, - CBotChatPageType * chatPageType, - uint numOptions - ) - { - ClientInterfaceId= clientInterfaceId; - PageType= chatPageType; - NumOptions= numOptions; - } - - // data ----------------------------------------------------------------- - BOTCHATTYPE::TBotChatInterfaceId ClientInterfaceId; // id of interface to display on client - CBotChatPageType * PageType; // type of chat page - uint NumOptions; // number of options for player to click on -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for a state for bot chat automatons - -struct SBotChatAutomatonState -{ - // public data ---------------------------------------------------------- - SBotChatPage *Page; - uint On[5]; // value to return on player click of slot 0..4 - - // ctor ----------------------------------------------------------------- - SBotChatAutomatonState(SBotChatPage *page,uint on0=std::numeric_limits::max(),uint on1=std::numeric_limits::max(),uint on2=std::numeric_limits::max(),uint on3=std::numeric_limits::max(),uint on4=std::numeric_limits::max()) - { - Page=page; - On[0]=on0; - On[1]=on1; - On[2]=on2; - On[3]=on3; - On[4]=on4; - - // make sure the number of arguments supplied corresponds to the - // number of options prresent on the user interfac page - nlassert(page->NumOptions>=0 && page->NumOptions<=4); - nlassert(page->NumOptions==0 || On[page->NumOptions-1]!=std::numeric_limits::max()); - nlassert(page->NumOptions==4 || On[page->NumOptions]==std::numeric_limits::max()); - } -}; - - -////////////////////////////////////////////////////////////////////////////// -// the structure for a bot chat automatons & a singleton for indexing -// automatons by name - -struct SBotChatAutomaton -{ - // public data ---------------------------------------------------------- - string Name; - SBotChatAutomatonState *States; - uint Size; - - // ctor ----------------------------------------------------------------- - SBotChatAutomaton(string name, SBotChatAutomatonState *states,uint size) - { - Name=name; - States=states; - Size=size; - - if (NameMap.find(name)!=NameMap.end()) - { - nlwarning("SBotChatAutomaton::SBotChatAutomaton(): More than one instance with name: %s",name.c_str()); - return; - } - NameMap[name]=this; - } - - // dtor ----------------------------------------------------------------- - ~SBotChatAutomaton() - { - map ::iterator it=NameMap.find(Name); - if (it!=NameMap.end() && (*it).second==this) - NameMap.erase(it); - // don't try to display a warning in a dtor as the warning system is - // probably already down - } - - - // singleton methods ---------------------------------------------------- - static SBotChatAutomaton *getAutomatonByName(string name) - { - map ::iterator it=NameMap.find(name); - if (it==NameMap.end()) - return NULL; - return (*it).second; - } - - // singleton data ------------------------------------------------------- - static map NameMap; -}; -map SBotChatAutomaton::NameMap; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Implementation of different code modules for handling different bot -// chat page types - -////////////////////////////////////////////////////////////////////////////// -// this is a dummy page used to terminate chats - -class CBotChatPageTypeDone: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return false; // stop the bot chat! - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return false; - } -} -BotChatPageTypeDone; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that contains static text and buttons for -// player to click on/ select - -class CBotChatPageTypeTextOnly: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return true; - } -} -BotChatPageTypeTextOnly; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays NEWS as well as other text - -class CBotChatPageTypeNews: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - return true; - } -} -BotChatPageTypeNews; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays a SHOP interface - -class CBotChatPageTypeShop: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("player %s entered trade page", player.toString().c_str()); - CMessage msgout( "TRADE_BEGIN" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("end of trade with player %s", player.toString().c_str()); - CMessage msgout( "TRADE_END" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - sendMessageViaMirror( "EGS", msgout ); - return true; - } -} -BotChatPageTypeShop; - - -////////////////////////////////////////////////////////////////////////////// -// definition for a chat page that displays a MISSION SHOP interface - -class CBotChatPageTypeMissionShop: public CBotChatPageType -{ -public: - virtual bool open(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("player %s entered mission page", player.toString().c_str()); - CMessage msgout( "MISSION_LIST_BEGIN" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "WOS", msgout ); - return true; - } - - virtual bool close(const CEntityId &player, const CEntityId &bot) - { - nlinfo ("end of mission page with player %s", player.toString().c_str()); - CMessage msgout( "MISSION_LIST_END" ); - msgout.serial( const_cast(player) ); - msgout.serial( const_cast(bot) ); - sendMessageViaMirror( "EGS", msgout ); - return true; - } -} -BotChatPageTypeMissionShop; - - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Definitions of bot chat pages and automatons - -// define the usable bot chat pages ------------------------------------------ -SBotChatPage BotChatPageIntro (BOTCHATTYPE::Intro, &BotChatPageTypeTextOnly, 4); -SBotChatPage BotChatPageFriendly (BOTCHATTYPE::FriendlyMainPage, &BotChatPageTypeNews, 4); -SBotChatPage BotChatPageNeutral (BOTCHATTYPE::NeutralMainPage, &BotChatPageTypeNews, 3); -SBotChatPage BotChatPageHostile (BOTCHATTYPE::NastyMainPage, &BotChatPageTypeTextOnly, 1); -SBotChatPage BotChatPageMoreNews (BOTCHATTYPE::MoreNewsPage, &BotChatPageTypeNews, 2); -SBotChatPage BotChatPageShop (BOTCHATTYPE::BuySellPage, &BotChatPageTypeShop, 2); -SBotChatPage BotChatPageMissionShop (BOTCHATTYPE::MissionsPage, &BotChatPageTypeMissionShop, 2); -SBotChatPage BotChatPageDone (BOTCHATTYPE::Done, &BotChatPageTypeDone, 0); - -// the default automaton ----------------------------------------------------- -SBotChatAutomatonState BotChatStatesDefault[]= -{ - SBotChatAutomatonState(&BotChatPageIntro,2,3,4,1), // 0 - friendly/ neutral/ hostile/ done - SBotChatAutomatonState(&BotChatPageDone), // 1 - SBotChatAutomatonState(&BotChatPageFriendly,5,6,7,1), // 2 - more news/ buy sell/ mission/ done - SBotChatAutomatonState(&BotChatPageNeutral,6,7,1), // 3 - buy sell/ mission/ done - SBotChatAutomatonState(&BotChatPageHostile,1), // 4 - done - SBotChatAutomatonState(&BotChatPageMoreNews,2,1), // 5 - friendly/ done - SBotChatAutomatonState(&BotChatPageShop,3,1), // 6 - neutral/ done - SBotChatAutomatonState(&BotChatPageMissionShop,3,1), // 7 - neutral/ done -}; -SBotChatAutomaton BotChatDefault("default",BotChatStatesDefault,sizeof(BotChatStatesDefault)/sizeof(BotChatStatesDefault[0])); - -// the automaton for merchants ----------------------------------------------- -SBotChatAutomatonState BotChatStatesMerchant[]= -{ - SBotChatAutomatonState(&BotChatPageMoreNews,2,1), // 0 - shop/ done - SBotChatAutomatonState(&BotChatPageDone), // 1 - SBotChatAutomatonState(&BotChatPageShop,0,1), // 2 - news/ done -}; -SBotChatAutomaton BotChatMerchant("merchant",BotChatStatesMerchant,sizeof(BotChatStatesMerchant)/sizeof(BotChatStatesMerchant[0])); - -// the automaton for walkers and talkers ------------------------------------- -SBotChatAutomatonState BotChatStatesWalkerTalker[]= -{ - SBotChatAutomatonState(&BotChatPageHostile,1), // 0 - SBotChatAutomatonState(&BotChatPageDone) // 1 -}; -SBotChatAutomaton BotChatWalkerTalker("walker talker",BotChatStatesWalkerTalker,sizeof(BotChatStatesMerchant)/sizeof(BotChatStatesMerchant[0])); - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Represetnation of a conversation between a player and a bot -// includes conversation automaton state data - -struct CBotChat -{ - CBotChat () : Player(CEntityId::Unknown), Bot(CEntityId::Unknown) { } - CBotChat (CEntityId player, CEntityId bot, SBotChatAutomaton *automaton) - { - Player=player; - Bot=bot; - setAutomaton(automaton); - } - - void setState(uint32 state) - { - if (state>=Automaton->Size && state!=std::numeric_limits::max()) - { - nlwarning("CBotChatEntry()::setState: Invalid state: %d",state); - return; - } - - // if there is already a page open close it - if (CurrentStateSize) - Automaton->States[CurrentState].Page->PageType->close(Player,Bot); - - // open the new page - CurrentState=state; - if (state==std::numeric_limits::max()) - Done=true; - else - Done=!Automaton->States[CurrentState].Page->PageType->open(Player,Bot); - - // transmit the new page id to the client - uint32 happyness=10; - BOTCHATTYPE::TBotChatInterfaceId interfaceId=Done?BOTCHATTYPE::Done:Automaton->States[CurrentState].Page->ClientInterfaceId; - NEWSTYPE::TNewsType newsType=NEWSTYPE::Unknown; - - CMessage msgout("BOT_CHAT_SELECT_INTERFACE"); - msgout.serial (Player); - msgout.serial (happyness); - msgout.serialEnum (interfaceId); - msgout.serialEnum (newsType); - sendMessageViaMirror("IOS", msgout); - } - - void setAutomaton(SBotChatAutomaton *automaton) - { - Automaton=automaton; - CurrentState=std::numeric_limits::max(); // set this to a std::numeric_limits::max() so that setState doesn't try to clse existing page - setState(0); - } - - void selectEntry (sint8 userInput) - { - // select the new page - if ((unsigned)userInput >= Automaton->States[CurrentState].Page->NumOptions) - { - nlwarning ("CBotChatEntry::selectEntry: For player %s: input out of bounds: %d", Player.toString().c_str(), userInput); - return; - } - - // advance through the state table - setState(Automaton->States[CurrentState].On[userInput]); - } - - void endChat () - { - setState(std::numeric_limits::max()); - } - - CEntityId Player; - CEntityId Bot; - SBotChatAutomaton *Automaton; - uint32 CurrentState; - bool Done; -}; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Singleton manager class central to the bot chat system - -class CBotChatManager -{ -public: - - static void newChat(CEntityId player, CEntityId bot) - { - // make sure the player isn't already chatting - map::iterator it = BotChatMap.find (player); - if (it != BotChatMap.end()) - return; - - // a bit of logging - nlinfo ("new chat between player %s and bot %s", player.toString().c_str(), bot.toString().c_str()); - - // call the CbBegin() callback to get the name of the automaton to use - string automatonName; - if (CbBegin!=NULL) - automatonName=CbBegin(player,bot); - else - automatonName="default"; - SBotChatAutomaton *automaton=SBotChatAutomaton::getAutomatonByName(automatonName); - if (automaton==NULL) - { - nlwarning("- ignoring bot chat request as automaton '%s' not found",automatonName.c_str()); - return; - } - - // setup the new chat - BotChatMap[player] = CBotChat(player, bot, automaton); - } - - static void endChat(CEntityId player) - { - CEntityId bot; // for use in callback ... at end of routine - - map::iterator it = BotChatMap.find (player); - if (it != BotChatMap.end()) - { - bot=(*it).second.Bot; - - nlinfo ("end of bot chat between player %s and bot %s", player.toString().c_str(),bot.toString().c_str()); - - // if the chat is still active then stop it - if ((*it).second.Done) - (*it).second.endChat(); - - // remove the map entry - BotChatMap.erase (it); - - // **** this code may be dodgy 'cos its in a dtor - // **** if it is dodgy then we need to migrate from an STL map - // **** to some kind of custom structure that we can guarantee OK - } - - if (CbEnd!=NULL) - CbEnd(player,bot); - } - - static void treatInput(CEntityId player, sint8 userInput) - { - // locate the bot chat for the given player - map::iterator it = BotChatMap.find (player); - if (it == BotChatMap.end()) - { - nlwarning ("No bot chat with the player %s", player.toString().c_str()); - return; - } - - // pass the player input to the bot chat handler - (*it).second.selectEntry(userInput); - - // check whether the bot chat is finished - if ((*it).second.Done) - endChat(player); - } - - - // static data for the singleton ----------------------------------------- - static CBotChatInterface::TCallbackBegin CbBegin; - static CBotChatInterface::TCallbackEnd CbEnd; - static map BotChatMap; -}; -CBotChatInterface::TCallbackBegin CBotChatManager::CbBegin; -CBotChatInterface::TCallbackEnd CBotChatManager::CbEnd; -map CBotChatManager::BotChatMap; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// message callbacks and callback table - -static void cbBotChatStart (CMessage& msgin, const string &serviceName, uint16 serviceId ) -{ - CEntityId player, bot; - - msgin.serial( player ); - msgin.serial( bot ); - - CBotChatManager::newChat (player, bot); -} - -static void cbBotChatSelectAnswer (CMessage& msgin, const string &serviceName, uint16 serviceId ) -{ - CEntityId player, bot; - sint8 answer; - - msgin.serial( player ); - msgin.serial( answer ); - - CBotChatManager::treatInput (player, answer); -} - - -static TUnifiedCallbackItem CbArray[]= -{ - { "BOT_CHAT_START", cbBotChatStart }, - { "BOT_CHAT_SELECT_ANSWER", cbBotChatSelectAnswer }, -}; - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// Interface class providing API for bot chat system - -void CBotChatInterface::init(CBotChatInterface::TCallbackBegin cbBegin,CBotChatInterface::TCallbackEnd cbEnd) -{ - CBotChatManager::CbBegin=cbBegin; - CBotChatManager::CbEnd=cbEnd; - CUnifiedNetwork::getInstance()->addCallbackArray(CbArray, sizeof (CbArray) / sizeof (CbArray[0])); -} - -void CBotChatInterface::release() -{ -} - -void CBotChatInterface::getBotChatPartners(CEntityId bot,vector &result) -{ - map::iterator it; - for (it=CBotChatManager::BotChatMap.begin();it!=CBotChatManager::BotChatMap.end();++it) - if ((*it).second.Bot==bot) - result.push_back((*it).first); -} - -void CBotChatInterface::endChatForPlayer(CEntityId player) -{ - CBotChatManager::endChat(player); -} - -void CBotChatInterface::endAllChatForBot(CEntityId bot) -{ - map::iterator it=CBotChatManager::BotChatMap.begin(); - while (it!=CBotChatManager::BotChatMap.end()) - { - map::iterator next=it; - if ((*it).second.Bot==bot) - CBotChatManager::endChat((*it).first); - it=next; - } -} - -#endif - -#endif diff --git a/code/ryzom/server/src/ai_service/bot_chat_interface.h b/code/ryzom/server/src/ai_service/bot_chat_interface.h deleted file mode 100644 index 3586b737f..000000000 --- a/code/ryzom/server/src/ai_service/bot_chat_interface.h +++ /dev/null @@ -1,58 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// 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 Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#error "Deprecated" - -#ifndef RYAI_BOT_CHAT_INTERFACE_H -#define RYAI_BOT_CHAT_INTERFACE_H - -// Nel Misc -#include "nel/misc/types_nl.h" -#include "nel/misc/entity_id.h" -#include "game_share/news_types.h" -#include "game_share/bot_chat_types.h" - -// the class -class CBotChatInterface -{ -public: - // the callback type for user callbacks for start of bot chat - // returns the name of the bot chat automaton to use - // if an empty string is returned no bot chat is launched - typedef std::string (*TCallbackBegin)(NLMISC::CEntityId player,NLMISC::CEntityId bot); - - // the callback types for user callback for end of bot chat - // called just after the chat session has been closed - typedef void (*TCallbackEnd)(NLMISC::CEntityId player,NLMISC::CEntityId bot); - -public: - // classic init() and release() - static void init(TCallbackBegin cbBegin=NULL,TCallbackEnd cbEnd=NULL); - static void release(); - - // build a vector of the players currently chatting with a given bot - // this routine may not be very fast as the entire bot chat map is - // parsed in order to build the vector - static void getBotChatPartners(NLMISC::CEntityId bot,std::vector &result); - - // routines to force the end of a bot chat - static void endChatForPlayer(NLMISC::CEntityId player); - static void endAllChatForBot(NLMISC::CEntityId bot); -}; - -#endif diff --git a/code/ryzom/server/src/entities_game_service/database_plr.h b/code/ryzom/server/src/entities_game_service/database_plr.h index 887ef483e..4ec5b8d0f 100644 --- a/code/ryzom/server/src/entities_game_service/database_plr.h +++ b/code/ryzom/server/src/entities_game_service/database_plr.h @@ -9157,7 +9157,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { // Check that the value is not out of database precision - STOP_IF(value > (1<<4)-1, "setSTATUS : Value out of bound : trying to store "< (1<<5)-1, "setSTATUS : Value out of bound : trying to store "< -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// 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 Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - -#include "stdpch.h" -#include "news_manager.h" -#include "input_output_service.h" - -//#include "game_share/generic_msg_mngr.h" -#include "game_share/msg_client_server.h" -#include "game_share/news_types.h" - -using namespace std; -using namespace NLMISC; -using namespace NLNET; - -class CNewsEntry -{ -public: - CNewsEntry () : Type(NEWSTYPE::Unknown) { } - CNewsEntry (NEWSTYPE::TNewsType type, const string &stringId, const vector &args) : Type(type), StringId(StringId), Args(args) { } - - NEWSTYPE::TNewsType Type; - string StringId; - vector Args; -}; - -deque News; - -static void cbAddNews (CMessage& msgin, const std::string &serviceName, TServiceId serviceId ) -{ - NEWSTYPE::TNewsType type = NEWSTYPE::Unknown; - string stringId; - vector args; - - msgin.serialEnum (type); - msgin.serial (stringId); - msgin.serialCont (args); - - News.push_back(CNewsEntry(type, stringId, args)); - - nlinfo ("added news %s for type %d from service %s", stringId.c_str(), type, serviceName.c_str()); -} - - -static TUnifiedCallbackItem CbArray[]= -{ - { "ADD_NEWS", cbAddNews }, -}; - - -void CNewsManager::init() -{ - CUnifiedNetwork::getInstance()->addCallbackArray(CbArray, sizeof (CbArray) / sizeof (CbArray[0])); -} - - -void CNewsManager::getNews (NEWSTYPE::TNewsType type, CBitMemStream &bms) -{ - nlassert (type != NEWSTYPE::Unknown); - - sint val = (sint)frand ((float)News.size()); - - string res; - //CChatManager::getStaticDB ().getInfos (News[val].stringId, res, bms); - nlinfo ("sending news '%s' '%s' with %d args", News[val].StringId.c_str(), res.c_str(), News[val].Args.size()); - - //bms.serial (News[val].stringId); - bms.serialCont (News[val].Args); -} diff --git a/code/ryzom/server/src/input_output_service/news_manager.h b/code/ryzom/server/src/input_output_service/news_manager.h deleted file mode 100644 index dee34e5be..000000000 --- a/code/ryzom/server/src/input_output_service/news_manager.h +++ /dev/null @@ -1,60 +0,0 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// 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 Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - - -#ifndef NEWS_MANAGER_H -#define NEWS_MANAGER_H - - -// misc -#include "nel/misc/types_nl.h" -#include "nel/misc/bit_mem_stream.h" - -// game share -#include "game_share/ryzom_entity_id.h" -//#include "game_share/chat_static_database.h" -//#include "game_share/chat_dynamic_database.h" -#include "game_share/news_types.h" - -// std -#include -#include - - -/** - * CNewsManager - * \author Vianney Lecroart - * \author Nevrax France - * \date 2002 - */ -class CNewsManager -{ -public : - - /** - * Init the manager. - */ - static void init (); - - /// return a news of a given type - static void getNews (NEWSTYPE::TNewsType type, NLMISC::CBitMemStream &bms); -}; - - -#endif // NEWS_MANAGER_H - -/* End of news_manager.h */ diff --git a/code/ryzom/server/src/input_output_service/stdpch.h b/code/ryzom/server/src/input_output_service/stdpch.h index 17f5e6bc5..67599f732 100644 --- a/code/ryzom/server/src/input_output_service/stdpch.h +++ b/code/ryzom/server/src/input_output_service/stdpch.h @@ -74,7 +74,6 @@ #include "game_share/mirror_prop_value.h" #include "game_share/mode_and_behaviour.h" #include "game_share/msg_client_server.h" -#include "game_share/news_types.h" #include "game_share/people.h" #include "game_share/player_visual_properties.h" #include "game_share/power_types.h" diff --git a/code/ryzom/server/src/input_output_service/string_manager_parser.cpp b/code/ryzom/server/src/input_output_service/string_manager_parser.cpp index ef55570f9..79d0aba50 100644 --- a/code/ryzom/server/src/input_output_service/string_manager_parser.cpp +++ b/code/ryzom/server/src/input_output_service/string_manager_parser.cpp @@ -242,9 +242,17 @@ public: return; } + // no _wk file or empty if (addition.size() == 0) return; + // no _lang file or empty + if (reference.size() == 0) + { + text = prepareExcelSheet(addition); + return; + } + // create missing columns in reference and addition to make the diff for (uint i=0; i +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Ring Islands Textures" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "r2_islands_textures" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/ryzom/tools/leveldesign/georges_dll/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_dll/CMakeLists.txt index 731e9e161..4144228d4 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/georges_dll/CMakeLists.txt @@ -1,7 +1,9 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) -ADD_LIBRARY(georges_dll SHARED ${SRC} georges_edit.rc) +SOURCE_GROUP("" FILES ${SRC}) + +ADD_LIBRARY(georges_dll SHARED ${SRC}) INCLUDE_DIRECTORIES(${NEL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) diff --git a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.rc b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.rc index d8ef47a49..24a4a259a 100644 --- a/code/ryzom/tools/leveldesign/georges_dll/georges_edit.rc +++ b/code/ryzom/tools/leveldesign/georges_dll/georges_edit.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -52,6 +52,8 @@ BEGIN "#include ""res\\georges_edit.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "#include ""afxres.rc"" // Standard components\r\n" "#endif\r\n" + "\r\n" + "#include ""version.rc2""\r\n" "\0" END @@ -452,18 +454,6 @@ END // Dialog // -IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About Georges Edit" -FONT 8, "MS Sans Serif" -BEGIN - ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 - LTEXT "Georges Edit Version 1.24",IDC_STATIC,40,10,119,8, - SS_NOPREFIX - LTEXT "Nevrax Copyright (C) 2002",IDC_STATIC,40,25,119,8 - DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP -END - IDR_MAINFRAME DIALOG DISCARDABLE 0, 0, 330, 16 STYLE WS_CHILD FONT 8, "MS Sans Serif" @@ -522,52 +512,6 @@ BEGIN END -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "\0" - VALUE "FileDescription", "Georges Edit MFC Application\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "Georges Edit\0" - VALUE "LegalCopyright", "Copyright (C) 2002\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "georges_edit.EXE\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Georges Edit Application\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -788,18 +732,6 @@ BEGIN ID_BUTTON32803 "Hold content in buffer 4\nHold 4" END -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // @@ -833,7 +765,7 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -856,6 +788,8 @@ LANGUAGE 9, 1 #include "afxres.rc" // Standard components #endif +#include "version.rc2" + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/ryzom/tools/leveldesign/georges_dll/version.rc2 b/code/ryzom/tools/leveldesign/georges_dll/version.rc2 new file mode 100644 index 000000000..450a9414d --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_dll/version.rc2 @@ -0,0 +1,62 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "_r" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Georges Edit dynamic library" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "georges" NL_FILEEXT ".dll" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About Georges Edit" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 + LTEXT NL_VERSION,IDC_STATIC,40,10,119,8,SS_NOPREFIX + LTEXT COPYRIGHT,IDC_STATIC,40,25,119,8 + DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/ryzom/tools/leveldesign/georges_exe/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_exe/CMakeLists.txt index 07ac799c9..96b0a99f5 100644 --- a/code/ryzom/tools/leveldesign/georges_exe/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/georges_exe/CMakeLists.txt @@ -1,12 +1,14 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) ADD_DEFINITIONS(${MFC_DEFINITIONS}) SET(CMAKE_MFC_FLAG 2) -ADD_EXECUTABLE(georges_exe WIN32 ${SRC} georges_exe.rc) +ADD_EXECUTABLE(georges WIN32 ${SRC}) -TARGET_LINK_LIBRARIES(georges_exe nelmisc nelgeorges georges_dll) +TARGET_LINK_LIBRARIES(georges nelmisc nelgeorges georges_dll) -NL_DEFAULT_PROPS(georges_exe "Ryzom, Tools, Georges: Georges Exe") -NL_ADD_RUNTIME_FLAGS(georges_exe) +NL_DEFAULT_PROPS(georges "Ryzom, Tools, Georges: Georges Exe") +NL_ADD_RUNTIME_FLAGS(georges) -INSTALL(TARGETS georges_exe RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) +INSTALL(TARGETS georges RUNTIME DESTINATION ${RYZOM_BIN_PREFIX} COMPONENT tools) diff --git a/code/ryzom/tools/leveldesign/georges_exe/georges_exe.rc b/code/ryzom/tools/leveldesign/georges_exe/georges_exe.rc index b2d0d350a..17323ea94 100644 --- a/code/ryzom/tools/leveldesign/georges_exe/georges_exe.rc +++ b/code/ryzom/tools/leveldesign/georges_exe/georges_exe.rc @@ -13,11 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 @@ -52,13 +52,13 @@ END 3 TEXTINCLUDE DISCARDABLE BEGIN - "\r\n" + "#include ""version.rc2""\r\n" "\0" END #endif // APSTUDIO_INVOKED -#endif // English (U.S.) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -68,7 +68,7 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - +#include "version.rc2" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/ryzom/tools/leveldesign/georges_exe/version.rc2 b/code/ryzom/tools/leveldesign/georges_exe/version.rc2 new file mode 100644 index 000000000..2fd036bc9 --- /dev/null +++ b/code/ryzom/tools/leveldesign/georges_exe/version.rc2 @@ -0,0 +1,51 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Georges Edit" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "georges" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt b/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt index f9321152c..be86f6a50 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/mission_compiler_fe/CMakeLists.txt @@ -1,8 +1,10 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2 res/*.rc2 res/*.ico) + +SOURCE_GROUP("" FILES ${SRC}) ADD_DEFINITIONS(${MFC_DEFINITIONS}) SET(CMAKE_MFC_FLAG 2) -ADD_EXECUTABLE(ryzom_mission_compiler_fe WIN32 ${SRC} mission_compiler_fe.rc) +ADD_EXECUTABLE(ryzom_mission_compiler_fe WIN32 ${SRC}) TARGET_LINK_LIBRARIES(ryzom_mission_compiler_fe nelmisc nelligo ryzom_mission_compiler_lib) diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/Resource.h b/code/ryzom/tools/leveldesign/mission_compiler_fe/Resource.h index 28608ab10..9f7b75159 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_fe/Resource.h +++ b/code/ryzom/tools/leveldesign/mission_compiler_fe/Resource.h @@ -1,21 +1,5 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// 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 Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - //{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. +// Microsoft Visual C++ generated include file. // Used by mission_compiler_fe.rc // #define IDM_ABOUTBOX 0x0010 diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_fe.rc b/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_fe.rc index 64ac8c1d2..812261b50 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_fe.rc +++ b/code/ryzom/tools/leveldesign/mission_compiler_fe/mission_compiler_fe.rc @@ -1,4 +1,4 @@ -//Microsoft Developer Studio generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" @@ -13,29 +13,18 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_ICON_FILTER ICON DISCARDABLE "res\\icon_fil.ico" ///////////////////////////////////////////////////////////////////////////// // // Menu // -IDR_MENU1 MENU DISCARDABLE +IDR_MENU1 MENU BEGIN POPUP "Special" BEGIN @@ -50,13 +39,64 @@ END // Dialog // -IDD_DIALOG_ADD_PATH DIALOG DISCARDABLE 0, 0, 283, 46 -STYLE WS_POPUP | WS_CAPTION +IDD_DIALOG_ADD_PATH DIALOG 0, 0, 283, 46 +STYLE DS_SETFONT | WS_POPUP | WS_CAPTION CAPTION "Init compiler..." FONT 8, "MS Sans Serif" BEGIN - EDITTEXT IDC_ADD_PATH,7,7,269,32,ES_MULTILINE | ES_AUTOVSCROLL | - ES_AUTOHSCROLL | ES_READONLY + EDITTEXT IDC_ADD_PATH,7,7,269,32,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY +END + +IDD_MISSION_COMPILER_FE_DIALOG DIALOGEX 0, 0, 361, 322 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "Primitive tool" +MENU IDR_MENU1 +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "&COMPILE",IDC_COMPILE,155,242,50,14,WS_DISABLED + PUSHBUTTON "&QUIT",IDCANCEL,156,301,50,14 + LISTBOX IDC_LIST_SRC,7,125,136,190,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP + LISTBOX IDC_LIST_DST,218,113,136,202,LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP + CTEXT "Available Primitive files",IDC_STATIC,7,90,136,11 + CTEXT "Selected primitive",IDC_STATIC,218,90,136,15 + PUSHBUTTON ">>",IDC_ADD,156,128,50,16 + PUSHBUTTON "<<",IDC_REMOVE,156,175,50,16 + PUSHBUTTON "Change directory ...",IDC_CHANGE_DIR,7,7,72,16 + PUSHBUTTON "ALL >>",IDC_ADD_ALL,156,146,50,16 + EDITTEXT IDC_FILTER,32,104,112,14,ES_AUTOHSCROLL + ICON IDI_ICON_FILTER,IDC_STATIC,8,104,21,20,SS_REALSIZEIMAGE + DEFPUSHBUTTON "COMPILE &PUBLISH",IDC_PUBLISH,155,259,50,26,BS_MULTILINE | WS_DISABLED + PUSHBUTTON "&VALIDATE",IDC_VALIDATE,155,225,50,14,WS_DISABLED + EDITTEXT IDC_DATA_DIRECTORY,89,7,265,15,ES_AUTOHSCROLL + LTEXT "",IDC_PATH_WARNING,105,28,235,8 + GROUPBOX "Publish to the following servers",IDC_STATIC,62,38,254,45 + CONTROL "Server 1",IDC_CHECK_SRV1,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,74,50,41,10 + CONTROL "Server 2",IDC_CHECK_SRV2,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,74,66,41,10 + CONTROL "Server 3",IDC_CHECK_SRV3,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,126,50,41,10 + CONTROL "Server4",IDC_CHECK_SRV4,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,126,66,41,10 + CONTROL "Server 5",IDC_CHECK_SRV5,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,188,50,41,10 + CONTROL "Server 6",IDC_CHECK_SRV6,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,188,66,41,10 + CONTROL "Server 7",IDC_CHECK_SRV7,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,252,50,39,11 + CONTROL "Server 8",IDC_CHECK_SRV8,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,252,64,42,13 +END + +IDD_COMPIL DIALOG 0, 0, 294, 178 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION +CAPTION "Compilation status" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_COMPIL_LOG,7,7,280,148,ES_MULTILINE | ES_READONLY | WS_VSCROLL | WS_HSCROLL + PUSHBUTTON "Ok",IDOK,228,158,59,16,WS_DISABLED +END + +IDD_DIALOG_MODE DIALOG 0, 0, 155, 76 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Choose Tool Mode" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Compile mission",ID_MODE_COMPILE,7,14,141,23 + PUSHBUTTON "Publish primitive",ID_MODE_PUBLISH,7,46,141,23,WS_DISABLED END @@ -66,7 +106,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO BEGIN IDD_DIALOG_ADD_PATH, DIALOG BEGIN @@ -78,18 +118,6 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // @@ -98,136 +126,9 @@ LANGUAGE LANG_FRENCH, SUBLANG_FRENCH // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDR_MAINFRAME ICON DISCARDABLE "res\\mission_compiler_fe.ico" -IDI_ICON_FILTER ICON DISCARDABLE "res\\icon_fil.ico" +IDR_MAINFRAME ICON "res\\red_pill.ico" -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "A propos de mission_compiler_fe" -FONT 8, "MS Sans Serif" -BEGIN - ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 - LTEXT "mission_compiler_fe version 1.0",IDC_STATIC,40,10,119,8, - SS_NOPREFIX - LTEXT "Copyright (C) 2004",IDC_STATIC,40,25,119,8 - DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP -END - -IDD_MISSION_COMPILER_FE_DIALOG DIALOGEX 0, 0, 361, 322 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_APPWINDOW -CAPTION "Primitive tool" -MENU IDR_MENU1 -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "&COMPILE",IDC_COMPILE,155,242,50,14,WS_DISABLED - PUSHBUTTON "&QUIT",IDCANCEL,156,301,50,14 - LISTBOX IDC_LIST_SRC,7,125,136,190,LBS_SORT | - LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | - WS_HSCROLL | WS_TABSTOP - LISTBOX IDC_LIST_DST,218,113,136,202,LBS_SORT | - LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | - WS_TABSTOP - CTEXT "Available Primitive files",IDC_STATIC,7,90,136,11 - CTEXT "Selected primitive",IDC_STATIC,218,90,136,15 - PUSHBUTTON ">>",IDC_ADD,156,128,50,16 - PUSHBUTTON "<<",IDC_REMOVE,156,175,50,16 - PUSHBUTTON "Change directory ...",IDC_CHANGE_DIR,7,7,72,16 - PUSHBUTTON "ALL >>",IDC_ADD_ALL,156,146,50,16 - EDITTEXT IDC_FILTER,32,104,112,14,ES_AUTOHSCROLL - ICON IDI_ICON_FILTER,IDC_STATIC,8,104,21,20,SS_REALSIZEIMAGE - DEFPUSHBUTTON "COMPILE &PUBLISH",IDC_PUBLISH,155,259,50,26, - BS_MULTILINE | WS_DISABLED - PUSHBUTTON "&VALIDATE",IDC_VALIDATE,155,225,50,14,WS_DISABLED - EDITTEXT IDC_DATA_DIRECTORY,89,7,265,15,ES_AUTOHSCROLL - LTEXT "",IDC_PATH_WARNING,105,28,235,8 - GROUPBOX "Publish to the following servers",IDC_STATIC,62,38,254, - 45 - CONTROL "Server 1",IDC_CHECK_SRV1,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,74,50,41,10 - CONTROL "Server 2",IDC_CHECK_SRV2,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,74,66,41,10 - CONTROL "Server 3",IDC_CHECK_SRV3,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,126,50,41,10 - CONTROL "Server4",IDC_CHECK_SRV4,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,126,66,41,10 - CONTROL "Server 5",IDC_CHECK_SRV5,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,188,50,41,10 - CONTROL "Server 6",IDC_CHECK_SRV6,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,188,66,41,10 - CONTROL "Server 7",IDC_CHECK_SRV7,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,252,50,39,11 - CONTROL "Server 8",IDC_CHECK_SRV8,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,252,64,42,13 -END - -IDD_COMPIL DIALOG DISCARDABLE 0, 0, 294, 178 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION -CAPTION "Compilation status" -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_COMPIL_LOG,7,7,280,148,ES_MULTILINE | ES_READONLY | - WS_VSCROLL | WS_HSCROLL - PUSHBUTTON "Ok",IDOK,228,158,59,16,WS_DISABLED -END - -IDD_DIALOG_MODE DIALOG DISCARDABLE 0, 0, 155, 76 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Choose Tool Mode" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "Compile mission",ID_MODE_COMPILE,7,14,141,23 - PUSHBUTTON "Publish primitive",ID_MODE_PUBLISH,7,46,141,23, - WS_DISABLED -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_ABOUTBOX, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 228 - TOPMARGIN, 7 - BOTTOMMARGIN, 48 - END - - IDD_MISSION_COMPILER_FE_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 354 - TOPMARGIN, 7 - BOTTOMMARGIN, 315 - END - - IDD_COMPIL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 287 - TOPMARGIN, 7 - BOTTOMMARGIN, 174 - END - - IDD_DIALOG_MODE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 148 - TOPMARGIN, 7 - BOTTOMMARGIN, 69 - END -END -#endif // APSTUDIO_INVOKED +IDI_ICON_FILTER ICON "res\\icon_fil.ico" #ifdef APSTUDIO_INVOKED @@ -236,18 +137,18 @@ END // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE BEGIN "#define _AFX_NO_SPLITTER_RESOURCES\r\n" "#define _AFX_NO_OLE_RESOURCES\r\n" @@ -262,66 +163,25 @@ BEGIN "#include ""res\\mission_compiler_fe.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "#include ""l.fra\\afxres.rc"" // Standard components\r\n" "#endif\r\n" + "\r\n" + "#include ""version.rc2""\r\n" "\0" END #endif // APSTUDIO_INVOKED -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040C04B0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "Application MFC mission_compiler_fe\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "mission_compiler_fe\0" - VALUE "LegalCopyright", "Copyright (C) 2004\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "mission_compiler_fe.EXE\0" - VALUE "ProductName", "Application mission_compiler_fe\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x40c, 1200 - END -END - -#endif // !_MAC - - ///////////////////////////////////////////////////////////////////////////// // // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN - IDS_ABOUTBOX "&A propos de mission_compiler_fe..." + IDS_ABOUTBOX "&About Ryzom Mission Compiler..." END -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -345,6 +205,8 @@ LANGUAGE 12, 1 #include "l.fra\afxres.rc" // Standard components #endif +#include "version.rc2" + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/res/mission_compiler_fe.ico b/code/ryzom/tools/leveldesign/mission_compiler_fe/res/mission_compiler_fe.ico deleted file mode 100644 index 7eef0bcbe..000000000 Binary files a/code/ryzom/tools/leveldesign/mission_compiler_fe/res/mission_compiler_fe.ico and /dev/null differ diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/res/red_pill.ico b/code/ryzom/tools/leveldesign/mission_compiler_fe/res/red_pill.ico new file mode 100644 index 000000000..c5f250583 Binary files /dev/null and b/code/ryzom/tools/leveldesign/mission_compiler_fe/res/red_pill.ico differ diff --git a/code/ryzom/tools/leveldesign/mission_compiler_fe/version.rc2 b/code/ryzom/tools/leveldesign/mission_compiler_fe/version.rc2 new file mode 100644 index 000000000..46d1c9fae --- /dev/null +++ b/code/ryzom/tools/leveldesign/mission_compiler_fe/version.rc2 @@ -0,0 +1,62 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Mission Compiler Frontend" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "ryzom_mission_compiler_fe" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About Ryzom Mission Compiler Frontend" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 + LTEXT NL_VERSION,IDC_STATIC,40,10,119,8,SS_NOPREFIX + LTEXT COPYRIGHT,IDC_STATIC,40,25,119,8 + DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/ryzom/tools/leveldesign/prim_export/CMakeLists.txt b/code/ryzom/tools/leveldesign/prim_export/CMakeLists.txt index 8fbd3912e..4902ee92b 100644 --- a/code/ryzom/tools/leveldesign/prim_export/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/prim_export/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(prim_export ${SRC}) diff --git a/code/ryzom/tools/leveldesign/prim_export/blue_pill.ico b/code/ryzom/tools/leveldesign/prim_export/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/ryzom/tools/leveldesign/prim_export/blue_pill.ico differ diff --git a/code/ryzom/tools/leveldesign/prim_export/main.rc b/code/ryzom/tools/leveldesign/prim_export/main.rc new file mode 100644 index 000000000..a7683d96a --- /dev/null +++ b/code/ryzom/tools/leveldesign/prim_export/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Prim Export" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "prim_export" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/ryzom/tools/leveldesign/world_editor/land_export/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/land_export/CMakeLists.txt index e1f7fe88c..f51b470db 100644 --- a/code/ryzom/tools/leveldesign/world_editor/land_export/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/land_export/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(land_export ${SRC}) diff --git a/code/ryzom/tools/leveldesign/world_editor/land_export/blue_pill.ico b/code/ryzom/tools/leveldesign/world_editor/land_export/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/ryzom/tools/leveldesign/world_editor/land_export/blue_pill.ico differ diff --git a/code/ryzom/tools/leveldesign/world_editor/land_export/main.rc b/code/ryzom/tools/leveldesign/world_editor/land_export/main.rc new file mode 100644 index 000000000..879fa8040 --- /dev/null +++ b/code/ryzom/tools/leveldesign/world_editor/land_export/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Land Export" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "land_export" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/CMakeLists.txt b/code/ryzom/tools/leveldesign/world_editor/world_editor/CMakeLists.txt index c7258d869..d6eb6c304 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc *.rc2) + +SOURCE_GROUP("" FILES ${SRC}) LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/export_cb_dlg.cpp ${CMAKE_CURRENT_SOURCE_DIR}/builder_logic.cpp) @@ -6,12 +8,10 @@ ENABLE_LANGUAGE(RC) ADD_DEFINITIONS(${MFC_DEFINITIONS}) SET(CMAKE_MFC_FLAG 2) -ADD_EXECUTABLE(world_editor WIN32 ${SRC} world_editor.rc) +ADD_EXECUTABLE(world_editor WIN32 ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -SOURCE_GROUP(Resources FILES world_editor.rc) - TARGET_LINK_LIBRARIES(world_editor nelmisc nelligo diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/resource.h b/code/ryzom/tools/leveldesign/world_editor/world_editor/resource.h index 2a294d748..d90a7e8c0 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/resource.h +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/resource.h @@ -1,21 +1,5 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// 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 Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - //{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. +// Microsoft Visual C++ generated include file. // Used by world_editor.rc // #define IDC_BROWSE 3 @@ -341,7 +325,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 178 +#define _APS_NEXT_RESOURCE_VALUE 179 #define _APS_NEXT_COMMAND_VALUE 33485 #define _APS_NEXT_CONTROL_VALUE 1022 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/tools_zone.cpp b/code/ryzom/tools/leveldesign/world_editor/world_editor/tools_zone.cpp index bcb46cd6c..23e8aaec0 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/tools_zone.cpp +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/tools_zone.cpp @@ -118,13 +118,12 @@ const string &CToolsZoneList::getItem (uint32 nIndex) void CToolsZoneList::DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct) { ASSERT(lpDrawItemStruct->CtlType == ODT_LISTBOX); - LPCTSTR lpszText = (LPCTSTR) lpDrawItemStruct->itemData; - if (lpszText == NULL) - return; CDC dc; if (lpDrawItemStruct->itemID >= _BitmapList.size()) return; + if (lpDrawItemStruct->itemID >= _ItemNames.size()) + return; dc.Attach (lpDrawItemStruct->hDC); @@ -168,7 +167,8 @@ void CToolsZoneList::DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct) } // Draw the text. - dc.DrawText (lpszText, _tcslen(lpszText), &rectLeft, DT_CENTER|DT_SINGLELINE|DT_VCENTER); + NLMISC::tstring itemName = NLMISC::utf8ToTStr(_ItemNames[lpDrawItemStruct->itemID]); + dc.DrawText(itemName.c_str(), itemName.size(), &rectLeft, DT_CENTER|DT_SINGLELINE|DT_VCENTER); // Reset the background color and the text color back to their original values. dc.SetTextColor (crOldTextColor); diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/version.rc2 b/code/ryzom/tools/leveldesign/world_editor/world_editor/version.rc2 new file mode 100644 index 000000000..a11050b22 --- /dev/null +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/version.rc2 @@ -0,0 +1,64 @@ + +#ifndef NL_VERSION_RC2 +#define NL_VERSION_RC2 + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(65001) + +#include +#include "config.h" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom World Editor" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "world_editor" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 73 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About World Editor" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 + LTEXT NL_VERSION,IDC_TITLE_VERSION,40,10,96,8,SS_NOPREFIX + LTEXT COPYRIGHT,IDC_STATIC,40,25,119,8 + DEFPUSHBUTTON "OK",IDOK,178,8,50,14,WS_GROUP + LTEXT "Allocated Video Mem :",IDC_STATIC,15,43,73,16 + LTEXT "Static",IDC_STATIC_VIDEO_MEM,97,43,87,16 +END + +#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */ +#endif /* #ifndef NL_VERSION_RC2 */ diff --git a/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.rc b/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.rc index ce46045e4..6a03f0390 100644 --- a/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.rc +++ b/code/ryzom/tools/leveldesign/world_editor/world_editor/world_editor.rc @@ -1,4 +1,4 @@ -//Microsoft Developer Studio generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" @@ -13,13 +13,11 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// English resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL #pragma code_page(1252) -#endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -27,18 +25,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE BEGIN "#define _AFX_NO_OLE_RESOURCES\r\n" "#define _AFX_NO_TRACKER_RESOURCES\r\n" @@ -54,6 +52,8 @@ BEGIN "#include ""afxprint.rc"" // printing/print preview resources\r\n" "#include ""afxdb.rc"" // Database resources\r\n" "#endif\r\n" + "\r\n" + "#include ""version.rc2""\r\n" "\0" END @@ -67,41 +67,63 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDR_MAINFRAME ICON DISCARDABLE "res\\world_editor.ico" -IDR_WORLDETYPE ICON DISCARDABLE "res\\world_editor_doc.ico" -IDI_FOLDER_CLOSED ICON DISCARDABLE "res\\folder_closed.ico" -IDI_POINT_OPENED ICON DISCARDABLE "res\\point_opened.ico" -IDI_LINE_OPENED ICON DISCARDABLE "res\\line_opened.ico" -IDI_ZONE_OPENED ICON DISCARDABLE "res\\zone_opened.ico" -IDI_FOLDER_OPENED ICON DISCARDABLE "res\\folder_opened.ico" -IDI_PROPERTY_CLOSED ICON DISCARDABLE "res\\property_closed.ico" -IDI_ROOT_CLOSED ICON DISCARDABLE "res\\root_closed.ico" -IDI_PROPERTY_OPENED ICON DISCARDABLE "res\\property_opened.ico" -IDI_LINE_CLOSED ICON DISCARDABLE "res\\line_closed.ico" -IDI_POINT_CLOSED ICON DISCARDABLE "res\\point_closed.ico" -IDI_ZONE_CLOSED ICON DISCARDABLE "res\\zone_closed.ico" -IDI_ROOT_OPENED ICON DISCARDABLE "res\\root_opened.ico" -IDI_FOLDER_HIDDEN ICON DISCARDABLE "res\\folder_hidden.ico" -IDI_LINE_HIDDEN ICON DISCARDABLE "res\\line_hidden.ico" -IDI_POINT_HIDDEN ICON DISCARDABLE "res\\point_hidden.ico" -IDI_PROPERTY_HIDDEN ICON DISCARDABLE "res\\property_hidden.ico" -IDI_ROOT_HIDDEN ICON DISCARDABLE "res\\root_hidden.ico" -IDI_ZONE_HIDDEN ICON DISCARDABLE "res\\zone_hidden.ico" -IDI_ERROR_STRUCTURE ICON DISCARDABLE "res\\erro.ico" +IDR_MAINFRAME ICON "res\\world_editor.ico" + +IDR_WORLDETYPE ICON "res\\world_editor_doc.ico" + +IDI_FOLDER_CLOSED ICON "res\\folder_closed.ico" + +IDI_POINT_OPENED ICON "res\\point_opened.ico" + +IDI_LINE_OPENED ICON "res\\line_opened.ico" + +IDI_ZONE_OPENED ICON "res\\zone_opened.ico" + +IDI_FOLDER_OPENED ICON "res\\folder_opened.ico" + +IDI_PROPERTY_CLOSED ICON "res\\property_closed.ico" + +IDI_ROOT_CLOSED ICON "res\\root_closed.ico" + +IDI_PROPERTY_OPENED ICON "res\\property_opened.ico" + +IDI_LINE_CLOSED ICON "res\\line_closed.ico" + +IDI_POINT_CLOSED ICON "res\\point_closed.ico" + +IDI_ZONE_CLOSED ICON "res\\zone_closed.ico" + +IDI_ROOT_OPENED ICON "res\\root_opened.ico" + +IDI_FOLDER_HIDDEN ICON "res\\folder_hidden.ico" + +IDI_LINE_HIDDEN ICON "res\\line_hidden.ico" + +IDI_POINT_HIDDEN ICON "res\\point_hidden.ico" + +IDI_PROPERTY_HIDDEN ICON "res\\property_hidden.ico" + +IDI_ROOT_HIDDEN ICON "res\\root_hidden.ico" + +IDI_ZONE_HIDDEN ICON "res\\zone_hidden.ico" + +IDI_ERROR_STRUCTURE ICON "res\\erro.ico" + ///////////////////////////////////////////////////////////////////////////// // // Bitmap // -IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp" +IDR_MAINFRAME BITMAP "res\\Toolbar.bmp" + ///////////////////////////////////////////////////////////////////////////// // // Toolbar // -IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 16 +IDR_MAINFRAME TOOLBAR 16, 16 BEGIN BUTTON ID_FILE_NEW BUTTON ID_FILE_OPEN @@ -163,7 +185,7 @@ END // Menu // -IDR_MAINFRAME MENU PRELOAD DISCARDABLE +IDR_MAINFRAME MENU BEGIN POPUP "&File" BEGIN @@ -234,12 +256,8 @@ BEGIN MENUITEM "Show / Hide C&ollisions\tO", ID_VIEW_COLLISIONS MENUITEM "Show / Hide &PACS\tCTRL+P", ID_VIEW_PACS MENUITEM SEPARATOR - MENUITEM "Locate selected primitives\tALT+L", - ID_VIEW_LOCATESELECTEDPRIMITIVES - - MENUITEM "Locate selected primitives in tree\tALT+T", - ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE - + MENUITEM "Locate selected primitives\tALT+L", ID_VIEW_LOCATESELECTEDPRIMITIVES + MENUITEM "Locate selected primitives in tree\tALT+T", ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE END POPUP "&Project" BEGIN @@ -255,14 +273,11 @@ BEGIN MENUITEM "&Reset unique ID", ID_PROJECT_RESETUNIQUEID MENUITEM "&Generate missing ID", ID_PROJECT_GENERATENULLID MENUITEM "&Force ID uniqueness", ID_PROJECT_CORRECT_ID - MENUITEM "&Reset primitive configuration", - ID_PROJECT_RESET_PRIMITIVE_CONFIGURATION - + MENUITEM "&Reset primitive configuration", ID_PROJECT_RESET_PRIMITIVE_CONFIGURATION END POPUP "Windows" BEGIN MENUITEM "Primitive configuration", ID_WINDOWS_PRIMITIVECONFIGURATION - END POPUP "&Help" BEGIN @@ -273,13 +288,23 @@ BEGIN END END +IDR_MENU1 MENU +BEGIN + POPUP "Primitive Configuration" + BEGIN + MENUITEM "&Select", ID_PRIMITIVECONFIGURATION_SELECT + MENUITEM "&Show", ID_PRIMITIVECONFIGURATION_SHOW + MENUITEM "&Hide", ID_PRIMITIVECONFIGURATION_HIDE + END +END + ///////////////////////////////////////////////////////////////////////////// // // Accelerator // -IDR_DIALOG ACCELERATORS PRELOAD MOVEABLE PURE +IDR_DIALOG ACCELERATORS BEGIN "F", ID_FIND, VIRTKEY, CONTROL, NOINVERT "G", ID_GOTO, VIRTKEY, CONTROL, NOINVERT @@ -289,8 +314,7 @@ BEGIN "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT "P", ID_VIEW_PACS, VIRTKEY, CONTROL, NOINVERT "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT - "T", ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE, VIRTKEY, ALT, - NOINVERT + "T", ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE, VIRTKEY, ALT, NOINVERT VK_F1, ID_HELP_FINDER, VIRTKEY, NOINVERT VK_F10, ID_EDIT_RADIUS, VIRTKEY, NOINVERT VK_F11, ID_EDIT_ADD_POINT, VIRTKEY, NOINVERT @@ -306,7 +330,7 @@ BEGIN VK_RETURN, ID_EDIT_PROPERTIES, VIRTKEY, ALT, NOINVERT END -IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE +IDR_MAINFRAME ACCELERATORS BEGIN "A", ID_EDIT_SELECT_ALL, VIRTKEY, CONTROL, NOINVERT "C", ID_EDIT_SELECT_CHILDREN, VIRTKEY, NOINVERT @@ -330,8 +354,7 @@ BEGIN "R", ID_EDIT_COLLAPSE, VIRTKEY, NOINVERT "S", ID_VIEW_SHOW, VIRTKEY, NOINVERT "S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT - "T", ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE, VIRTKEY, ALT, - NOINVERT + "T", ID_VIEW_LOCATESELECTEDPRIMITIVES_TREE, VIRTKEY, ALT, NOINVERT "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT, NOINVERT VK_DELETE, ID_EDIT_DELETE, VIRTKEY, NOINVERT @@ -367,22 +390,8 @@ END // Dialog // -IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 73 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About NeL World Editor" -FONT 8, "MS Sans Serif" -BEGIN - ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 - LTEXT "NeL World Editor Version 0.47",IDC_TITLE_VERSION,40,10, - 96,8,SS_NOPREFIX - LTEXT "Copyright Nevrax (C) 2005",IDC_STATIC,40,25,119,8 - DEFPUSHBUTTON "OK",IDOK,178,8,50,14,WS_GROUP - LTEXT "Allocated Video Mem :",IDC_STATIC,15,43,73,16 - LTEXT "Static",IDC_STATIC_VIDEO_MEM,97,43,87,16 -END - -IDD_CREATE_ELEMENT DIALOG DISCARDABLE 0, 0, 247, 47 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_CREATE_ELEMENT DIALOG 0, 0, 247, 47 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Create Element" FONT 8, "MS Sans Serif" BEGIN @@ -391,84 +400,58 @@ BEGIN EDITTEXT IDC_EDIT_NAME,32,7,148,14,ES_AUTOHSCROLL LTEXT "Name",IDC_STATIC,7,7,20,8 LTEXT "Type",IDC_STATIC,7,25,20,8 - COMBOBOX IDC_COMBOTYPE,32,25,148,106,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBOTYPE,32,25,148,106,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP END -IDD_TOOLS_ZONE DIALOG DISCARDABLE 0, 0, 246, 278 -STYLE WS_CHILD -FONT 8, "MS Sans Serif" +IDD_TOOLS_ZONE DIALOGEX 0, 0, 246, 278 +STYLE DS_SETFONT | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - COMBOBOX IDC_CATTYPE1,7,7,83,65,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATVALUE1,94,7,83,66,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATTYPE2,7,26,83,65,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATVALUE2,94,26,83,66,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATTYPE3,7,46,83,65,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATVALUE3,94,46,83,66,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATTYPE4,7,66,83,65,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_CATVALUE4,94,66,83,66,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - CONTROL "AND",IDC_AND2,"Button",BS_AUTORADIOBUTTON | WS_GROUP, - 183,28,31,10 + COMBOBOX IDC_CATTYPE1,7,7,83,65,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATVALUE1,94,7,83,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATTYPE2,7,26,83,65,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATVALUE2,94,26,83,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATTYPE3,7,46,83,65,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATVALUE3,94,46,83,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATTYPE4,7,66,83,65,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_CATVALUE4,94,66,83,66,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "AND",IDC_AND2,"Button",BS_AUTORADIOBUTTON | WS_GROUP,183,28,31,10 CONTROL "OR",IDC_OR2,"Button",BS_AUTORADIOBUTTON,213,28,29,10 - CONTROL "AND",IDC_AND3,"Button",BS_AUTORADIOBUTTON | WS_GROUP, - 183,47,31,10 + CONTROL "AND",IDC_AND3,"Button",BS_AUTORADIOBUTTON | WS_GROUP,183,47,31,10 CONTROL "OR",IDC_OR3,"Button",BS_AUTORADIOBUTTON,213,47,29,10 - CONTROL "AND",IDC_AND4,"Button",BS_AUTORADIOBUTTON | WS_GROUP, - 183,66,31,10 + CONTROL "AND",IDC_AND4,"Button",BS_AUTORADIOBUTTON | WS_GROUP,183,66,31,10 CONTROL "OR",IDC_OR4,"Button",BS_AUTORADIOBUTTON,213,66,29,10 GROUPBOX "",IDC_STATIC,180,22,59,18,WS_GROUP GROUPBOX "",IDC_STATIC,180,41,59,18,WS_GROUP GROUPBOX "",IDC_STATIC,180,60,59,18,WS_GROUP - CONTROL "0°",IDC_ROT0,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7, - 83,23,10 + CONTROL "0°",IDC_ROT0,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,83,23,10 CONTROL "90°",IDC_ROT90,"Button",BS_AUTORADIOBUTTON,31,83,27,10 - CONTROL "180°",IDC_ROT180,"Button",BS_AUTORADIOBUTTON,59,83,31, - 10 - CONTROL "270°",IDC_ROT270,"Button",BS_AUTORADIOBUTTON,91,83,31, - 10 - CONTROL "Ran",IDC_ROTRANDOM,"Button",BS_AUTORADIOBUTTON,123,83, - 29,10 - CONTROL "Full Cycle",IDC_ROTCYCLE,"Button",BS_AUTORADIOBUTTON, - 152,83,46,10 - CONTROL "NoFlip",IDC_FLIPNO,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,7,94,36,10 - CONTROL "Flip",IDC_FLIPYES,"Button",BS_AUTORADIOBUTTON,45,94,27, - 10 - CONTROL "Ran",IDC_FLIPRANDOM,"Button",BS_AUTORADIOBUTTON,74,94, - 29,10 - CONTROL "Full Cycle",IDC_FLIPCYCLE,"Button",BS_AUTORADIOBUTTON, - 103,94,46,10 - CONTROL "Random",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,189,7,43,10 - CONTROL "Not Propagate",IDC_NOT_PROPAGATE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,177,95,62,10 - CONTROL "Full Cycle",IDC_FULL_CYCLE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,189,16,46,10 - CONTROL "Force",IDC_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 205,84,34,10 + CONTROL "180°",IDC_ROT180,"Button",BS_AUTORADIOBUTTON,59,83,31,10 + CONTROL "270°",IDC_ROT270,"Button",BS_AUTORADIOBUTTON,91,83,31,10 + CONTROL "Ran",IDC_ROTRANDOM,"Button",BS_AUTORADIOBUTTON,123,83,29,10 + CONTROL "Full Cycle",IDC_ROTCYCLE,"Button",BS_AUTORADIOBUTTON,152,83,46,10 + CONTROL "NoFlip",IDC_FLIPNO,"Button",BS_AUTORADIOBUTTON | WS_GROUP,7,94,36,10 + CONTROL "Flip",IDC_FLIPYES,"Button",BS_AUTORADIOBUTTON,45,94,27,10 + CONTROL "Ran",IDC_FLIPRANDOM,"Button",BS_AUTORADIOBUTTON,74,94,29,10 + CONTROL "Full Cycle",IDC_FLIPCYCLE,"Button",BS_AUTORADIOBUTTON,103,94,46,10 + CONTROL "Random",IDC_RANDOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,7,43,10 + CONTROL "Not Propagate",IDC_NOT_PROPAGATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,177,95,62,10 + CONTROL "Full Cycle",IDC_FULL_CYCLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,16,46,10 + CONTROL "Force",IDC_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,84,34,10 END -IDD_SELECTZONE DIALOG DISCARDABLE 0, 0, 186, 95 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_SELECTZONE DIALOG 0, 0, 186, 95 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Select Zone" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,129,7,50,14 PUSHBUTTON "Cancel",IDCANCEL,129,74,50,14 - LISTBOX IDC_LISTZONE,7,7,118,81,LBS_SORT | LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_LISTZONE,7,7,118,81,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END -IDD_GENERATE DIALOG DISCARDABLE 0, 0, 186, 95 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_GENERATE DIALOG 0, 0, 186, 95 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Generate" FONT 8, "MS Sans Serif" BEGIN @@ -482,16 +465,15 @@ BEGIN EDITTEXT IDC_EDITMAXX,33,49,40,14,ES_AUTOHSCROLL LTEXT "MaxY",IDC_STATIC,7,71,19,8 EDITTEXT IDC_EDITMAXY,33,67,40,14,ES_AUTOHSCROLL - COMBOBOX IDC_COMBOMATERIAL,87,7,92,58,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBOMATERIAL,87,7,92,58,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Zone Base X",IDC_STATIC,94,33,42,8 EDITTEXT IDC_EDITZONEBASEX,139,31,40,14,ES_AUTOHSCROLL LTEXT "Zone Base Y",IDC_STATIC,93,52,42,8 EDITTEXT IDC_EDITZONEBASEY,139,50,40,14,ES_AUTOHSCROLL END -IDD_MOVE DIALOG DISCARDABLE 0, 0, 186, 46 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_MOVE DIALOG 0, 0, 186, 46 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Move In Cell" FONT 8, "MS Sans Serif" BEGIN @@ -503,8 +485,8 @@ BEGIN EDITTEXT IDC_EDITYOFFSET,49,23,40,14,ES_AUTOHSCROLL END -IDD_EXPORT DIALOG DISCARDABLE 0, 0, 375, 316 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_EXPORT DIALOG 0, 0, 375, 316 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Export To Client" FONT 8, "MS Sans Serif" BEGIN @@ -514,12 +496,9 @@ BEGIN LTEXT "Reference Zones Directory",IDC_STATIC,7,7,86,8 PUSHBUTTON "...",IDC_BUTTON_REFZONEDIR,166,16,13,14 GROUPBOX "Lighting",IDC_STATIC,195,280,118,30 - CONTROL "Noise",IDC_RADIOLIGHTNOISE,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,203,292,34,10 - CONTROL "Patch",IDC_RADIOLIGHTPATCH,"Button",BS_AUTORADIOBUTTON, - 241,292,35,10 - CONTROL "No",IDC_RADIOLIGHTNO,"Button",BS_AUTORADIOBUTTON,279, - 292,25,10 + CONTROL "Noise",IDC_RADIOLIGHTNOISE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,203,292,34,10 + CONTROL "Patch",IDC_RADIOLIGHTPATCH,"Button",BS_AUTORADIOBUTTON,241,292,35,10 + CONTROL "No",IDC_RADIOLIGHTNO,"Button",BS_AUTORADIOBUTTON,279,292,25,10 LTEXT "Output Zones Directory",IDC_STATIC,7,33,74,8 EDITTEXT IDC_EDIT_OUTZONEDIR,7,42,153,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BUTTON_OUTZONEDIR,166,42,13,14 @@ -542,8 +521,7 @@ BEGIN EDITTEXT IDC_EDIT_ZONEMAX,321,255,40,14,ES_AUTOHSCROLL GROUPBOX "Export Limiter",IDC_STATIC,195,245,172,27 EDITTEXT IDC_EDIT_REFIGDIR,7,80,153,14,ES_AUTOHSCROLL - LTEXT "Reference Instance Group Directory",IDC_STATIC,7,70,115, - 8 + LTEXT "Reference Instance Group Directory",IDC_STATIC,7,70,115,8 PUSHBUTTON "...",IDC_BUTTON_REFIGDIR,166,80,13,14 LTEXT "Output Instance Group Directory",IDC_STATIC,7,97,103,8 EDITTEXT IDC_EDIT_OUTIGDIR,7,105,153,14,ES_AUTOHSCROLL @@ -557,19 +535,14 @@ BEGIN EDITTEXT IDC_EDIT_OUTCMBDIR,197,42,153,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BUTTON_OUTCMBDIR,355,42,13,14 GROUPBOX "",IDC_STATIC,191,1,182,61 - EDITTEXT IDC_EDIT_REFADDITIONNALIGDIR,198,80,153,14, - ES_AUTOHSCROLL - LTEXT "Reference Instance Group Directory",IDC_STATIC,198,70, - 115,8 + EDITTEXT IDC_EDIT_REFADDITIONNALIGDIR,198,80,153,14,ES_AUTOHSCROLL + LTEXT "Reference Instance Group Directory",IDC_STATIC,198,70,115,8 PUSHBUTTON "...",IDC_BUTTON_REFADDITIONNALIGDIR,356,80,13,14 - LTEXT "Output Instance Group Directory",IDC_STATIC,198,97,103, - 8 - EDITTEXT IDC_EDIT_OUTADDITIONNALIGDIR,198,105,153,14, - ES_AUTOHSCROLL + LTEXT "Output Instance Group Directory",IDC_STATIC,198,97,103,8 + EDITTEXT IDC_EDIT_OUTADDITIONNALIGDIR,198,105,153,14,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_BUTTON_OUTADDITIONNALIGDIR,356,105,13,14 GROUPBOX "",IDC_STATIC,192,62,181,61 - CONTROL "Export collisions",IDC_EXPORT_COLLISIONS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,201,215,81,11 + CONTROL "Export collisions",IDC_EXPORT_COLLISIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,201,215,81,11 EDITTEXT IDC_EDIT_DFNDIR,197,138,153,14,ES_AUTOHSCROLL LTEXT "Dfn base directory",IDC_STATIC,197,128,58,8 PUSHBUTTON "...",IDC_BUTTON_DFNDIR,355,138,13,14 @@ -586,22 +559,21 @@ BEGIN PUSHBUTTON "...",IDC_BUTTON_COLORMAPFILE,164,255,13,14 END -IDD_TYPEMANAGER DIALOG DISCARDABLE 0, 0, 186, 156 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_TYPEMANAGER DIALOG 0, 0, 186, 156 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Type Manager" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,7,135,50,14 PUSHBUTTON "Cancel",IDCANCEL,129,135,50,14 - LISTBOX IDC_LISTTYPE,7,26,172,102,LBS_SORT | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_LISTTYPE,7,26,172,102,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Add Type",IDC_ADDTYPE,7,7,50,14 PUSHBUTTON "Remove Type",IDC_REMOVETYPE,68,7,50,14 PUSHBUTTON "Edit Type",IDC_EDITTYPE,129,7,50,14 END -IDD_TYPE DIALOG DISCARDABLE 0, 0, 186, 46 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_TYPE DIALOG 0, 0, 186, 46 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Type" FONT 8, "MS Sans Serif" BEGIN @@ -610,42 +582,38 @@ BEGIN LTEXT "Name",IDC_STATIC,7,7,20,8 LTEXT "Color",IDC_STATIC,7,29,17,8 EDITTEXT IDC_EDITNAME,36,7,82,14,ES_AUTOHSCROLL - CONTROL "Color",IDC_BUTTONCOLOR,"Button",BS_OWNERDRAW | - WS_TABSTOP,36,24,50,14 + CONTROL "Color",IDC_BUTTONCOLOR,"Button",BS_OWNERDRAW | WS_TABSTOP,36,24,50,14 END -IDD_TYPESEL DIALOG DISCARDABLE 0, 0, 186, 95 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_TYPESEL DIALOG 0, 0, 186, 95 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Select Type" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,129,7,50,14 PUSHBUTTON "Cancel",IDCANCEL,129,74,50,14 - LISTBOX IDC_LIST,7,7,117,81,LBS_SORT | LBS_NOINTEGRALHEIGHT | - WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_LIST,7,7,117,81,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END -IDD_EXPORTCB DIALOG DISCARDABLE 0, 0, 310, 138 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +IDD_EXPORTCB DIALOG 0, 0, 310, 138 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION CAPTION "Export Callback" FONT 8, "MS Sans Serif" BEGIN PUSHBUTTON "Cancel",IDCANCEL,7,117,296,14 LTEXT "Export Pass",IDC_PASSTEXT,7,7,296,8 - CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7, - 18,296,14 - EDITTEXT IDC_EDIT_INFO,7,39,296,73,ES_MULTILINE | ES_AUTOHSCROLL | - WS_VSCROLL + CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,18,296,14 + EDITTEXT IDC_EDIT_INFO,7,39,296,73,ES_MULTILINE | ES_AUTOHSCROLL | WS_VSCROLL END -IDD_TOOLS_LOGIC DIALOG DISCARDABLE 0, 0, 178, 278 -STYLE WS_CHILD +IDD_TOOLS_LOGIC DIALOG 0, 0, 178, 278 +STYLE DS_SETFONT | WS_CHILD FONT 8, "MS Sans Serif" BEGIN END -IDD_EDIT_STRING DIALOG DISCARDABLE 0, 0, 247, 47 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_EDIT_STRING DIALOG 0, 0, 247, 47 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Edit name" FONT 8, "MS Sans Serif" BEGIN @@ -656,21 +624,19 @@ BEGIN END IDD_LOADING DIALOGEX 0, 0, 281, 47 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION EXSTYLE WS_EX_TOOLWINDOW CAPTION "NeL World Editor" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN CONTROL "Please Wait While Loading...",IDC_STATIC_TEXT_LOADING, "Static",SS_LEFTNOWORDWRAP | WS_GROUP,5,5,269,8 - ICON IDR_MAINFRAME,IDC_STATIC,5,20,20,20,SS_CENTERIMAGE | - SS_RIGHTJUST | SS_REALSIZEIMAGE - CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",WS_BORDER, - 30,20,245,20 + ICON IDR_MAINFRAME,IDC_STATIC,5,20,20,20,SS_CENTERIMAGE | SS_RIGHTJUST | SS_REALSIZEIMAGE + CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",WS_BORDER,30,20,245,20 END -IDD_CUSTOM_SNAPSHOT DIALOG DISCARDABLE 0, 0, 147, 130 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_CUSTOM_SNAPSHOT DIALOG 0, 0, 147, 130 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Snapshot" FONT 8, "MS Sans Serif" BEGIN @@ -680,20 +646,15 @@ BEGIN EDITTEXT IDC_HEIGHT,90,45,51,12,ES_AUTOHSCROLL LTEXT "Width:",IDC_STATIC,15,30,70,13,SS_CENTERIMAGE LTEXT "Height:",IDC_STATIC,15,45,70,12,SS_CENTERIMAGE - CONTROL "Keep bitmap ratio",IDC_KEEPRATIO,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,15,60,75,10 - CONTROL "RGB",IDC_RGBA,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5, - 80,60,10 - CONTROL "Grayscale",IDC_GRAY_SCALE,"Button",BS_AUTORADIOBUTTON,5, - 90,60,10 - CONTROL "Fixed size",IDC_FIXED_SIZE,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,5,5,60,10 - CONTROL "Custom size",IDC_GRAY_SCALE2,"Button", - BS_AUTORADIOBUTTON,5,15,60,10 + CONTROL "Keep bitmap ratio",IDC_KEEPRATIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,60,75,10 + CONTROL "RGB",IDC_RGBA,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5,80,60,10 + CONTROL "Grayscale",IDC_GRAY_SCALE,"Button",BS_AUTORADIOBUTTON,5,90,60,10 + CONTROL "Fixed size",IDC_FIXED_SIZE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,5,5,60,10 + CONTROL "Custom size",IDC_GRAY_SCALE2,"Button",BS_AUTORADIOBUTTON,5,15,60,10 END -IDD_PROJECT_SETTINGS DIALOG DISCARDABLE 0, 0, 254, 153 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_PROJECT_SETTINGS DIALOG 0, 0, 254, 153 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Project Settings" FONT 8, "MS Sans Serif" BEGIN @@ -702,13 +663,12 @@ BEGIN EDITTEXT IDC_DATA_DIRECTORY,5,15,190,12,ES_AUTOHSCROLL LTEXT "Data directory:",IDC_STATIC,5,5,50,10 PUSHBUTTON "Browse",IDC_BROWSE,200,15,50,14 - COMBOBOX IDC_CONTEXT,5,45,105,85,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP + COMBOBOX IDC_CONTEXT,5,45,105,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Context:",IDC_STATIC,5,35,50,10 END IDD_PROPERTIES DIALOGEX 0, 0, 298, 121 -STYLE WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +STYLE DS_SETFONT | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME CAPTION "Properties" FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN @@ -716,14 +676,12 @@ BEGIN PUSHBUTTON "&Cancel",IDCANCEL,124,105,50,15 PUSHBUTTON "&Update",IDUPDATE,240,105,50,15 SCROLLBAR IDC_SCROLLBAR_PROP,283,15,12,76,SBS_VERT - CONTROL "",IDC_PROPERTY_FRAME,"Static",SS_BLACKFRAME,0,0,297,103, - WS_EX_CLIENTEDGE - CONTROL "",IDC_FIRST_PROP,"Static",SS_BLACKFRAME | NOT - WS_VISIBLE,6,6,273,19 + CONTROL "",IDC_PROPERTY_FRAME,"Static",SS_BLACKFRAME,0,0,297,103,WS_EX_CLIENTEDGE + CONTROL "",IDC_FIRST_PROP,"Static",SS_BLACKFRAME | NOT WS_VISIBLE,6,6,273,19 END -IDD_SELECT_PRIMITIVE_BY_LOCATION DIALOG DISCARDABLE 0, 0, 172, 85 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_SELECT_PRIMITIVE_BY_LOCATION DIALOG 0, 0, 172, 85 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Select a primitive by its location" FONT 8, "MS Sans Serif" BEGIN @@ -738,8 +696,8 @@ BEGIN LTEXT "Threshold :",IDC_STATIC,10,45,40,15,SS_CENTERIMAGE END -IDD_FIND_PRIMITIVE DIALOG DISCARDABLE 0, 0, 349, 145 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_FIND_PRIMITIVE DIALOG 0, 0, 349, 145 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Find a primitive..." FONT 8, "MS Sans Serif" BEGIN @@ -750,16 +708,15 @@ BEGIN LTEXT "",IDC_PRIMITIVE_NAME,7,104,335,34,SS_SUNKEN DEFPUSHBUTTON "&Find Next",ID_FIND_NEXT,102,83,50,14 PUSHBUTTON "&Cancel",IDCANCEL,7,83,50,14 - CONTROL "selection only",IDC_SELECTION,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,57,65,59,10 + CONTROL "selection only",IDC_SELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,57,65,59,10 LTEXT "Replace With :",IDC_STATIC,7,48,48,8 EDITTEXT IDC_REPLACE_TEXT,56,42,286,14,ES_AUTOHSCROLL PUSHBUTTON "&Replace",ID_REPLACE,197,83,50,14 PUSHBUTTON "&ReplaceAll",ID_REPLACE_ALL,292,83,50,14 END -IDD_GOTO_POS DIALOG DISCARDABLE 0, 0, 142, 58 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +IDD_GOTO_POS DIALOG 0, 0, 142, 58 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION CAPTION "Goto position" FONT 8, "MS Sans Serif" BEGIN @@ -769,12 +726,11 @@ BEGIN EDITTEXT IDC_GOTO_POS_X,20,5,50,12,ES_AUTOHSCROLL LTEXT "Y",IDC_STATIC,5,25,10,8 EDITTEXT IDC_GOTO_POS_Y,20,25,50,12,ES_AUTOHSCROLL - CONTROL "&zoom at position",IDC_CHECK_POS_ZOMM,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,5,45,70,10 + CONTROL "&zoom at position",IDC_CHECK_POS_ZOMM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,45,70,10 END -IDD_NAME DIALOG DISCARDABLE 0, 0, 483, 354 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_NAME DIALOG 0, 0, 483, 354 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Name attribution" FONT 8, "MS Sans Serif" BEGIN @@ -785,11 +741,8 @@ BEGIN EDITTEXT IDC_NAME_EBOX_IG,162,34,151,12,ES_AUTOHSCROLL DEFPUSHBUTTON "&Assign",ID_NAME_ASSIGN,217,52,50,14,WS_DISABLED EDITTEXT IDC_NAME_FILTER,180,92,125,12,ES_AUTOHSCROLL - LISTBOX IDC_NAME_SEARCH,29,110,426,84,LBS_SORT | LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LISTBOX IDC_NAME_ID,29,220,426,78,LBS_SORT | LBS_USETABSTOPS | - LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | - WS_TABSTOP + LISTBOX IDC_NAME_SEARCH,29,110,426,84,LBS_SORT | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_NAME_ID,29,220,426,78,LBS_SORT | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP GROUPBOX "Assign name",IDC_STATIC,107,7,270,67 LTEXT "Generic name:",IDC_STATIC,111,17,47,8 LTEXT "In game name:",IDC_STATIC,111,36,48,8 @@ -800,51 +753,30 @@ BEGIN GROUPBOX "Name database:",IDC_STATIC,20,83,445,122 END - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L +IDD_PRIMITIVE_CONFIGURATION DIALOGEX 0, 0, 238, 87 +STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "Primitive configuration" +FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Nevrax\0" - VALUE "FileDescription", "NeL World Editor\0" - VALUE "FileVersion", "0, 0, 0, 1\0" - VALUE "InternalName", "world_editor\0" - VALUE "LegalCopyright", "Nevrax Copyright (C) 2002\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "world_editor.exe\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "NeL World Editor\0" - VALUE "ProductVersion", "0, 0, 0, 1\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END + CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,7,224,73 END -#endif // !_MAC +IDD_SPLASHSCREEN DIALOG 0, 0, 186, 95 +STYLE DS_SETFONT | WS_POPUP | WS_CAPTION +CAPTION "World Edit Load" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Static",IDC_LOAD_WORLD_EDIT,7,5,172,85,SS_SUNKEN +END + +IDD_DIRECTORY_SELECTOR DIALOG 0, 0, 282, 26 +STYLE DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS +FONT 8, "MS Sans Serif" +BEGIN + COMBOBOX IDC_DIRLIST,54,7,216,234,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + LTEXT "Previous dir:",IDC_STATIC,6,7,45,12,SS_CENTERIMAGE +END ///////////////////////////////////////////////////////////////////////////// @@ -853,14 +785,58 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO BEGIN - IDD_ABOUTBOX, DIALOG + IDD_CREATE_ELEMENT, DIALOG + BEGIN + END + + IDD_TOOLS_ZONE, DIALOG + BEGIN + END + + IDD_SELECTZONE, DIALOG + BEGIN + END + + IDD_GENERATE, DIALOG + BEGIN + END + + IDD_MOVE, DIALOG + BEGIN + END + + IDD_EXPORT, DIALOG + BEGIN + END + + IDD_TYPEMANAGER, DIALOG + BEGIN + END + + IDD_TYPE, DIALOG + BEGIN + END + + IDD_TYPESEL, DIALOG + BEGIN + END + + IDD_EXPORTCB, DIALOG + BEGIN + END + + IDD_TOOLS_LOGIC, DIALOG + BEGIN + END + + IDD_EDIT_STRING, DIALOG + BEGIN + END + + IDD_LOADING, DIALOG BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 228 - TOPMARGIN, 8 - BOTTOMMARGIN, 66 END IDD_CUSTOM_SNAPSHOT, DIALOG @@ -916,6 +892,18 @@ BEGIN TOPMARGIN, 7 BOTTOMMARGIN, 347 END + + IDD_PRIMITIVE_CONFIGURATION, DIALOG + BEGIN + END + + IDD_SPLASHSCREEN, DIALOG + BEGIN + END + + IDD_DIRECTORY_SELECTOR, DIALOG + BEGIN + END END #endif // APSTUDIO_INVOKED @@ -925,36 +913,59 @@ END // Cursor // -IDC_MOVE CURSOR DISCARDABLE "res\\move.cur" -IDC_ROTATE CURSOR DISCARDABLE "res\\rotate.cur" -IDC_TURN CURSOR DISCARDABLE "res\\turn.cur" -IDC_SCALE CURSOR DISCARDABLE "res\\scale.cur" -IDC_ADD_POINT CURSOR DISCARDABLE "res\\add_point.cur" -IDC_COPY CURSOR DISCARDABLE "res\\copy.cur" -IDC_SELECT CURSOR DISCARDABLE "res\\select.cur" -IDC_SELECT_COPY CURSOR DISCARDABLE "res\\select_copy.cur" -IDC_INSERT_POINT CURSOR DISCARDABLE "res\\insert_point.cur" -IDC_HAND1 CURSOR DISCARDABLE "res\\hand.cur" -IDC_ZOOM CURSOR DISCARDABLE "res\\zoom.cur" -IDC_RADIUS CURSOR DISCARDABLE "res\\radius.cur" +IDC_MOVE CURSOR "res\\move.cur" + +IDC_ROTATE CURSOR "res\\rotate.cur" + +IDC_TURN CURSOR "res\\turn.cur" + +IDC_SCALE CURSOR "res\\scale.cur" + +IDC_ADD_POINT CURSOR "res\\add_point.cur" + +IDC_COPY CURSOR "res\\copy.cur" + +IDC_SELECT CURSOR "res\\select.cur" + +IDC_SELECT_COPY CURSOR "res\\select_copy.cur" + +IDC_INSERT_POINT CURSOR "res\\insert_point.cur" + +IDC_HAND1 CURSOR "res\\hand.cur" + +IDC_ZOOM CURSOR "res\\zoom.cur" + +IDC_RADIUS CURSOR "res\\radius.cur" + + +///////////////////////////////////////////////////////////////////////////// +// +// AFX_DIALOG_LAYOUT +// + +IDD_TOOLS_ZONE AFX_DIALOG_LAYOUT +BEGIN + 0 +END + ///////////////////////////////////////////////////////////////////////////// // // String Table // -STRINGTABLE PRELOAD DISCARDABLE +STRINGTABLE BEGIN IDR_MAINFRAME "NeL World Editor\n\nNeLWorldEditor\nNeL World Editor Files (*.worldedit)\n.worldedit\nWorldeditor.Document\nNeL World Editor Document" END -STRINGTABLE PRELOAD DISCARDABLE +STRINGTABLE BEGIN AFX_IDS_APP_TITLE "NeL World Editor" AFX_IDS_IDLEMESSAGE "Ready" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_INDICATOR_ZONENAMENEL " " ID_INDICATOR_ZONENAMEREF @@ -966,7 +977,7 @@ BEGIN ID_INDICATOR_SELECTION "9999 selected primitives" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_FILE_NEW "Create a new document\nNew" ID_FILE_OPEN "Open an existing document\nOpen (CTRL+O)" @@ -979,14 +990,14 @@ BEGIN ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_APP_ABOUT "Display program information, version number and copyright\nAbout" ID_APP_EXIT "Quit the application; prompts to save documents\nExit" ID_HELP_FINDER "List Help topics\nHelp Topics (F1)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_FILE_MRU_FILE1 "Open this document" ID_FILE_MRU_FILE2 "Open this document" @@ -1006,18 +1017,18 @@ BEGIN ID_FILE_MRU_FILE16 "Open this document" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_NEXT_PANE "Switch to the next window pane\nNext Pane" ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_WINDOW_SPLIT "Split the active window into panes\nSplit" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_EDIT_CLEAR "Erase the selection\nErase" ID_EDIT_CLEAR_ALL "Erase everything\nErase All" @@ -1032,13 +1043,13 @@ BEGIN ID_EDIT_REDO "Redo the previously undone action\nRedo (Ctrl+Y)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar" ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN AFX_IDS_SCSIZE "Change the window size" AFX_IDS_SCMOVE "Change the window position" @@ -1049,26 +1060,30 @@ BEGIN AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN AFX_IDS_SCRESTORE "Restore the window to normal size" AFX_IDS_SCTASKLIST "Activate Task List" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview" +END + +STRINGTABLE +BEGIN ID_WINDOWS_PLUGINS "Menu to select betwen the different plugins \n Plugins" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_VIEW_GRID "Show / hide grid\nShow / Hide grid (G)" ID_MODE_LOGIC "Logic Edition" ID_MODE_ZONE "Zone edition" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_EDIT_PACS "Show / hide PACS lines\nPACS (CTRL+P)" ID_VIEW_PACS "Show / hide PACS lines\nPACS (CTRL+P)" @@ -1081,7 +1096,7 @@ BEGIN ID_NAME_DLG "Name generator\nName generator" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_EDIT_TURN "Turn selection\nTurn (F8)" ID_EDIT_SCALE "Scale selection\nScale (F9)" @@ -1089,7 +1104,7 @@ BEGIN ID_EDIT_ADD_POINT "Add points in selection\nAdd points (F11)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_PROJECT_SETTINGS "Project properties\nProperties (Alt+F7)" ID_EDIT_LOCK "Edit current selection points\nEdit points (Space)" @@ -1101,7 +1116,7 @@ BEGIN ID_EDIT_ROTATE "Rotate selection\nRotate (F7)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_EDIT_DETAILS "Show / hide details\nDetails (D)" ID_VIEW_SHOW "Show selected primitives\nShow (S)" @@ -1111,19 +1126,19 @@ BEGIN ID_EDIT_COLLAPSE "Collapse selected nodes\nCollapse (R)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_VIEW_LANDSCAPE "Show / hide landscapes\nShow / Hide landscapes (L)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_VIEW_PRIMITIVES "Show / hide primitives\nShow / Hide primitives (P)" ID_VIEW_LAYERS "Show / hide layers\nShow / Hide layers (Y)" ID_VIEW_GRIS "Show / hide grid\nShow / Hide gris (G)" END -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN ID_EDIT_SELECT_BY_LOCATION "Select primitives by location CTRL+L\nSelect primitives by location (CTRL+L)" @@ -1139,107 +1154,7 @@ BEGIN ID_REPAIR_SELECTED "Repair selected elements by adding missing fields" END -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_FRENCH -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MENU1 MENU DISCARDABLE -BEGIN - POPUP "Primitive Configuration" - BEGIN - MENUITEM "&Select", ID_PRIMITIVECONFIGURATION_SELECT - - MENUITEM "&Show", ID_PRIMITIVECONFIGURATION_SHOW - - MENUITEM "&Hide", ID_PRIMITIVECONFIGURATION_HIDE - - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_PRIMITIVE_CONFIGURATION DIALOGEX 0, 0, 238, 87 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_TOOLWINDOW -CAPTION "Primitive configuration" -FONT 8, "MS Sans Serif", 0, 0, 0x1 -BEGIN - CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | - LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | - WS_TABSTOP,7,7,224,73 -END - -IDD_SPLASHSCREEN DIALOG DISCARDABLE 0, 0, 186, 95 -STYLE WS_POPUP | WS_CAPTION -CAPTION "World Edit Load" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Static",IDC_LOAD_WORLD_EDIT,7,5,172,85,SS_SUNKEN -END - -IDD_DIRECTORY_SELECTOR DIALOG DISCARDABLE 0, 0, 282, 26 -STYLE DS_3DLOOK | DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS -FONT 8, "MS Sans Serif" -BEGIN - COMBOBOX IDC_DIRLIST,54,7,216,234,CBS_DROPDOWNLIST | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - LTEXT "Previous dir:",IDC_STATIC,6,7,45,12,SS_CENTERIMAGE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_PRIMITIVE_CONFIGURATION, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 231 - TOPMARGIN, 7 - BOTTOMMARGIN, 80 - END - - IDD_SPLASHSCREEN, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 179 - TOPMARGIN, 7 - BOTTOMMARGIN, 88 - END - - IDD_DIRECTORY_SELECTOR, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 275 - TOPMARGIN, 7 - BOTTOMMARGIN, 19 - END -END -#endif // APSTUDIO_INVOKED - -#endif // French (France) resources +#endif // English resources ///////////////////////////////////////////////////////////////////////////// @@ -1264,6 +1179,8 @@ LANGUAGE 9, 1 #include "afxdb.rc" // Database resources #endif +#include "version.rc2" + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED diff --git a/code/ryzom/tools/patch_gen/CMakeLists.txt b/code/ryzom/tools/patch_gen/CMakeLists.txt index d377fb99c..330733cc2 100644 --- a/code/ryzom/tools/patch_gen/CMakeLists.txt +++ b/code/ryzom/tools/patch_gen/CMakeLists.txt @@ -1,14 +1,14 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ryzom/client/src/seven_zip) -SET(MAIN_SRC patch_gen_common.cpp patch_gen_main.cpp patch_gen_main.h patch_gen_common.h) -SET(SERVICE_SRC patch_gen_common.cpp patch_gen_service.cpp patch_gen_service.h patch_gen_common.h) +SET(MAIN_SRC patch_gen_common.cpp patch_gen_main.cpp patch_gen_main.h patch_gen.rc) +SET(SERVICE_SRC patch_gen_common.cpp patch_gen_service.cpp patch_gen_service.h patch_gen_service.rc) -ADD_EXECUTABLE(patch_gen ${MAIN_SRC}) +ADD_EXECUTABLE(patch_gen ${MAIN_SRC} ${RECS}) TARGET_LINK_LIBRARIES(patch_gen ryzom_sevenzip ryzom_gameshare nelmisc nelnet nelligo nelgeorges) NL_DEFAULT_PROPS(patch_gen "Ryzom, Tools: Patch Generator") NL_ADD_RUNTIME_FLAGS(patch_gen) -ADD_EXECUTABLE(patch_gen_service WIN32 ${SERVICE_SRC}) +ADD_EXECUTABLE(patch_gen_service WIN32 ${SERVICE_SRC} ${RECS}) TARGET_LINK_LIBRARIES(patch_gen_service ryzom_sevenzip ryzom_gameshare nelmisc nelnet nelligo nelgeorges) NL_DEFAULT_PROPS(patch_gen_service "Ryzom, Tools: Patch Generator Service") NL_ADD_RUNTIME_FLAGS(patch_gen_service) diff --git a/code/ryzom/tools/patch_gen/blue_pill.ico b/code/ryzom/tools/patch_gen/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/ryzom/tools/patch_gen/blue_pill.ico differ diff --git a/code/ryzom/tools/patch_gen/patch_gen.rc b/code/ryzom/tools/patch_gen/patch_gen.rc new file mode 100644 index 000000000..c950b655b --- /dev/null +++ b/code/ryzom/tools/patch_gen/patch_gen.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Patch Gen" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "patch_gen" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/ryzom/tools/patch_gen/patch_gen_service.rc b/code/ryzom/tools/patch_gen/patch_gen_service.rc new file mode 100644 index 000000000..20145f1a6 --- /dev/null +++ b/code/ryzom/tools/patch_gen/patch_gen_service.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "red_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Patch Gen Service" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "patch_gen_service" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/ryzom/tools/patch_gen/red_pill.ico b/code/ryzom/tools/patch_gen/red_pill.ico new file mode 100644 index 000000000..c5f250583 Binary files /dev/null and b/code/ryzom/tools/patch_gen/red_pill.ico differ diff --git a/code/ryzom/tools/server/ai_build_wmap/CMakeLists.txt b/code/ryzom/tools/server/ai_build_wmap/CMakeLists.txt index f6417611f..edafe195f 100644 --- a/code/ryzom/tools/server/ai_build_wmap/CMakeLists.txt +++ b/code/ryzom/tools/server/ai_build_wmap/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h ${RZ_SERVER_SRC_DIR}/ai_data_service/pacs_scan.h ${RZ_SERVER_SRC_DIR}/ai_data_service/pacs_scan.cpp) +FILE(GLOB SRC *.cpp *.h ${RZ_SERVER_SRC_DIR}/ai_data_service/pacs_scan.h ${RZ_SERVER_SRC_DIR}/ai_data_service/pacs_scan.cpp *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(ai_build_wmap ${SRC}) diff --git a/code/ryzom/tools/server/ai_build_wmap/blue_pill.ico b/code/ryzom/tools/server/ai_build_wmap/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/ryzom/tools/server/ai_build_wmap/blue_pill.ico differ diff --git a/code/ryzom/tools/server/ai_build_wmap/main.rc b/code/ryzom/tools/server/ai_build_wmap/main.rc new file mode 100644 index 000000000..1ef42e0dc --- /dev/null +++ b/code/ryzom/tools/server/ai_build_wmap/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom AI Build WMap" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "ai_build_wmap" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/ryzom/tools/server/build_world_packed_col/CMakeLists.txt b/code/ryzom/tools/server/build_world_packed_col/CMakeLists.txt index 672500092..e1d57f821 100644 --- a/code/ryzom/tools/server/build_world_packed_col/CMakeLists.txt +++ b/code/ryzom/tools/server/build_world_packed_col/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h ${RZ_SERVER_SRC_DIR}/ai_data_service/pacs_scan.h ${RZ_SERVER_SRC_DIR}/ai_data_service/pacs_scan.cpp) +FILE(GLOB SRC *.cpp *.h ${RZ_SERVER_SRC_DIR}/ai_data_service/pacs_scan.h ${RZ_SERVER_SRC_DIR}/ai_data_service/pacs_scan.cpp *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(build_world_packed_col ${SRC}) diff --git a/code/ryzom/tools/sheets_packer/CMakeLists.txt b/code/ryzom/tools/sheets_packer/CMakeLists.txt index 7e7d27c1d..45a344153 100644 --- a/code/ryzom/tools/sheets_packer/CMakeLists.txt +++ b/code/ryzom/tools/sheets_packer/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(sheets_packer ${SRC} ${CMAKE_SOURCE_DIR}/ryzom/client/src/continent_manager_build.cpp diff --git a/code/ryzom/tools/sheets_packer/blue_pill.ico b/code/ryzom/tools/sheets_packer/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/ryzom/tools/sheets_packer/blue_pill.ico differ diff --git a/code/ryzom/tools/sheets_packer/main.rc b/code/ryzom/tools/sheets_packer/main.rc new file mode 100644 index 000000000..0c8a7cf87 --- /dev/null +++ b/code/ryzom/tools/sheets_packer/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Sheets Packer" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "sheets_packer" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt b/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt index 554eafe3f..383bd8871 100644 --- a/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt +++ b/code/ryzom/tools/sheets_packer_shard/CMakeLists.txt @@ -1,6 +1,12 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) + FILE(GLOB EGSSHEETS ${CMAKE_SOURCE_DIR}/ryzom/server/src/entities_game_service/egs_sheets/*.cpp ${CMAKE_SOURCE_DIR}/ryzom/server/src/entities_game_service/egs_sheets/*.h) +SOURCE_GROUP("" FILES ${SRC}) +SOURCE_GROUP("EGS Sheets" FILES ${EGSSHEETS}) + ADD_EXECUTABLE(sheets_packer_shard ${SRC} ${EGSSHEETS} ${CMAKE_SOURCE_DIR}/ryzom/server/src/input_output_service/string_manager_sheet.cpp ${CMAKE_SOURCE_DIR}/ryzom/server/src/input_output_service/string_manager.h diff --git a/code/ryzom/tools/sheets_packer_shard/blue_pill.ico b/code/ryzom/tools/sheets_packer_shard/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/ryzom/tools/sheets_packer_shard/blue_pill.ico differ diff --git a/code/ryzom/tools/sheets_packer_shard/main.rc b/code/ryzom/tools/sheets_packer_shard/main.rc new file mode 100644 index 000000000..9d2f27ba4 --- /dev/null +++ b/code/ryzom/tools/sheets_packer_shard/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Sheets Packer Shard" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "sheets_packer_shard" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/ryzom/tools/translation_tools/CMakeLists.txt b/code/ryzom/tools/translation_tools/CMakeLists.txt index 1db05b3ec..199cb4311 100644 --- a/code/ryzom/tools/translation_tools/CMakeLists.txt +++ b/code/ryzom/tools/translation_tools/CMakeLists.txt @@ -1,4 +1,6 @@ -FILE(GLOB SRC *.cpp *.h) +FILE(GLOB SRC *.cpp *.h *.rc) + +SOURCE_GROUP("" FILES ${SRC}) ADD_EXECUTABLE(translation_tools ${SRC}) diff --git a/code/ryzom/tools/translation_tools/blue_pill.ico b/code/ryzom/tools/translation_tools/blue_pill.ico new file mode 100644 index 000000000..269907ec3 Binary files /dev/null and b/code/ryzom/tools/translation_tools/blue_pill.ico differ diff --git a/code/ryzom/tools/translation_tools/main.rc b/code/ryzom/tools/translation_tools/main.rc new file mode 100644 index 000000000..19285e298 --- /dev/null +++ b/code/ryzom/tools/translation_tools/main.rc @@ -0,0 +1,42 @@ +#include +#include "config.h" + +IDI_MAIN_ICON ICON DISCARDABLE "blue_pill.ico" + +#ifdef _DEBUG +#define NL_FILEEXT "_d" +#else +#define NL_FILEEXT "" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION NL_VERSION_RC + PRODUCTVERSION NL_VERSION_RC + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", AUTHOR + VALUE "FileDescription", "Ryzom Translation Tools" + VALUE "FileVersion", NL_VERSION + VALUE "LegalCopyright", COPYRIGHT + VALUE "OriginalFilename", "translation_tools" NL_FILEEXT ".exe" + VALUE "ProductName", "Ryzom Tools" + VALUE "ProductVersion", NL_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END diff --git a/code/web/private_php/ams/autoload/.plugincache.php.swp b/code/web/private_php/ams/autoload/.plugincache.php.swp deleted file mode 100755 index 48c1d01b5..000000000 Binary files a/code/web/private_php/ams/autoload/.plugincache.php.swp and /dev/null differ diff --git a/code/web/private_php/ams/autoload/helpers.php b/code/web/private_php/ams/autoload/helpers.php index 28e4ce036..6838699b5 100755 --- a/code/web/private_php/ams/autoload/helpers.php +++ b/code/web/private_php/ams/autoload/helpers.php @@ -29,7 +29,6 @@ class Helpers { // define('SMARTY_SPL_AUTOLOAD',1); require_once $AMS_LIB . '/smarty/libs/Smarty.class.php'; - spl_autoload_register( '__autoload' ); $smarty = new Smarty; $smarty -> setCompileDir( $SITEBASE . '/templates_c/' ); diff --git a/code/web/private_php/ams/libinclude.php b/code/web/private_php/ams/libinclude.php index 230c6849c..20b1dba0a 100755 --- a/code/web/private_php/ams/libinclude.php +++ b/code/web/private_php/ams/libinclude.php @@ -3,7 +3,7 @@ * Base include file for library functions for AMS. * Autoload function that loads the classes in case they aren't loaded yet. */ -function __autoload( $className ){ +function __ams_autoload( $className ){ global $AMS_LIB; global $SITEBASE; //if the class exists in the lib's autload dir, load that one @@ -16,4 +16,6 @@ function __autoload( $className ){ } } +spl_autoload_register( '__ams_autoload' ); + diff --git a/code/web/private_php/ams/plugins/API_key_management/API_key_management.php b/code/web/private_php/ams/plugins/API_key_management/API_key_management.php index b8dc965fc..f7caef90e 100755 --- a/code/web/private_php/ams/plugins/API_key_management/API_key_management.php +++ b/code/web/private_php/ams/plugins/API_key_management/API_key_management.php @@ -92,17 +92,17 @@ function api_key_management_hook_activate() CREATE TABLE IF NOT EXISTS `ams_api_keys` ( `SNo` int(10) NOT NULL AUTO_INCREMENT, - `User` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `FrName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `UserType` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, - `UserCharacter` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `User` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `FrName` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `UserType` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `UserCharacter` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `ExpiryDate` date DEFAULT NULL, - `AccessToken` text COLLATE utf8_unicode_ci DEFAULT NULL, + `AccessToken` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `AddedOn` datetime DEFAULT NULL, - `Items` text COLLATE utf8_unicode_ci, + `Items` text COLLATE utf8mb4_unicode_ci, PRIMARY KEY (`SNo`), KEY `User` (`User`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ; -- -- Constraints for table `ams_api_keys` diff --git a/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php b/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php index 5362eef6b..5b98fc152 100755 --- a/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php +++ b/code/web/private_php/ams/plugins/Domain_Management/Domain_Management.php @@ -159,8 +159,8 @@ function domain_management_hook_return_global() function domain_management_hook_activate() { $dbl = new DBLayer( "lib" ); - $sql = "INSERT INTO `settings` (Setting) - SELECT 'Domain_Auto_Add' FROM DUAL + $sql = "INSERT INTO `settings` (Setting, Value) + SELECT 'Domain_Auto_Add', 0 FROM DUAL WHERE NOT EXISTS (SELECT Setting FROM settings WHERE Setting='Domain_Auto_Add');"; diff --git a/code/web/private_php/ams/plugins/resource.mysql.php b/code/web/private_php/ams/plugins/resource.mysql.php index 312f3fc73..4af19756d 100755 --- a/code/web/private_php/ams/plugins/resource.mysql.php +++ b/code/web/private_php/ams/plugins/resource.mysql.php @@ -12,7 +12,7 @@ * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, * `source` text, * PRIMARY KEY (`name`) - * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; * * Demo data: *
INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');
diff --git a/code/web/private_php/ams/plugins/resource.mysqls.php b/code/web/private_php/ams/plugins/resource.mysqls.php index f9fe1c2f2..f7c4a663d 100755 --- a/code/web/private_php/ams/plugins/resource.mysqls.php +++ b/code/web/private_php/ams/plugins/resource.mysqls.php @@ -15,7 +15,7 @@ * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, * `source` text, * PRIMARY KEY (`name`) - * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; * * Demo data: *
INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');
diff --git a/code/web/private_php/ams/smarty/libs/sysplugins/smarty_internal_compilebase.php b/code/web/private_php/ams/smarty/libs/sysplugins/smarty_internal_compilebase.php index f78f15f40..075b2a72e 100755 --- a/code/web/private_php/ams/smarty/libs/sysplugins/smarty_internal_compilebase.php +++ b/code/web/private_php/ams/smarty/libs/sysplugins/smarty_internal_compilebase.php @@ -72,30 +72,31 @@ abstract class Smarty_Internal_CompileBase } // named attribute } else { - $kv = each($mixed); - // option flag? - if (in_array($kv['key'], $this->option_flags)) { - if (is_bool($kv['value'])) { - $_indexed_attr[$kv['key']] = $kv['value']; - } elseif (is_string($kv['value']) && in_array(trim($kv['value'], '\'"'), array('true', 'false'))) { - if (trim($kv['value']) == 'true') { - $_indexed_attr[$kv['key']] = true; + foreach($mixed as $k => $v) { + // option flag? + if (in_array($k, $this->option_flags)) { + if (is_bool($v)) { + $_indexed_attr[$k] = $v; + } elseif (is_string($v) && in_array(trim($v, '\'"'), array('true', 'false'))) { + if (trim($v) == 'true') { + $_indexed_attr[$k] = true; + } else { + $_indexed_attr[$k] = false; + } + } elseif (is_numeric($v) && in_array($v, array(0, 1))) { + if ($v == 1) { + $_indexed_attr[$k] = true; + } else { + $_indexed_attr[$k] = false; + } } else { - $_indexed_attr[$kv['key']] = false; - } - } elseif (is_numeric($kv['value']) && in_array($kv['value'], array(0, 1))) { - if ($kv['value'] == 1) { - $_indexed_attr[$kv['key']] = true; - } else { - $_indexed_attr[$kv['key']] = false; + $compiler->trigger_template_error("illegal value of option flag \"{$k}\"", $compiler->lex->taglineno); } + // must be named attribute } else { - $compiler->trigger_template_error("illegal value of option flag \"{$kv['key']}\"", $compiler->lex->taglineno); + reset($mixed); + $_indexed_attr[$k] = $v; } - // must be named attribute - } else { - reset($mixed); - $_indexed_attr[key($mixed)] = $mixed[key($mixed)]; } } } diff --git a/code/web/private_php/setup/sql/nel_00001.sql b/code/web/private_php/setup/sql/nel_00001.sql index 70e14419b..51140342b 100755 --- a/code/web/private_php/setup/sql/nel_00001.sql +++ b/code/web/private_php/setup/sql/nel_00001.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `nel` @@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS `domain` ( `web_host` varchar(255) NOT NULL DEFAULT '', `web_host_php` varchar(255) NOT NULL DEFAULT '', `description` varchar(200) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -53,7 +53,7 @@ CREATE TABLE IF NOT EXISTS `permission` ( `ShardId` int(10) NOT NULL DEFAULT '-1', `AccessPrivilege` set('OPEN','DEV','RESTRICTED') NOT NULL DEFAULT 'OPEN', `prim` int(10) unsigned NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -76,7 +76,7 @@ CREATE TABLE IF NOT EXISTS `shard` ( `State` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', `MOTD` text NOT NULL, `prim` int(10) unsigned NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='contains all shards information for login system'; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='contains all shards information for login system'; -- -------------------------------------------------------- @@ -127,7 +127,7 @@ CREATE TABLE IF NOT EXISTS `user` ( `ValidMerchantCode` varchar(13) NOT NULL DEFAULT '', `PBC` tinyint(1) NOT NULL DEFAULT '0', `ApiKeySeed` varchar(8) DEFAULT NULL -) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='contains all users information for login system'; +) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COMMENT='contains all users information for login system'; -- -- Indexes for dumped tables diff --git a/code/web/private_php/setup/sql/nel_00002.sql b/code/web/private_php/setup/sql/nel_00002.sql index 74a59d980..851abc196 100755 --- a/code/web/private_php/setup/sql/nel_00002.sql +++ b/code/web/private_php/setup/sql/nel_00002.sql @@ -1,4 +1,4 @@ -ALTER TABLE `permission` CHANGE `ClientApplication` `ClientApplication` CHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ; +ALTER TABLE `permission` CHANGE `ClientApplication` `ClientApplication` CHAR( 64 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL ; ALTER TABLE `permission` DROP `prim` ; ALTER TABLE `permission` ADD `PermissionId` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ; ALTER TABLE `permission` ADD `DomainId` INT NOT NULL DEFAULT '-1' AFTER `UId` ; diff --git a/code/web/private_php/setup/sql/nel_ams_00001.sql b/code/web/private_php/setup/sql/nel_ams_00001.sql index c2b0a8895..79da7e999 100755 --- a/code/web/private_php/setup/sql/nel_ams_00001.sql +++ b/code/web/private_php/setup/sql/nel_ams_00001.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `ams_web` @@ -38,7 +38,7 @@ CREATE TABLE IF NOT EXISTS `ams_user` ( `Country` char(2) NOT NULL DEFAULT '', `ReceiveMail` int(1) NOT NULL DEFAULT '1', `Language` varchar(3) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables diff --git a/code/web/private_php/setup/sql/nel_ams_lib_00001.sql b/code/web/private_php/setup/sql/nel_ams_lib_00001.sql index 3c9b259b3..07826cf24 100755 --- a/code/web/private_php/setup/sql/nel_ams_lib_00001.sql +++ b/code/web/private_php/setup/sql/nel_ams_lib_00001.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `nel_ams_lib` @@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `ams_querycache` ( `type` varchar(64) NOT NULL, `query` varchar(512) NOT NULL, `db` varchar(80) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -42,7 +42,7 @@ CREATE TABLE IF NOT EXISTS `ams_querycache` ( CREATE TABLE IF NOT EXISTS `assigned` ( `Ticket` int(10) unsigned NOT NULL, `User` int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -61,7 +61,7 @@ CREATE TABLE IF NOT EXISTS `email` ( `MessageId` varchar(45) DEFAULT NULL, `TicketId` int(10) unsigned DEFAULT NULL, `Sender` int(10) unsigned DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -72,7 +72,7 @@ CREATE TABLE IF NOT EXISTS `email` ( CREATE TABLE IF NOT EXISTS `forwarded` ( `Group` int(10) unsigned NOT NULL, `Ticket` int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -83,7 +83,7 @@ CREATE TABLE IF NOT EXISTS `forwarded` ( CREATE TABLE IF NOT EXISTS `in_group` ( `Ticket_Group` int(10) unsigned NOT NULL, `Ticket` int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -94,7 +94,7 @@ CREATE TABLE IF NOT EXISTS `in_group` ( CREATE TABLE IF NOT EXISTS `in_support_group` ( `User` int(10) unsigned NOT NULL, `Group` int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -112,7 +112,7 @@ CREATE TABLE IF NOT EXISTS `plugins` ( `Status` int(11) NOT NULL DEFAULT '0', `Weight` int(11) NOT NULL DEFAULT '0', `Info` text -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `plugins` @@ -136,7 +136,7 @@ CREATE TABLE IF NOT EXISTS `support_group` ( `IMAP_MailServer` varchar(60) DEFAULT NULL, `IMAP_Username` varchar(45) DEFAULT NULL, `IMAP_Password` varchar(90) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -147,7 +147,7 @@ CREATE TABLE IF NOT EXISTS `support_group` ( CREATE TABLE IF NOT EXISTS `tag` ( `TagId` int(10) unsigned NOT NULL, `Value` varchar(60) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -158,7 +158,7 @@ CREATE TABLE IF NOT EXISTS `tag` ( CREATE TABLE IF NOT EXISTS `tagged` ( `Ticket` int(10) unsigned NOT NULL, `Tag` int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -175,7 +175,7 @@ CREATE TABLE IF NOT EXISTS `ticket` ( `Ticket_Category` int(10) unsigned NOT NULL, `Author` int(10) unsigned NOT NULL, `Priority` int(3) DEFAULT '0' -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -186,7 +186,7 @@ CREATE TABLE IF NOT EXISTS `ticket` ( CREATE TABLE IF NOT EXISTS `ticket_category` ( `TCategoryId` int(10) unsigned NOT NULL, `Name` varchar(45) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `ticket_category` @@ -208,7 +208,7 @@ INSERT INTO `ticket_category` (`TCategoryId`, `Name`) VALUES CREATE TABLE IF NOT EXISTS `ticket_content` ( `TContentId` int(10) unsigned NOT NULL, `Content` text -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -219,7 +219,7 @@ CREATE TABLE IF NOT EXISTS `ticket_content` ( CREATE TABLE IF NOT EXISTS `ticket_group` ( `TGroupId` int(10) unsigned NOT NULL, `Title` varchar(80) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -248,7 +248,7 @@ CREATE TABLE IF NOT EXISTS `ticket_info` ( `PlayerName` varchar(45) DEFAULT NULL, `UserId` int(11) DEFAULT NULL, `TimeInGame` varchar(50) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -262,7 +262,7 @@ CREATE TABLE IF NOT EXISTS `ticket_log` ( `Query` varchar(255) NOT NULL, `Ticket` int(10) unsigned NOT NULL, `Author` int(10) unsigned DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -277,7 +277,7 @@ CREATE TABLE IF NOT EXISTS `ticket_reply` ( `Content` int(10) unsigned NOT NULL, `Timestamp` timestamp NULL DEFAULT NULL, `Hidden` tinyint(1) DEFAULT '0' -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -289,7 +289,7 @@ CREATE TABLE IF NOT EXISTS `ticket_user` ( `TUserId` int(10) unsigned NOT NULL, `Permission` int(3) NOT NULL DEFAULT '1', `ExternId` int(10) unsigned NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -300,9 +300,9 @@ CREATE TABLE IF NOT EXISTS `ticket_user` ( CREATE TABLE IF NOT EXISTS `updates` ( `s.no` int(10) NOT NULL, `PluginId` int(10) DEFAULT NULL, - `UpdatePath` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, - `UpdateInfo` text CHARACTER SET utf8 COLLATE utf8_unicode_ci -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + `UpdatePath` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `UpdateInfo` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables diff --git a/code/web/private_php/setup/sql/nel_ams_lib_00002.sql b/code/web/private_php/setup/sql/nel_ams_lib_00002.sql index 99700c532..4831288d2 100755 --- a/code/web/private_php/setup/sql/nel_ams_lib_00002.sql +++ b/code/web/private_php/setup/sql/nel_ams_lib_00002.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `nel_ams_lib` @@ -29,12 +29,12 @@ SET time_zone = "+00:00"; CREATE TABLE IF NOT EXISTS `ticket_attachments` ( `idticket_attachments` int(10) unsigned NOT NULL, `ticket_TId` int(10) unsigned NOT NULL, - `Filename` varchar(45) COLLATE utf8_unicode_ci NOT NULL, + `Filename` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL, `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `Filesize` int(10) NOT NULL, `Uploader` int(10) unsigned NOT NULL, `Path` VARCHAR(128) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Indexes for dumped tables diff --git a/code/web/private_php/setup/sql/nel_ams_lib_00005.sql b/code/web/private_php/setup/sql/nel_ams_lib_00005.sql index 2a2f8bcca..11870cacb 100755 --- a/code/web/private_php/setup/sql/nel_ams_lib_00005.sql +++ b/code/web/private_php/setup/sql/nel_ams_lib_00005.sql @@ -1 +1 @@ -ALTER TABLE `ticket_attachments` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE `ticket_attachments` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; diff --git a/code/web/private_php/setup/sql/nel_ams_lib_00006.sql b/code/web/private_php/setup/sql/nel_ams_lib_00006.sql index f4c632bad..424bde970 100755 --- a/code/web/private_php/setup/sql/nel_ams_lib_00006.sql +++ b/code/web/private_php/setup/sql/nel_ams_lib_00006.sql @@ -1,8 +1,8 @@ CREATE TABLE IF NOT EXISTS `settings` ( `idSettings` int(11) NOT NULL, - `Setting` varchar(32) COLLATE utf8_unicode_ci NOT NULL, - `Value` varchar(256) COLLATE utf8_unicode_ci NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + `Setting` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, + `Value` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO `settings` (`idSettings`, `Setting`, `Value`) VALUES (1, 'userRegistration', '0'); diff --git a/code/web/private_php/setup/sql/nel_tool_00001.sql b/code/web/private_php/setup/sql/nel_tool_00001.sql index a01a1c4a5..1ea044a9d 100755 --- a/code/web/private_php/setup/sql/nel_tool_00001.sql +++ b/code/web/private_php/setup/sql/nel_tool_00001.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `nel_tool` @@ -36,7 +36,7 @@ CREATE TABLE IF NOT EXISTS `neltool_annotations` ( PRIMARY KEY (`annotation_id`), UNIQUE KEY `annotation_shard_id` (`annotation_shard_id`), UNIQUE KEY `annotation_domain_id` (`annotation_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=2 ; -- -- Dumping data for table `neltool_annotations` @@ -60,7 +60,7 @@ CREATE TABLE IF NOT EXISTS `neltool_applications` ( `application_visible` int(11) NOT NULL DEFAULT '0', `application_icon` varchar(128) NOT NULL DEFAULT '', PRIMARY KEY (`application_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=40 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=40 ; -- -- Dumping data for table `neltool_applications` @@ -126,7 +126,7 @@ CREATE TABLE IF NOT EXISTS `neltool_domains` ( `domain_mfs_web` text, `domain_cs_sql_string` varchar(255) DEFAULT NULL, PRIMARY KEY (`domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -143,7 +143,7 @@ CREATE TABLE IF NOT EXISTS `neltool_groups` ( `group_default_domain_id` tinyint(3) unsigned DEFAULT NULL, `group_default_shard_id` smallint(3) unsigned DEFAULT NULL, PRIMARY KEY (`group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=10 ; -- -- Dumping data for table `neltool_groups` @@ -172,7 +172,7 @@ CREATE TABLE IF NOT EXISTS `neltool_group_applications` ( PRIMARY KEY (`group_application_id`), KEY `group_application_group_id` (`group_application_group_id`), KEY `group_application_application_id` (`group_application_application_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=966 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=966 ; -- -- Dumping data for table `neltool_group_applications` @@ -370,7 +370,7 @@ CREATE TABLE IF NOT EXISTS `neltool_group_domains` ( `group_domain_domain_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`group_domain_id`), KEY `group_domain_group_id` (`group_domain_group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -386,7 +386,7 @@ CREATE TABLE IF NOT EXISTS `neltool_group_shards` ( PRIMARY KEY (`group_shard_id`), KEY `group_shard_group_id` (`group_shard_group_id`), KEY `group_shard_domain_id` (`group_shard_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `neltool_group_shards` @@ -408,7 +408,7 @@ CREATE TABLE IF NOT EXISTS `neltool_locks` ( PRIMARY KEY (`lock_id`), UNIQUE KEY `lock_shard_id` (`lock_shard_id`), UNIQUE KEY `lock_domain_id` (`lock_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -422,7 +422,7 @@ CREATE TABLE IF NOT EXISTS `neltool_logs` ( `logs_date` int(11) NOT NULL DEFAULT '0', `logs_data` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`logs_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -439,7 +439,7 @@ CREATE TABLE IF NOT EXISTS `neltool_notes` ( `note_active` int(11) NOT NULL DEFAULT '0', `note_global` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`note_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=11 ; -- -- Dumping data for table `neltool_notes` @@ -469,7 +469,7 @@ CREATE TABLE IF NOT EXISTS `neltool_restart_groups` ( PRIMARY KEY (`restart_group_id`), UNIQUE KEY `restart_group_id` (`restart_group_id`), KEY `restart_group_id_2` (`restart_group_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=6 ; -- -- Dumping data for table `neltool_restart_groups` @@ -495,7 +495,7 @@ CREATE TABLE IF NOT EXISTS `neltool_restart_messages` ( PRIMARY KEY (`restart_message_id`), UNIQUE KEY `restart_message_id` (`restart_message_id`), KEY `restart_message_id_2` (`restart_message_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=11 ; -- -- Dumping data for table `neltool_restart_messages` @@ -523,7 +523,7 @@ CREATE TABLE IF NOT EXISTS `neltool_restart_sequences` ( `restart_sequence_date_end` int(11) DEFAULT NULL, `restart_sequence_timer` int(11) unsigned DEFAULT '0', PRIMARY KEY (`restart_sequence_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -540,7 +540,7 @@ CREATE TABLE IF NOT EXISTS `neltool_shards` ( `shard_restart` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`shard_id`), KEY `shard_domain_id` (`shard_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -561,7 +561,7 @@ CREATE TABLE IF NOT EXISTS `neltool_stats_hd_datas` ( PRIMARY KEY (`hd_id`), KEY `hd_domain_id` (`hd_domain_id`), KEY `hd_server` (`hd_server`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -573,7 +573,7 @@ CREATE TABLE IF NOT EXISTS `neltool_stats_hd_times` ( `hd_domain_id` int(11) NOT NULL DEFAULT '0', `hd_last_time` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`hd_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -595,7 +595,7 @@ CREATE TABLE IF NOT EXISTS `neltool_users` ( UNIQUE KEY `user_login` (`user_name`), KEY `user_group_id` (`user_group_id`), KEY `user_active` (`user_active`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -610,7 +610,7 @@ CREATE TABLE IF NOT EXISTS `neltool_user_applications` ( PRIMARY KEY (`user_application_id`), KEY `user_application_user_id` (`user_application_user_id`), KEY `user_application_application_id` (`user_application_application_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -624,7 +624,7 @@ CREATE TABLE IF NOT EXISTS `neltool_user_domains` ( `user_domain_domain_id` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`user_domain_id`), KEY `user_domain_user_id` (`user_domain_user_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -640,7 +640,7 @@ CREATE TABLE IF NOT EXISTS `neltool_user_shards` ( PRIMARY KEY (`user_shard_id`), KEY `user_shard_user_id` (`user_shard_user_id`), KEY `user_shard_domain_id` (`user_shard_domain_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; diff --git a/code/web/private_php/setup/sql/ring_domain_00001.sql b/code/web/private_php/setup/sql/ring_domain_00001.sql index b5aa6dd1d..d5a8bd150 100755 --- a/code/web/private_php/setup/sql/ring_domain_00001.sql +++ b/code/web/private_php/setup/sql/ring_domain_00001.sql @@ -14,7 +14,7 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; -- -- Database: `ring_mini01` @@ -49,7 +49,7 @@ CREATE TABLE IF NOT EXISTS `characters` ( KEY `user_id_idx` (`user_id`), KEY `guild_idx` (`guild_id`), KEY `guild_id_idx` (`guild_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- @@ -65,7 +65,7 @@ CREATE TABLE IF NOT EXISTS `folder` ( PRIMARY KEY (`Id`), KEY `owner_idx` (`owner`), KEY `title_idx` (`title`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -80,7 +80,7 @@ CREATE TABLE IF NOT EXISTS `folder_access` ( PRIMARY KEY (`Id`), KEY `folder_id_idx` (`folder_id`), KEY `user_idx` (`user_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -95,7 +95,7 @@ CREATE TABLE IF NOT EXISTS `guilds` ( PRIMARY KEY (`guild_id`), KEY `shard_id_idx` (`shard_id`), KEY `guild_name_idx` (`guild_name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- @@ -110,7 +110,7 @@ CREATE TABLE IF NOT EXISTS `guild_invites` ( PRIMARY KEY (`Id`), KEY `guild_id_idx` (`guild_id`), KEY `session_id_idx` (`session_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -127,7 +127,7 @@ CREATE TABLE IF NOT EXISTS `journal_entry` ( `time_stamp` datetime NOT NULL DEFAULT '2005-09-07 12:41:33', PRIMARY KEY (`Id`), KEY `session_id_idx` (`session_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -144,7 +144,7 @@ CREATE TABLE IF NOT EXISTS `known_users` ( `comments` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`Id`), KEY `user_index` (`owner`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -158,7 +158,7 @@ CREATE TABLE IF NOT EXISTS `mfs_erased_mail_series` ( `erased_series` int(11) unsigned NOT NULL AUTO_INCREMENT, `erase_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`erased_series`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -175,7 +175,7 @@ CREATE TABLE IF NOT EXISTS `mfs_guild_thread` ( `post_count` int(11) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`thread_id`), KEY `guild_index` (`guild_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -190,7 +190,7 @@ CREATE TABLE IF NOT EXISTS `mfs_guild_thread_message` ( `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `content` text NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -209,7 +209,7 @@ CREATE TABLE IF NOT EXISTS `mfs_mail` ( `content` text NOT NULL, PRIMARY KEY (`id`), KEY `dest_index` (`dest_char_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -223,7 +223,7 @@ CREATE TABLE IF NOT EXISTS `outlands` ( `billing_instance_id` int(11) unsigned NOT NULL DEFAULT '0', `anim_session_id` int(11) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`session_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -247,7 +247,7 @@ CREATE TABLE IF NOT EXISTS `player_rating` ( PRIMARY KEY (`Id`), KEY `session_id_idx` (`scenario_id`), KEY `author_idx` (`author`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -276,7 +276,7 @@ CREATE TABLE IF NOT EXISTS `ring_users` ( UNIQUE KEY `user_name_idx` (`user_name`), KEY `cookie_idx` (`cookie`), KEY `current_session_idx` (`current_session`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- @@ -297,7 +297,7 @@ CREATE TABLE IF NOT EXISTS `scenario` ( `level` enum('sl_a','sl_b','sl_c','sl_d','sl_e','sl_f') NOT NULL DEFAULT 'sl_a', `allow_free_trial` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -316,7 +316,7 @@ CREATE TABLE IF NOT EXISTS `scenario_desc` ( PRIMARY KEY (`session_id`), UNIQUE KEY `title_idx` (`title`), KEY `parent_idx` (`parent_scenario`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- @@ -358,7 +358,7 @@ CREATE TABLE IF NOT EXISTS `sessions` ( KEY `owner_idx` (`owner`), KEY `folder_idx` (`folder_id`), KEY `state_type_idx` (`state`,`session_type`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1001 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1001 ; -- -------------------------------------------------------- @@ -377,7 +377,7 @@ CREATE TABLE IF NOT EXISTS `session_log` ( `owner` varchar(32) NOT NULL DEFAULT '0', `guild_name` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- -------------------------------------------------------- @@ -395,7 +395,7 @@ CREATE TABLE IF NOT EXISTS `session_participant` ( PRIMARY KEY (`Id`), KEY `session_idx` (`session_id`), KEY `user_idx` (`char_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=FIXED AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -410,7 +410,7 @@ CREATE TABLE IF NOT EXISTS `shard` ( `OldState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_restricted', `RequiredState` enum('ds_close','ds_dev','ds_restricted','ds_open') NOT NULL DEFAULT 'ds_dev', PRIMARY KEY (`shard_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=FIXED; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; diff --git a/code/web/private_php/setup/sql/webig_00001.sql b/code/web/private_php/setup/sql/webig_00001.sql index 9682d454a..707d68017 100755 --- a/code/web/private_php/setup/sql/webig_00001.sql +++ b/code/web/private_php/setup/sql/webig_00001.sql @@ -7,11 +7,11 @@ -- -------------------------------------------------------- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET NAMES utf8 */; +/*!40101 SET NAMES utf8mb4 */; /*!40014 SET FOREIGN_KEY_CHECKS=0 */; -- Dumping database structure for webig --- CREATE DATABASE IF NOT EXISTS `webig` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */; +-- CREATE DATABASE IF NOT EXISTS `webig` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin */; -- USE `webig`; @@ -19,20 +19,20 @@ CREATE TABLE IF NOT EXISTS `players` ( `id` INT(32) NOT NULL AUTO_INCREMENT, `cid` INT(32) NOT NULL DEFAULT '0', - `name` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `name` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0', `gender` INT(1) NOT NULL DEFAULT '0', `creation_date` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', `deleted` tinyint(1) NOT NULL DEFAULT '0', `last_login` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', `dev_shard` tinyint(4) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- Dumping structure for table webig.accounts CREATE TABLE IF NOT EXISTS `accounts` ( `uid` INT(10) DEFAULT NULL, - `web_privs` VARCHAR(255) COLLATE utf8_bin DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + `web_privs` VARCHAR(255) COLLATE utf8mb4_bin DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -- Data exporting was unselected. /*!40014 SET FOREIGN_KEY_CHECKS=1 */; diff --git a/code/web/public_php/admin/common.php b/code/web/public_php/admin/common.php index 1ddecc2d9..ceb9aa87b 100755 --- a/code/web/public_php/admin/common.php +++ b/code/web/public_php/admin/common.php @@ -32,7 +32,7 @@ $tpl = new Smarty; if (!is_object($tpl)) die("error on smarty init"); - $iPhone = (strstr($_SERVER['HTTP_USER_AGENT'], "iPhone") !== FALSE); + $iPhone = (strstr($_SERVER['HTTP_USER_AGENT'], "iPhone") !== FALSE); $tpl->assign('iPhone', $iPhone); $tpl->template_dir = NELTOOL_SYSTEMBASE .'/templates/default/'; diff --git a/code/web/public_php/admin/functions_common.php b/code/web/public_php/admin/functions_common.php index c7553fcba..a06183109 100755 --- a/code/web/public_php/admin/functions_common.php +++ b/code/web/public_php/admin/functions_common.php @@ -4,6 +4,13 @@ * THIS FILE SHOULD ONLY INCLUDE SMALL USEFUL FUNCTIONS */ + if (!function_exists('ereg')) { + /** removed from php 7.0.0 */ + function ereg($pattern, $line, &$match = array()) { + return preg_match('/'.$pattern.'/', $line, $match); + } + } + /* * pushes some data in the debug variable */ @@ -206,4 +213,4 @@ } } -?> \ No newline at end of file +?> diff --git a/code/web/public_php/admin/functions_mysql.php b/code/web/public_php/admin/functions_mysql.php deleted file mode 100755 index 79c968ca9..000000000 --- a/code/web/public_php/admin/functions_mysql.php +++ /dev/null @@ -1,381 +0,0 @@ -persistency = $persistency; - $this->user = $sqluser; - $this->password = $sqlpassword; - $this->server = $sqlserver; - $this->dbname = $database; - - if($this->persistency) - { - $this->db_connect_id = mysql_pconnect($this->server, $this->user, $this->password); - } - else - { - $this->db_connect_id = mysql_connect($this->server, $this->user, $this->password); - } - if($this->db_connect_id) - { - if($database != "") - { - $this->dbname = $database; - $dbselect = mysql_select_db($this->dbname); - if(!$dbselect) - { - mysql_close($this->db_connect_id); - $this->db_connect_id = $dbselect; - } - } - return $this->db_connect_id; - } - else - { - echo "Connection to mySQL failed!"; - exit; - } - } - - // - // Other base methods - // - function sql_close() - { - if($this->db_connect_id) - { - if($this->query_result) - { - @mysql_free_result($this->query_result); - } - $result = mysql_close($this->db_connect_id); - return $result; - } - else - { - return false; - } - } - - // - // Base query method - // - function sql_query($query = "", $transaction = FALSE) - { - // Remove any pre-existing queries - unset($this->query_result); - if($query != "") - { - nt_common_add_debug($query); - $this->num_queries++; - $this->query_result = mysql_query($query, $this->db_connect_id); - } - if($this->query_result) - { - unset($this->row[$this->query_result]); - unset($this->rowset[$this->query_result]); - return $this->query_result; - } - else - { - return ( $transaction == 'END_TRANSACTION' ) ? true : false; - } - } - - function sql_select_db($dbname) - { - if($this->db_connect_id) - { - $result = mysql_select_db($dbname, $this->db_connect_id); - return $result; - } - return false; - } - function sql_reselect_db() - { - if($this->db_connect_id) - { - $result = mysql_select_db($this->dbname, $this->db_connect_id); - return $result; - } - return false; - } - // - // Other query methods - // - function sql_numrows($query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $result = mysql_num_rows($query_id); - return $result; - } - else - { - return false; - } - } - function sql_affectedrows() - { - if($this->db_connect_id) - { - $result = mysql_affected_rows($this->db_connect_id); - return $result; - } - else - { - return false; - } - } - function sql_numfields($query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $result = mysql_num_fields($query_id); - return $result; - } - else - { - return false; - } - } - function sql_fieldname($offset, $query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $result = mysql_field_name($query_id, $offset); - return $result; - } - else - { - return false; - } - } - function sql_fieldtype($offset, $query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $result = mysql_field_type($query_id, $offset); - return $result; - } - else - { - return false; - } - } - function sql_fetchrow($query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $this->row[$query_id] = mysql_fetch_array($query_id); - return $this->row[$query_id]; - } - else - { - return false; - } - } - function sql_fetchrowset($query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - unset($this->rowset[$query_id]); - unset($this->row[$query_id]); - while($this->rowset[$query_id] = mysql_fetch_array($query_id)) - { - $result[] = $this->rowset[$query_id]; - } - return $result; - } - else - { - return false; - } - } - function sql_fetchfield($field, $rownum = -1, $query_id = 0) - { - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - if($rownum > -1) - { - $result = mysql_result($query_id, $rownum, $field); - } - else - { - if(empty($this->row[$query_id]) && empty($this->rowset[$query_id])) - { - if($this->sql_fetchrow()) - { - $result = $this->row[$query_id][$field]; - } - } - else - { - if($this->rowset[$query_id]) - { - $result = $this->rowset[$query_id][$field]; - } - else if($this->row[$query_id]) - { - $result = $this->row[$query_id][$field]; - } - } - } - return $result; - } - else - { - return false; - } - } - function sql_rowseek($rownum, $query_id = 0){ - if(!$query_id) - { - $query_id = $this->query_result; - } - if($query_id) - { - $result = mysql_data_seek($query_id, $rownum); - return $result; - } - else - { - return false; - } - } - function sql_nextid(){ - if($this->db_connect_id) - { - $result = mysql_insert_id($this->db_connect_id); - return $result; - } - else - { - return false; - } - } - function sql_freeresult($query_id = 0){ - if(!$query_id) - { - $query_id = $this->query_result; - } - - if ( $query_id ) - { - unset($this->row[$query_id]); - unset($this->rowset[$query_id]); - - @mysql_free_result($query_id); - - return true; - } - else - { - return false; - } - } - function sql_error($query_id = 0) - { - $result["message"] = mysql_error($this->db_connect_id); - $result["code"] = mysql_errno($this->db_connect_id); - - return $result; - } - -} // class sql_db - -class sql_db_string extends sql_db -{ - // - // Constructor ($connstring format : mysql://user:password@host/dbname) - // - function sql_db_string($connstring, $persistency = true) - { - $ret = false; - - if ($connstring != '') - { - if (ereg("^mysql\:\/\/([^\:]+)\:([^\@]+)\@([^\\]+)\/([^\/]+)[\/]?$", $connstring, $params)) - { - $sqlserver = $params[3]; - $sqluser = $params[1]; - $sqlpassword = $params[2]; - $database = $params[4]; - - $ret = $this->sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency); - } - } - - return $ret; - } -} // class sql_db_string - - -} // if ... define - -?> \ No newline at end of file diff --git a/code/web/public_php/admin/functions_mysqli.php b/code/web/public_php/admin/functions_mysqli.php index 8cc2737c3..82ef9efa7 100755 --- a/code/web/public_php/admin/functions_mysqli.php +++ b/code/web/public_php/admin/functions_mysqli.php @@ -41,7 +41,7 @@ class sql_db // // Constructor // - function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true) + function __construct($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true) { $this->persistency = $persistency; @@ -72,8 +72,7 @@ class sql_db } else { - echo "Connection to mySQL failed!"; - exit; + throw new \RuntimeException('Connection to mySQL failed!'); } } @@ -270,7 +269,7 @@ class sql_db_string extends sql_db // // Constructor ($connstring format : mysql://user:password@host/dbname) // - function sql_db_string($connstring, $persistency = true) + function __construct($connstring, $persistency = true) { $ret = false; if ($connstring != '') @@ -282,10 +281,9 @@ class sql_db_string extends sql_db $sqlpassword = $params[2]; $database = $params[4]; - $ret = $this->sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency); + $ret = parent::__construct($sqlserver, $sqluser, $sqlpassword, $database, $persistency); } } - return $ret; } } // class sql_db_string diff --git a/code/web/public_php/admin/functions_tool_log_analyser.php b/code/web/public_php/admin/functions_tool_log_analyser.php index 3d5478b4b..caf79a9b3 100755 --- a/code/web/public_php/admin/functions_tool_log_analyser.php +++ b/code/web/public_php/admin/functions_tool_log_analyser.php @@ -30,7 +30,7 @@ reset($file_list); foreach($file_list as $tmp_key => $tmp_val) { - $date_ary[$tmp_key] = $file_list['date']; + $date_ary[$tmp_key] = $tmp_val['date']; } array_multisort($date_ary, SORT_DESC, $file_list); @@ -242,4 +242,4 @@ } -?> \ No newline at end of file +?> diff --git a/code/web/public_php/admin/functions_tool_main.php b/code/web/public_php/admin/functions_tool_main.php index cb541a83e..97d833fd3 100755 --- a/code/web/public_php/admin/functions_tool_main.php +++ b/code/web/public_php/admin/functions_tool_main.php @@ -320,6 +320,9 @@ foreach($sline_vars as $sline_var) { $sline_parts = explode("=", $sline_var); + if (!isset($sline_parts[1])) { + $sline_parts[1] = ''; + } if ($sline_parts[0] == 'RunningState') { @@ -1023,6 +1026,7 @@ function tool_main_get_shards_info_from_db($application, $status, $filters, $ringsqlstring='') { $shard_list = array(); + $shard_list2 = array(); $shard_list_result = array(); //nt_common_add_debug('in tool_main_get_shards_info_from_db()'); @@ -1034,7 +1038,7 @@ foreach($status as $sline) { $shard_name = trim($sline['ShardName']); - $shard_id = trim($sline['ShardId']); + $shard_id = isset($sline['ShardId']) ? trim($sline['ShardId']) : ''; if (($shard_name != '' && $shard_id != '') && (isset($filters[$shard_name]) || isset($filters['_all_']))) { diff --git a/code/web/public_php/admin/jpgraph/jpgraph.php b/code/web/public_php/admin/jpgraph/jpgraph.php index ee41112fc..0d0dfbfbf 100755 --- a/code/web/public_php/admin/jpgraph/jpgraph.php +++ b/code/web/public_php/admin/jpgraph/jpgraph.php @@ -225,7 +225,7 @@ require_once 'jpgraph_gradient.php'; class ErrMsgText { var $lt=NULL; var $supportedLocales = array('en'); - function ErrMsgText() { + function __construct() { GLOBAL $__jpg_err_locale; if( !in_array($__jpg_err_locale,$this->supportedLocales) ) $aLoc = 'en'; @@ -294,16 +294,16 @@ GLOBAL $__jpg_err; GLOBAL $__jpg_err_locale ; $__jpg_err_locale = 'en'; class JpGraphError { - function Install($aErrObject) { + static function Install($aErrObject) { GLOBAL $__jpg_err; $__jpg_err = $aErrObject; } - function Raise($aMsg,$aHalt=true){ + static function Raise($aMsg,$aHalt=true){ GLOBAL $__jpg_err; $tmp = new $__jpg_err; $tmp->Raise($aMsg,$aHalt); } - function RaiseL($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { + static function RaiseL($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { GLOBAL $__jpg_err; $t = new ErrMsgText(); $msg = $t->Get($errnbr,$a1,$a2,$a3,$a4,$a5); @@ -383,7 +383,7 @@ class JpGraphErrObject { var $iTitle = "JpGraph Error"; var $iDest = false; - function JpGraphErrObject() { + function __construct() { // Empty. Reserved for future use } @@ -631,7 +631,7 @@ class JpgTimer { var $idx; //--------------- // CONSTRUCTOR - function JpgTimer() { + function __construct() { $this->idx=0; } @@ -671,7 +671,7 @@ class DateLocale { //--------------- // CONSTRUCTOR - function DateLocale() { + function __construct() { settype($this->iDayAbb, 'array'); settype($this->iShortDay, 'array'); settype($this->iShortMonth, 'array'); @@ -758,7 +758,7 @@ class Footer { var $iRightMargin = 3; var $iBottomMargin = 3; - function Footer() { + function __construct() { $this->left = new Text(); $this->left->ParagraphAlign('left'); $this->center = new Text(); @@ -866,7 +866,7 @@ class Graph { // aTimeOut Timeout in minutes for image in cache // aInline If true the image is streamed back in the call to Stroke() // If false the image is just created in the cache - function Graph($aWidth=300,$aHeight=200,$aCachedName="",$aTimeOut=0,$aInline=true) { + function __construct($aWidth=300,$aHeight=200,$aCachedName="",$aTimeOut=0,$aInline=true) { GLOBAL $gJpgBrandTiming; // If timing is used create a new timing object if( $gJpgBrandTiming ) { @@ -3071,7 +3071,7 @@ class TTF { var $font_files,$style_names; //--------------- // CONSTRUCTOR - function TTF() { + function __construct() { $this->style_names=array(FS_NORMAL=>'normal',FS_BOLD=>'bold',FS_ITALIC=>'italic',FS_BOLDITALIC=>'bolditalic'); // File names for available fonts $this->font_files=array( @@ -3193,7 +3193,7 @@ class Text { // CONSTRUCTOR // Create new text at absolute pixel coordinates - function Text($aTxt="",$aXAbsPos=0,$aYAbsPos=0) { + function __construct($aTxt="",$aXAbsPos=0,$aYAbsPos=0) { if( ! is_string($aTxt) ) { JpGraphError::RaiseL(25050);//('First argument to Text::Text() must be s atring.'); } @@ -3429,7 +3429,8 @@ class GraphTabTitle extends Text{ var $corner = 6 , $posx = 7, $posy = 4; var $color='darkred',$fillcolor='lightyellow',$bordercolor='black'; var $align = 'left', $width=TABTITLE_WIDTHFIT; - function GraphTabTitle() { + function __construct() { + parent::__construct(); $this->t = ''; $this->font_style = FS_BOLD; $this->hide = true; @@ -3450,8 +3451,9 @@ class GraphTabTitle extends Text{ $this->align = $aAlign; } - function SetPos($aAlign) { - $this->align = $aAlign; + function SetPos($aXAbsPos = 0, $aYAbsPos = 0, $aHAlign = 'left', $aVAlign = 'top') { + //$this->align = $aXAbsPos; + throw new \Exception('Invalid function call. should use SetTabAlign()'); } function SetWidth($aWidth) { @@ -3467,7 +3469,8 @@ class GraphTabTitle extends Text{ $this->corner = $aD ; } - function Stroke(&$aImg) { + // parent class compat function + function Stroke(&$aImg, $x = NULL, $y = NULL) { if( $this->hide ) return; $this->boxed = false; @@ -3560,8 +3563,8 @@ class SuperScriptText extends Text { var $iSDir=0; var $iSimple=false; - function SuperScriptText($aTxt="",$aSuper="",$aXAbsPos=0,$aYAbsPos=0) { - parent::Text($aTxt,$aXAbsPos,$aYAbsPos); + function __construct($aTxt="",$aSuper="",$aXAbsPos=0,$aYAbsPos=0) { + parent::__construct($aTxt,$aXAbsPos,$aYAbsPos); $this->iSuper = $aSuper; } @@ -3738,7 +3741,7 @@ class Grid { var $fill=false,$fillcolor=array('#EFEFEF','#BBCCFF'); //--------------- // CONSTRUCTOR - function Grid(&$aAxis) { + function __construct(&$aAxis) { $this->scale = &$aAxis->scale; $this->img = &$aAxis->img; } @@ -3901,7 +3904,7 @@ class Axis { //--------------- // CONSTRUCTOR - function Axis(&$img,&$aScale,$color=array(0,0,0)) { + function __construct(&$img,&$aScale,$color=array(0,0,0)) { $this->img = &$img; $this->scale = &$aScale; $this->color = $color; @@ -4356,7 +4359,7 @@ class Ticks { //--------------- // CONSTRUCTOR - function Ticks(&$aScale) { + function __construct(&$aScale) { $this->scale=&$aScale; $this->precision = -1; } @@ -4483,7 +4486,8 @@ class LinearTicks extends Ticks { //--------------- // CONSTRUCTOR - function LinearTicks() { + function __construct() { + parent::__construct(); $this->precision = -1; } @@ -4825,7 +4829,7 @@ class LinearScale { var $name = 'lin'; //--------------- // CONSTRUCTOR - function LinearScale($aMin=0,$aMax=0,$aType="y") { + function __construct($aMin=0,$aMax=0,$aType="y") { assert($aType=="x" || $aType=="y" ); assert($aMin<=$aMax); @@ -5360,7 +5364,7 @@ class LinearScale { class RGB { var $rgb_table; var $img; - function RGB(&$aImg) { + function __construct(&$aImg) { $this->img = &$aImg; // Conversion array between color names and RGB @@ -5950,7 +5954,7 @@ class Image { //--------------- // CONSTRUCTOR - function Image($aWidth,$aHeight,$aFormat=DEFAULT_GFORMAT) { + function __construct($aWidth,$aHeight,$aFormat=DEFAULT_GFORMAT) { $this->CreateImgCanvas($aWidth,$aHeight); $this->SetAutoMargin(); @@ -7531,8 +7535,8 @@ class RotImage extends Image { var $a=0; var $dx=0,$dy=0,$transx=0,$transy=0; - function RotImage($aWidth,$aHeight,$a=0,$aFormat=DEFAULT_GFORMAT) { - $this->Image($aWidth,$aHeight,$aFormat); + function __construct($aWidth,$aHeight,$a=0,$aFormat=DEFAULT_GFORMAT) { + parent::__construct($aWidth,$aHeight,$aFormat); $this->dx=$this->left_margin+$this->plotwidth/2; $this->dy=$this->top_margin+$this->plotheight/2; $this->SetAngle($a); @@ -7597,7 +7601,7 @@ class RotImage extends Image { parent::Arc($xc,$yc,$w,$h,$s,$e); } - function FilledArc($xc,$yc,$w,$h,$s,$e) { + function FilledArc($xc,$yc,$w,$h,$s,$e, $style='') { list($xc,$yc) = $this->Rotate($xc,$yc); $s += $this->a; $e += $this->a; @@ -7686,7 +7690,7 @@ class ImgStreamCache { var $timeout=0; // Infinite timeout //--------------- // CONSTRUCTOR - function ImgStreamCache(&$aImg, $aCacheDir=CACHE_DIR) { + function __construct(&$aImg, $aCacheDir=CACHE_DIR) { $this->img = &$aImg; $this->cache_dir = $aCacheDir; } @@ -7862,7 +7866,7 @@ class Legend { var $reverse = false ; //--------------- // CONSTRUCTOR - function Legend() { + function __construct() { // Empty } //--------------- @@ -8334,7 +8338,7 @@ class Plot { var $legendcsimalt=''; //--------------- // CONSTRUCTOR - function Plot(&$aDatay,$aDatax=false) { + function __construct(&$aDatay,$aDatax=false) { $this->numpoints = count($aDatay); if( $this->numpoints==0 ) JpGraphError::RaiseL(25121);//("Empty input data array specified for plot. Must have at least one data point."); @@ -8510,7 +8514,7 @@ class PlotLine { //--------------- // CONSTRUCTOR - function PlotLine($aDir=HORIZONTAL,$aPos=0,$aColor="black",$aWeight=1) { + function __construct($aDir=HORIZONTAL,$aPos=0,$aColor="black",$aWeight=1) { $this->direction = $aDir; $this->color=$aColor; $this->weight=$aWeight; diff --git a/code/web/public_php/admin/jpgraph/jpgraph_gradient.php b/code/web/public_php/admin/jpgraph/jpgraph_gradient.php index d7382c060..356657950 100755 --- a/code/web/public_php/admin/jpgraph/jpgraph_gradient.php +++ b/code/web/public_php/admin/jpgraph/jpgraph_gradient.php @@ -34,7 +34,7 @@ class Gradient { var $numcolors=100; //--------------- // CONSTRUCTOR - function Gradient(&$img) { + function __construct(&$img) { $this->img = &$img; } diff --git a/code/web/public_php/admin/jpgraph/jpgraph_line.php b/code/web/public_php/admin/jpgraph/jpgraph_line.php index 4f9c0d0fb..60ef128ce 100755 --- a/code/web/public_php/admin/jpgraph/jpgraph_line.php +++ b/code/web/public_php/admin/jpgraph/jpgraph_line.php @@ -36,8 +36,8 @@ class LinePlot extends Plot{ //--------------- // CONSTRUCTOR - function LinePlot(&$datay,$datax=false) { - $this->Plot($datay,$datax); + function __construct(&$datay,$datax=false) { + parent::__construct($datay,$datax); $this->mark = new PlotMark(); } //--------------- @@ -424,7 +424,7 @@ class AccLinePlot extends Plot { var $iStartEndZero=true; //--------------- // CONSTRUCTOR - function AccLinePlot($plots) { + function __construct($plots) { $this->plots = $plots; $this->nbrplots = count($plots); $this->numpoints = $plots[0]->numpoints; diff --git a/code/web/public_php/admin/jpgraph/jpgraph_log.php b/code/web/public_php/admin/jpgraph/jpgraph_log.php index 95882e71a..d9561f56e 100755 --- a/code/web/public_php/admin/jpgraph/jpgraph_log.php +++ b/code/web/public_php/admin/jpgraph/jpgraph_log.php @@ -23,8 +23,8 @@ class LogScale extends LinearScale { // CONSTRUCTOR // Log scale is specified using the log of min and max - function LogScale($min,$max,$type="y") { - $this->LinearScale($min,$max,$type); + function __construct($min,$max,$type="y") { + parent::__construct($min,$max,$type); $this->ticks = new LogTicks(); $this->name = 'log'; } @@ -84,7 +84,7 @@ class LogScale extends LinearScale { // Note that for log autoscale the "maxstep" the fourth argument // isn't used. This is just included to give the method the same // signature as the linear counterpart. - function AutoScale(&$img,$min,$max,$dummy) { + function AutoScale(&$img,$min,$max,$dummy, $dummy2 = true) { if( $min==0 ) $min=1; if( $max <= 0 ) { @@ -107,7 +107,8 @@ class LogTicks extends Ticks{ var $label_logtype=LOGLABELS_MAGNITUDE; //--------------- // CONSTRUCTOR - function LogTicks() { + function __construct() { + parent::__construct(); } //--------------- // PUBLIC METHODS @@ -264,4 +265,4 @@ class LogTicks extends Ticks{ } } // Class /* EOF */ -?> \ No newline at end of file +?> diff --git a/code/web/public_php/admin/jpgraph/jpgraph_plotmark.inc b/code/web/public_php/admin/jpgraph/jpgraph_plotmark.inc index bc955bda7..c555aab6e 100755 --- a/code/web/public_php/admin/jpgraph/jpgraph_plotmark.inc +++ b/code/web/public_php/admin/jpgraph/jpgraph_plotmark.inc @@ -59,7 +59,7 @@ class FlagCache { global $_gFlagCache; require_once('jpgraph_flags.php'); if( $_gFlagCache[$aSize] === null ) { - $_gFlagCache[$aSize] =& new FlagImages($aSize); + $_gFlagCache[$aSize] = new FlagImages($aSize); } $f =& $_gFlagCache[$aSize]; $idx = $f->GetIdxByName($aName,$aFullName); @@ -89,7 +89,7 @@ class PlotMark { //-------------- // CONSTRUCTOR - function PlotMark() { + function __construct() { $this->title = new Text(); $this->title->Hide(); $this->csimareas = ''; @@ -479,4 +479,4 @@ class PlotMark { } // Class -?> \ No newline at end of file +?> diff --git a/code/web/public_php/admin/jpgraph/jpgraph_polar.php b/code/web/public_php/admin/jpgraph/jpgraph_polar.php index acab58b88..1690fcb2a 100755 --- a/code/web/public_php/admin/jpgraph/jpgraph_polar.php +++ b/code/web/public_php/admin/jpgraph/jpgraph_polar.php @@ -47,7 +47,7 @@ class PolarPlot { var $csimalts=null; // ALT:s for corresponding target var $line_style='solid',$mark; - function PolarPlot($aData) { + function __construct($aData) { $n = count($aData); if( $n & 1 ) { JpGraphError::RaiseL(17001); diff --git a/code/web/public_php/admin/jpgraph/jpgraph_radar.php b/code/web/public_php/admin/jpgraph/jpgraph_radar.php index ac3b8b38c..d08ca0d11 100755 --- a/code/web/public_php/admin/jpgraph/jpgraph_radar.php +++ b/code/web/public_php/admin/jpgraph/jpgraph_radar.php @@ -15,7 +15,7 @@ require_once('jpgraph_plotmark.inc'); class RadarLogTicks extends Ticks { //--------------- // CONSTRUCTOR - function RadarLogTicks() { + function __construct() { } //--------------- // PUBLIC METHODS @@ -468,17 +468,17 @@ class RadarGraph extends Graph { //("Illegal scale for radarplot ($axtype). Must be \"lin\" or \"log\""); } if( $axtype=="lin" ) { - $this->yscale = & new LinearScale($ymin,$ymax); - $this->yscale->ticks = & new RadarLinearTicks(); + $this->yscale = new LinearScale($ymin,$ymax); + $this->yscale->ticks = new RadarLinearTicks(); $this->yscale->ticks->SupressMinorTickMarks(); } elseif( $axtype=="log" ) { - $this->yscale = & new LogScale($ymin,$ymax); - $this->yscale->ticks = & new RadarLogTicks(); + $this->yscale = new LogScale($ymin,$ymax); + $this->yscale->ticks = new RadarLogTicks(); } - $this->axis = & new RadarAxis($this->img,$this->yscale); - $this->grid = & new RadarGrid(); + $this->axis = new RadarAxis($this->img,$this->yscale); + $this->grid = new RadarGrid(); } function SetSize($aSize) { @@ -644,4 +644,4 @@ class RadarGraph extends Graph { } // Class /* EOF */ -?> \ No newline at end of file +?> diff --git a/code/web/public_php/admin/nel/nel_message.php b/code/web/public_php/admin/nel/nel_message.php index 42dd91cbe..ab0e55f0e 100755 --- a/code/web/public_php/admin/nel/nel_message.php +++ b/code/web/public_php/admin/nel/nel_message.php @@ -19,7 +19,7 @@ var $InputStream; var $Pos; - function CMemStream () + function __construct() { $this->InputStream = false; $this->Pos = 0; @@ -104,11 +104,6 @@ { var $MsgName; - function CMessage() - { - $this->CMemStream(); - } - function setName($name) { $this->MsgName = $name; diff --git a/code/web/public_php/admin/smarty/Smarty.class.php b/code/web/public_php/admin/smarty/Smarty.class.php index 39eed5fc5..d57c1f67e 100755 --- a/code/web/public_php/admin/smarty/Smarty.class.php +++ b/code/web/public_php/admin/smarty/Smarty.class.php @@ -566,7 +566,7 @@ class Smarty /** * The class constructor. */ - function Smarty() + function __construct() { $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); diff --git a/code/web/public_php/admin/smarty/Smarty_Compiler.class.php b/code/web/public_php/admin/smarty/Smarty_Compiler.class.php index c1bc798d1..27bf469f1 100755 --- a/code/web/public_php/admin/smarty/Smarty_Compiler.class.php +++ b/code/web/public_php/admin/smarty/Smarty_Compiler.class.php @@ -78,8 +78,10 @@ class Smarty_Compiler extends Smarty { /** * The class constructor. */ - function Smarty_Compiler() + function __construct() { + parent::__construct(); + // matches double quoted strings: // "foobar" // "foo\"bar" @@ -262,12 +264,11 @@ class Smarty_Compiler extends Smarty { reset($this->_folded_blocks); /* replace special blocks by "{php}" */ - $source_content = preg_replace_callback($search, create_function ('$matches', "return '" - . $this->_quote_replace($this->left_delimiter) . 'php' - . "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'" - . $this->_quote_replace($this->right_delimiter) - . "';") - , $source_content); + $source_content = preg_replace_callback($search, function($matches) { + return $this->_quote_replace($this->left_delimiter).'php'. + str_repeat("\n", substr_count($matches[1], "\n")). + $this->_quote_replace($this->right_delimiter); + }, $source_content); /* Gather all template tags. */ preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match); @@ -556,7 +557,7 @@ class Smarty_Compiler extends Smarty { case 'php': /* handle folded tags replaced by {php} */ - list(, $block) = each($this->_folded_blocks); + $block = current($this->_folded_blocks); $this->_current_line_no += substr_count($block[0], "\n"); /* the number of matched elements in the regexp in _compile_file() determins the type of folded tag that was found */ diff --git a/code/web/public_php/admin/templates/default/_index.tpl b/code/web/public_php/admin/templates/default/_index.tpl deleted file mode 100755 index 9f7a11340..000000000 --- a/code/web/public_php/admin/templates/default/_index.tpl +++ /dev/null @@ -1,486 +0,0 @@ - -{include file="page_header.tpl"} - -{literal} - -{/literal} - -
- - - - - - - - - -
- -{if $tool_domain_selected && $tool_shard_selected} - - - - - - - - -{if $tool_refresh_rate > 0} - - - -{/if} - -
Refresh
- -
- - -
-
-{/if} - - - - - -{section name=domain loop=$tool_domain_list} - - - -{/section} -
Domains
{$tool_domain_list[domain].domain_name}
- -{if $tool_domain_selected} -
- - - - -{section name=shard loop=$tool_shard_list} -{if $tool_domain_selected == $tool_shard_list[shard].shard_domain_id} - - - -{/if} -{/section} -
Shards
{$tool_shard_list[shard].shard_name}
-{/if} - -{if $restriction_tool_notes && $tool_note_list} -
- - - - -{section name=note loop=$tool_note_list} - -{if $tool_note_list[note].note_mode == 0} - -{elseif $tool_note_list[note].note_mode == 1} - -{/if} - -{/section} -
Notes
{$tool_note_list[note].note_title}{$tool_note_list[note].note_title}
-{/if} - -{if $tool_hd_list} -
- - - - -{section name=hd loop=$tool_hd_list} -{if $tool_hd_list[hd].hd_percent >= 85}{assign var="hdtrclass" value="row_red"} -{elseif $tool_hd_list[hd].hd_percent >= 75}{assign var="hdtrclass" value="row_orange_light"} -{else}{assign var="hdtrclass" value="row0"}{/if} - - - - -{/section} - - - -
HardDrives
{$tool_hd_list[hd].hd_server}{$tool_hd_list[hd].hd_percent}%
{$tool_hd_time|date_format:"%Y/%m/%d %H:%M:%S"}
-{/if} - -
  -{if tool_domain_selected && $tool_shard_selected} - - -{if $tool_annotation_info || $tool_has_lock} - - - - -{/if} - - - - - - -
Annotation {if $tool_has_lock}{/if} -{if $tool_annotation_info} - ({$tool_annotation_info.annotation_user_name} @ {$tool_annotation_info.annotation_date|date_format:"%Y/%m/%d %H:%M:%S"}) -{/if} -
Lock -{if $tool_no_lock} -{* if (!$tool_lock_info || $tool_lock_info.lock_shard_id) && !$tool_cant_lock && ($tool_shard_restart_status == 0) && !$tool_no_domain_lock *} -{if (!$tool_lock_info || $tool_lock_info.lock_shard_id) && !$tool_cant_lock && !$tool_no_domain_lock} - {if $restriction_tool_main_lock_shard}{/if} -{else} - Lock unavailable, a restart sequence is active ! -{/if} -{if ($tool_shard_restart_status == 0) && ($tool_domain_has_shard_restart == 0)} - {if $restriction_tool_main_lock_domain}{/if} -{/if} -{elseif $tool_has_shard_lock} -{if $tool_shard_restart_status == 0} - -{/if} -{if ($tool_shard_restart_status == 0) && ($tool_domain_has_shard_restart == 0)} - {if $restriction_tool_main_lock_domain}{/if} -{elseif $tool_shard_restart_status > 0} - Restart Sequence is active ! -{/if} - -{if $restriction_tool_main_easy_restart && ($tool_shard_restart_status == 0)} - - -{/if} - -{elseif $tool_has_domain_lock} - -{/if} -{if $tool_lock_info} -{if $tool_lock_info.lock_domain_id} Domain{elseif $tool_lock_info.lock_shard_id} Shard{/if} - Locked by {$tool_lock_info.lock_user_name} @ {$tool_lock_info.lock_date|date_format:"%Y/%m/%d %H:%M:%S"} -{else} - Unlocked. -{/if} -
-
-{/if} - -{if !$tool_domain_selected} - - - - -
You need to select a domain.
-{elseif !$tool_shard_selected} - - - - -
You need to select a shard.
-{elseif $tool_domain_error} - - - - -
{$tool_domain_error}
-{else} -{if $tool_as_error} - - - - -
{$tool_as_error}
-
-{/if} -
- - - - - -{**} - -{**} - - - - - - - - - - - - - -{section name=service loop=$tool_services_list} -{assign var="service_shard_id" value=$tool_services_list[service].ShardName} -{if $tool_shard_filters.$service_shard_id || $tool_shard_filters._all_ || ($tool_shard_filters._unknown_ && !$tool_services_list[service].ShardName)} -{cycle assign="trclass" values="row0,row1"} -{assign var="tdclass1" value=""} -{assign var="tdclass2" value=""} -{if $tool_services_list[service]._flags_.rs_stopped}{assign var="tdclass1" value="class=\"cell_inactive1\""}{assign var="tdclass2" value="class=\"cell_inactive2\""}{assign var="trclass" value="row_stopped"}{/if} -{if $tool_services_list[service]._flags_.rs_starting}{* assign var="tdclass1" value="class=\"cell_inactive1\"" *}{assign var="tdclass2" value="class=\"cell_inactive2\""}{assign var="trclass" value="row_starting"}{/if} -{if $tool_services_list[service]._flags_.alert_red && ($tool_services_list[service]._flags_.rs_starting || $tool_services_list[service]._flags_.rs_online)}{assign var="trclass" value="row_red"} -{elseif $tool_services_list[service]._flags_.alert_orange_dark && ($tool_services_list[service]._flags_.rs_starting || $tool_services_list[service]._flags_.rs_online)}{assign var="trclass" value="row_orange_dark"} -{elseif $tool_services_list[service]._flags_.alert_orange_light && ($tool_services_list[service]._flags_.rs_starting || $tool_services_list[service]._flags_.rs_online)}{assign var="trclass" value="row_orange_light"}{/if} -{assign var="check_name" value=$tool_services_list[service].AliasName} - - - - -{**} - -{**} - - - - - - - - - - - - - -{/if} -{/section} -
AliasNameShardLongNameShortNameServiceAliasHostnameRunning StateRunning OrdersRunning TagsStateReportStart CountersUser SLTick SLMemoryNbPlayersUpTime
{$tool_services_list[service].AliasName}{if $tool_services_list[service].ShardName != ""}{$tool_services_list[service].ShardName}{else}?{/if}{if $tool_services_list[service].ShardId != ""}/{$tool_services_list[service].ShardId}{/if}{$tool_services_list[service].LongName}{$tool_services_list[service].ShortName}{$tool_services_list[service].ServiceAlias}{$tool_services_list[service].Hostname}{$tool_services_list[service].RunningState}{$tool_services_list[service].RunningOrders}{$tool_services_list[service].RunningTags}{$tool_services_list[service].State}{$tool_services_list[service].NoReportSince}{$tool_services_list[service].StartCounter}{$tool_services_list[service].UserSpeedLoop}{$tool_services_list[service].TickSpeedLoop}{$tool_services_list[service].ProcessUsedMemory}{$tool_services_list[service].NbPlayers}{$tool_services_list[service].UpTime}
- - -
- - -{if $restriction_tool_main_easy_restart && ($tool_shard_restart_status > 0)} - -{include file="index_restart_sequence.tpl"} - -{else} - -{if $restriction_tool_main_ws} -
- - - - - -
WS : {if $restriction_tool_main_ws_old}
new/old{/if}
-{if $restriction_tool_main_ws_old} - -{/if} -
- - - - - -{section name=shard loop=$tool_shard_run_list} -{assign var="sname" value=$tool_shard_run_list[shard]} -{if $tool_shard_infos[$sname] && $tool_shard_su_name} - - - - - - - -{/if} -{/section} -
 {$tool_shard_run_list[shard]} -  
-
-
-{/if} - -{if $restriction_tool_main_start || $restriction_tool_main_stop || $restriction_tool_main_restart || $restriction_tool_main_kill || $restriction_tool_main_abort || $restriction_tool_main_reset_counters || $restriction_tool_main_service_autostart} -
- - - - - -
Services :   -{if $restriction_tool_main_start} -   -{/if} -{if $restriction_tool_main_stop} -   -{/if} -{if $restriction_tool_main_restart} -   -{/if} -{if $restriction_tool_main_kill} -   -{/if} -{if $restriction_tool_main_abort} -   -{/if} -{if $restriction_tool_main_service_autostart} -   -   -{/if} -{if $restriction_tool_main_reset_counters} -   -{/if} -
-{/if} - -{if $restriction_tool_main_shard_autostart && $tool_shard_run_list} -
- - - - - -
Shards : - -{section name=shard loop=$tool_shard_run_list} -{assign var="sname" value=$tool_shard_run_list[shard]} - - - - - -{/section} -
 {$tool_shard_run_list[shard]}{if $sname != ""}{$tool_shard_orders[$sname]|replace:'_':' '}{/if}  -   -   -
-{/if} - -{if $restriction_tool_main_execute} -
- - - - - -
Command :    -   -
- -{if $tool_execute_command} -
- - - - - - - -
Command Results for '{$tool_execute_command}' :
-{/if} -{/if} - -{* end of: if $restriction_tool_main_easy_restart && ($tool_shard_restart_status > 0) *} -{/if} -
-{/if} - -
- - -{include file="page_footer.tpl"} diff --git a/code/web/public_php/admin/templates/default/index.tpl b/code/web/public_php/admin/templates/default/index.tpl index 04fe742df..6f7dea40f 100755 --- a/code/web/public_php/admin/templates/default/index.tpl +++ b/code/web/public_php/admin/templates/default/index.tpl @@ -195,7 +195,7 @@   -{if tool_domain_selected && $tool_shard_selected} +{if $tool_domain_selected && $tool_shard_selected} {if $tool_annotation_info || $tool_has_lock} diff --git a/code/web/public_php/ams/templates/layout.tpl b/code/web/public_php/ams/templates/layout.tpl index 7720ca65c..8e19e1ec5 100755 --- a/code/web/public_php/ams/templates/layout.tpl +++ b/code/web/public_php/ams/templates/layout.tpl @@ -22,6 +22,7 @@ + @@ -33,11 +34,6 @@ - - - @@ -229,9 +225,6 @@ _("status").innerHTML = "upload Aborted"; } - - -