Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into meshageddon
Browse files Browse the repository at this point in the history
  • Loading branch information
JMPZ11 committed Jun 10, 2024
2 parents 03caa53 + 2b943b4 commit 1cd6574
Show file tree
Hide file tree
Showing 73 changed files with 1,481 additions and 1,081 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
== CHANGELOG ==

* Fixed mouse wheel sensitivity in walk mode and in the UV editor.

#### NifSkope-2.0.dev9-20240608

* The UV editor now supports exporting Starfield .mesh files. Note: currently only the first available LOD can be edited, and to be able to render the model with the modifications, the file needs to be saved to a path where it is found by NifSkope as a resource, and the NIF reloaded (Alt+X) after closing resources (Alt+Q).
* Implemented the "Flip UV" and "Remove Unused Vertices" spells for BSTriShape geometry. Note that skinned meshes are not supported yet by the latter.
* Fixed the "Search Other Games if no match" resource setting, and the edit and browse path widgets not being enabled/disabled according to the game status.
* SizedString16 data fields are now shown and can be edited as strings.
* Anti-aliasing above 4x can be enabled on Linux by adding "Render\\General\\Antialiasing%20Limit=4" to the configuration file (NifTools/NifSkope 2.0.conf) under Settings.
* Minor Starfield rendering optimization.

#### NifSkope-2.0.dev9-20240602

* Added limited (read only) Starfield support to the UV editor.
* Implemented texture slot selection in the UV editor for Fallout 3 and newer games.
* Fixed textures not being rendered in the UV editor.
* Implemented the Prune Triangles mesh spell for games using BSTriShape geometry.
* Layered emissivity settings are now shown in Starfield BSLightingShaderProperty blocks.
* The resource manager has been overhauled to allow for multiple loose NIF files to use local data paths when opened in separate windows. GameManager functions can now also be accessed from NifModel.
* Starfield rendering fixes.

#### NifSkope-2.0.dev9-20240521
Expand Down
31 changes: 21 additions & 10 deletions NifSkope.pro
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ HEADERS += \
src/glview.h \
src/message.h \
src/nifskope.h \
src/qtcompat.h \
src/spellbook.h \
src/version.h \
lib/dds.h \
Expand Down Expand Up @@ -450,22 +451,32 @@ win32 {


# MinGW, GCC
# Recommended: GCC 4.8.1+
# Recommended: GCC 13+
*-g++ {

# COMPILER FLAGS

# Optimization flags
QMAKE_CXXFLAGS_DEBUG -= -O0 -g
QMAKE_CXXFLAGS_DEBUG *= -Og -g3
contains(noavx2, 1) {
QMAKE_CXXFLAGS_RELEASE *= -O3 -march=sandybridge -mf16c -mtune=generic
# C++ Standard Support
QMAKE_CXXFLAGS *= -std=c++20

# Optimization and debugging flags
QMAKE_CXXFLAGS -= -O0
QMAKE_CXXFLAGS -= -O1
QMAKE_CXXFLAGS -= -O2
QMAKE_CXXFLAGS -= -g
contains(debug, 1) {
QMAKE_CXXFLAGS *= -Og -ggdb
} else {
QMAKE_CXXFLAGS_RELEASE *= -O3 -march=haswell -mtune=generic
QMAKE_CXXFLAGS *= -O3
}

# C++ Standard Support
QMAKE_CXXFLAGS_RELEASE *= -std=c++20
contains(nof16c, 1) {
QMAKE_CXXFLAGS *= -march=sandybridge
} else:contains(noavx2, 1) {
QMAKE_CXXFLAGS *= -march=sandybridge -mf16c
} else {
QMAKE_CXXFLAGS *= -march=haswell
}
QMAKE_CXXFLAGS *= -mtune=generic
}

win32 {
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ All installed MSYS2 packages can be updated anytime later by running the command

git clone --recurse-submodules https://github.com/fo76utils/nifskope.git

Finally, run '**qmake**' and then '**make**' to build the source code (the -j 8 option sets the number of processes to run in parallel). The resulting binaries and required DLL files and resources are placed under '**release**'.
Finally, run '**qmake**' and then '**make**' in MSYS2-UCRT64 to build the source code (the -j 8 option sets the number of processes to run in parallel). The resulting binaries and required DLL files and resources are placed under '**release**'.

qmake NifSkope.pro
make -j 8

By default, code is generated for Intel Haswell or compatible CPUs, including the AMD Zen series or newer. Running qmake with the **noavx2=1** option reduces the requirement to Intel Ivy Bridge or AMD FX CPUs, to build for even older hardware, edit the compiler flags in NifSkope.pro.
By default, code is generated for Intel Haswell or compatible CPUs, including the AMD Zen series or newer. Running qmake with the **noavx2=1** option reduces the requirement to Intel Ivy Bridge or AMD FX CPUs, and **nof16c=1** to Sandy Bridge. To build for even older hardware, edit the compiler flags in NifSkope.pro.

Adding the **debug=1** option to the qmake command enables compiling a debug build of NifSkope.

### Issues

Expand Down
6 changes: 4 additions & 2 deletions build/README.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ All installed MSYS2 packages can be updated anytime later by running the command

git clone --recurse-submodules https://github.com/fo76utils/nifskope.git

Finally, run '**qmake**' and then '**make**' to build the source code (the -j 8 option sets the number of processes to run in parallel). The resulting binaries and required DLL files and resources are placed under '**release**'.
Finally, run '**qmake**' and then '**make**' in MSYS2-UCRT64 to build the source code (the -j 8 option sets the number of processes to run in parallel). The resulting binaries and required DLL files and resources are placed under '**release**'.

qmake NifSkope.pro
make -j 8

By default, code is generated for Intel Haswell or compatible CPUs, including the AMD Zen series or newer. Running qmake with the **noavx2=1** option reduces the requirement to Intel Ivy Bridge or AMD FX CPUs, to build for even older hardware, edit the compiler flags in NifSkope.pro.
By default, code is generated for Intel Haswell or compatible CPUs, including the AMD Zen series or newer. Running qmake with the **noavx2=1** option reduces the requirement to Intel Ivy Bridge or AMD FX CPUs, and **nof16c=1** to Sandy Bridge. To build for even older hardware, edit the compiler flags in NifSkope.pro.

Adding the **debug=1** option to the qmake command enables compiling a debug build of NifSkope.

### Issues

Expand Down
2 changes: 1 addition & 1 deletion lib/libfo76utils
2 changes: 1 addition & 1 deletion src/bsamodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***** END LICENCE BLOCK *****/

#include "bsamodel.h"
#include "gamemanager.h"
#include "qtcompat.h"

#include <QByteArray>
#include <QDateTime>
Expand Down
28 changes: 20 additions & 8 deletions src/data/niftypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,17 @@ class Vector4
xyzw[ 2 ] = z;
xyzw[ 3 ] = w;
}
Vector4( const FloatVector4 & v )
{
xyzw[0] = v[0];
xyzw[1] = v[1];
xyzw[2] = v[2];
xyzw[3] = v[3];
}
inline operator FloatVector4() const
{
return FloatVector4( xyzw[0], xyzw[1], xyzw[2], xyzw[3] );
}
//! Constructor from a Vector3 and a float
explicit Vector4( const Vector3 & v3, float w = 0.0 )
{
Expand Down Expand Up @@ -1373,6 +1384,12 @@ class Color4
explicit Color4( const QColor & c ) { fromQColor( c ); }
//! Constructor
Color4( float r, float g, float b, float a ) { setRGBA( r, g, b, a ); }
Color4( const FloatVector4 & c ) { rgba[0] = c[0]; rgba[1] = c[1]; rgba[2] = c[2]; rgba[3] = c[3]; }

inline operator FloatVector4() const
{
return FloatVector4( rgba[0], rgba[1], rgba[2], rgba[3] );
}

//! Array operator
float & operator[]( unsigned int i )
Expand Down Expand Up @@ -1508,18 +1525,13 @@ class ByteColor4 : public Color4
public:
//! Default constructor
ByteColor4() { rgba[0] = rgba[1] = rgba[2] = rgba[3] = 1.0; }
ByteColor4( const std::uint32_t& c )
ByteColor4( const std::uint32_t & c )
: Color4( FloatVector4(c) / 255.0f )
{
FloatVector4 v(c);
v /= 255.0f;
rgba[0] = v[0];
rgba[1] = v[1];
rgba[2] = v[2];
rgba[3] = v[3];
}
inline operator std::uint32_t() const
{
return std::uint32_t( FloatVector4(rgba[0], rgba[1], rgba[2], rgba[3]) * 255.0f );
return std::uint32_t( FloatVector4(*this) * 255.0f );
}
};

Expand Down
8 changes: 8 additions & 0 deletions src/data/nifvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void NifValue::initialize()
typeMap.insert( "Ptr", NifValue::tUpLink );
typeMap.insert( "float", NifValue::tFloat );
typeMap.insert( "SizedString", NifValue::tSizedString );
typeMap.insert( "SizedString16", NifValue::tSizedString16 );
typeMap.insert( "Text", NifValue::tText );
typeMap.insert( "ExportString", NifValue::tShortString );
typeMap.insert( "Color3", NifValue::tColor3 );
Expand Down Expand Up @@ -394,6 +395,7 @@ void NifValue::clear()
break;
case tString:
case tSizedString:
case tSizedString16:
case tText:
case tShortString:
case tHeaderString:
Expand Down Expand Up @@ -463,6 +465,7 @@ void NifValue::changeType( Type t )
return;
case tString:
case tSizedString:
case tSizedString16:
case tText:
case tShortString:
case tHeaderString:
Expand Down Expand Up @@ -531,6 +534,7 @@ void NifValue::operator=( const NifValue & other )
return;
case tString:
case tSizedString:
case tSizedString16:
case tText:
case tShortString:
case tHeaderString:
Expand Down Expand Up @@ -603,6 +607,7 @@ bool NifValue::operator==( const NifValue & other ) const
return val.f32 == other.val.f32;
case tString:
case tSizedString:
case tSizedString16:
case tText:
case tShortString:
case tHeaderString:
Expand Down Expand Up @@ -845,6 +850,7 @@ bool NifValue::setFromString( const QString & s, const BaseModel * model, const
break;
case tString:
case tSizedString:
case tSizedString16:
case tText:
case tShortString:
case tHeaderString:
Expand Down Expand Up @@ -928,6 +934,7 @@ QString NifValue::toString() const
return QString::number( val.f32, 'f', 4 );
case tString:
case tSizedString:
case tSizedString16:
case tText:
case tShortString:
case tHeaderString:
Expand Down Expand Up @@ -1129,6 +1136,7 @@ QString NifValue::getTypeDebugStr( NifValue::Type t )
case tUpLink: typeStr = "UpLink"; break;
case tFloat: typeStr = "Float"; break;
case tSizedString: typeStr = "SizedString"; break;
case tSizedString16: typeStr = "SizedString16"; break;
case tText: typeStr = "Text"; break;
case tShortString: typeStr = "ShortString"; break;
case tHeaderString: typeStr = "HeaderString"; break;
Expand Down
1 change: 1 addition & 0 deletions src/data/nifvalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class NifValue
tFloat,
// all string types should come between tSizedString and tChar8String
tSizedString,
tSizedString16,
tText,
tShortString,
tHeaderString,
Expand Down
Loading

0 comments on commit 1cd6574

Please sign in to comment.