Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 208, fix vertex click, misc. upgrades #209

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
8 changes: 7 additions & 1 deletion NifSkope.pro
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ HEADERS += \
src/ui/widgets/refrbrowser.h \
src/ui/widgets/uvedit.h \
src/ui/widgets/valueedit.h \
src/ui/widgets/vertexpaintwidget.h \
src/ui/widgets/xmlcheck.h \
src/ui/about_dialog.h \
src/ui/checkablemessagebox.h \
Expand Down Expand Up @@ -270,6 +271,7 @@ SOURCES += \
src/ui/widgets/refrbrowser.cpp \
src/ui/widgets/uvedit.cpp \
src/ui/widgets/valueedit.cpp \
src/ui/widgets/vertexpaintwidget.cpp \
src/ui/widgets/xmlcheck.cpp \
src/ui/about_dialog.cpp \
src/ui/checkablemessagebox.cpp \
Expand Down Expand Up @@ -298,7 +300,8 @@ FORMS += \
src/ui/settingsgeneral.ui \
src/ui/settingsrender.ui \
src/ui/settingsresources.ui \
src/ui/widgets/lightingwidget.ui
src/ui/widgets/lightingwidget.ui \
src/ui/widgets/vertexpaintwidget.ui


###############################
Expand Down Expand Up @@ -346,6 +349,9 @@ gli {
}

zlib {
macx {
DEFINES += Z_HAVE_UNISTD_H
}
!*msvc*:QMAKE_CFLAGS += -isystem ../nifskope/lib/zlib
!*msvc*:QMAKE_CXXFLAGS += -isystem ../nifskope/lib/zlib
else:INCLUDEPATH += lib/zlib
Expand Down
Binary file added res/icon/paint-verts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions res/nifskope.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
<file alias="skinned">icon/skinned.png</file>
<file alias="collapse">icon/collapse.png</file>
<file alias="expand">icon/expand.png</file>
<file alias="paintVerts">icon/paint-verts.png</file>
</qresource>
</RCC>
200 changes: 110 additions & 90 deletions src/data/niftypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,11 @@ class Vector3
QString toHtml() const
{
return tr( "X %1 Y %2 Z %3\nlength %4" ).arg(
NumOrMinMax( xyz[0] ),
NumOrMinMax( xyz[1] ),
NumOrMinMax( xyz[2] ),
QString::number( length() )
);
NumOrMinMax( xyz[0] ),
NumOrMinMax( xyz[1] ),
NumOrMinMax( xyz[2] ),
QString::number( length() )
);
}

protected:
Expand Down Expand Up @@ -687,12 +687,12 @@ class Vector4
QString toHtml() const
{
return tr( "X %1 Y %2 Z %3 W %4\nlength %5" ).arg(
NumOrMinMax( xyzw[0] ),
NumOrMinMax( xyzw[1] ),
NumOrMinMax( xyzw[2] ),
NumOrMinMax( xyzw[3] ),
QString::number( length() )
);
NumOrMinMax( xyzw[0] ),
NumOrMinMax( xyzw[1] ),
NumOrMinMax( xyzw[2] ),
NumOrMinMax( xyzw[3] ),
QString::number( length() )
);
}

protected:
Expand Down Expand Up @@ -748,10 +748,10 @@ class Quat
void normalize ()
{
float mag = (
(wxyz[0] * wxyz[0])
+ (wxyz[1] * wxyz[1])
+ (wxyz[2] * wxyz[2])
+ (wxyz[3] * wxyz[3])
(wxyz[0] * wxyz[0])
+ (wxyz[1] * wxyz[1])
+ (wxyz[2] * wxyz[2])
+ (wxyz[3] * wxyz[3])
);
wxyz[0] /= mag;
wxyz[1] /= mag;
Expand Down Expand Up @@ -833,11 +833,11 @@ class Quat
QString toHtml() const
{
return tr( "W %1\nX %2\nY %3\nZ %4" ).arg(
NumOrMinMax( wxyz[0] ),
NumOrMinMax( wxyz[1] ),
NumOrMinMax( wxyz[2] ),
NumOrMinMax( wxyz[3] )
);
NumOrMinMax( wxyz[0] ),
NumOrMinMax( wxyz[1] ),
NumOrMinMax( wxyz[2] ),
NumOrMinMax( wxyz[3] )
);
}

protected:
Expand Down Expand Up @@ -874,8 +874,8 @@ class Matrix
for ( int r = 0; r < 3; r++ ) {
for ( int c = 0; c < 3; c++ ) {
m3.m[r][c] = m[r][0] * m2.m[0][c]
+ m[r][1] * m2.m[1][c]
+ m[r][2] * m2.m[2][c];
+ m[r][1] * m2.m[1][c]
+ m[r][2] * m2.m[2][c];
}
}

Expand Down Expand Up @@ -968,9 +968,9 @@ class Matrix4
for ( int r = 0; r < 4; r++ ) {
for ( int c = 0; c < 4; c++ ) {
m3.m[r][c] = m[r][0] * m2.m[0][c]
+ m[r][1] * m2.m[1][c]
+ m[r][2] * m2.m[2][c]
+ m[r][3] * m2.m[3][c];
+ m[r][1] * m2.m[1][c]
+ m[r][2] * m2.m[2][c]
+ m[r][3] * m2.m[3][c];
}
}

Expand Down Expand Up @@ -1352,6 +1352,16 @@ class Color4
return c;
}

Color4 operator*( const Color4& o ) const
{
Color4 c( *this );
c.rgba[0] *= o.rgba[0];
c.rgba[1] *= o.rgba[1];
c.rgba[2] *= o.rgba[2];
c.rgba[3] *= o.rgba[3];
return c;
}

//! Add-equals operator
Color4 & operator+=( const Color4 & o )
{
Expand Down Expand Up @@ -1452,6 +1462,7 @@ class Color4

friend class NifIStream;
friend class NifOStream;
friend class ByteColor4;

friend QDataStream & operator>>( QDataStream & ds, Color4 & c );
};
Expand All @@ -1461,6 +1472,15 @@ class ByteColor4 : public Color4
public:
//! Default constructor
ByteColor4() { rgba[0] = rgba[1] = rgba[2] = rgba[3] = 1.0; }
static ByteColor4 fromColor4(const Color4& c)
{
ByteColor4 o;
o.rgba[0] = c.rgba[0];
o.rgba[1] = c.rgba[1];
o.rgba[2] = c.rgba[2];
o.rgba[3] = c.rgba[3];
return o;
}
};


Expand Down Expand Up @@ -1936,71 +1956,71 @@ struct DataStreamMetadata
};

typedef enum {
F_UNKNOWN = 0x00000000,
F_INT8_1 = 0x00010101,
F_INT8_2 = 0x00020102,
F_INT8_3 = 0x00030103,
F_INT8_4 = 0x00040104,
F_UINT8_1 = 0x00010105,
F_UINT8_2 = 0x00020106,
F_UINT8_3 = 0x00030107,
F_UINT8_4 = 0x00040108,
F_NORMINT8_1 = 0x00010109,
F_NORMINT8_2 = 0x0002010A,
F_NORMINT8_3 = 0x0003010B,
F_NORMINT8_4 = 0x0004010C,
F_NORMUINT8_1 = 0x0001010D,
F_NORMUINT8_2 = 0x0002010E,
F_NORMUINT8_3 = 0x0003010F,
F_NORMUINT8_4 = 0x00040110,
F_INT16_1 = 0x00010211,
F_INT16_2 = 0x00020212,
F_INT16_3 = 0x00030213,
F_INT16_4 = 0x00040214,
F_UINT16_1 = 0x00010215,
F_UINT16_2 = 0x00020216,
F_UINT16_3 = 0x00030217,
F_UINT16_4 = 0x00040218,
F_NORMINT16_1 = 0x00010219,
F_NORMINT16_2 = 0x0002021A,
F_NORMINT16_3 = 0x0003021B,
F_NORMINT16_4 = 0x0004021C,
F_NORMUINT16_1 = 0x0001021D,
F_NORMUINT16_2 = 0x0002021E,
F_NORMUINT16_3 = 0x0003021F,
F_NORMUINT16_4 = 0x00040220,
F_INT32_1 = 0x00010421,
F_INT32_2 = 0x00020422,
F_INT32_3 = 0x00030423,
F_INT32_4 = 0x00040424,
F_UINT32_1 = 0x00010425,
F_UINT32_2 = 0x00020426,
F_UINT32_3 = 0x00030427,
F_UINT32_4 = 0x00040428,
F_NORMINT32_1 = 0x00010429,
F_NORMINT32_2 = 0x0002042A,
F_NORMINT32_3 = 0x0003042B,
F_NORMINT32_4 = 0x0004042C,
F_NORMUINT32_1 = 0x0001042D,
F_NORMUINT32_2 = 0x0002042E,
F_NORMUINT32_3 = 0x0003042F,
F_NORMUINT32_4 = 0x00040430,
F_FLOAT16_1 = 0x00010231,
F_FLOAT16_2 = 0x00020232,
F_FLOAT16_3 = 0x00030233,
F_FLOAT16_4 = 0x00040234,
F_FLOAT32_1 = 0x00010435,
F_FLOAT32_2 = 0x00020436,
F_FLOAT32_3 = 0x00030437,
F_FLOAT32_4 = 0x00040438,
F_UINT_10_10_10_L1 = 0x00010439,
F_NORMINT_10_10_10_L1 = 0x0001043A,
F_NORMINT_11_11_10 = 0x0001043B,
F_NORMUINT8_4_BGRA = 0x0004013C,
F_NORMINT_10_10_10_2 = 0x0001043D,
F_UINT_10_10_10_2 = 0x0001043E,
F_TYPE_COUNT = 63,
F_MAX_COMP_SIZE = 16
F_UNKNOWN = 0x00000000,
F_INT8_1 = 0x00010101,
F_INT8_2 = 0x00020102,
F_INT8_3 = 0x00030103,
F_INT8_4 = 0x00040104,
F_UINT8_1 = 0x00010105,
F_UINT8_2 = 0x00020106,
F_UINT8_3 = 0x00030107,
F_UINT8_4 = 0x00040108,
F_NORMINT8_1 = 0x00010109,
F_NORMINT8_2 = 0x0002010A,
F_NORMINT8_3 = 0x0003010B,
F_NORMINT8_4 = 0x0004010C,
F_NORMUINT8_1 = 0x0001010D,
F_NORMUINT8_2 = 0x0002010E,
F_NORMUINT8_3 = 0x0003010F,
F_NORMUINT8_4 = 0x00040110,
F_INT16_1 = 0x00010211,
F_INT16_2 = 0x00020212,
F_INT16_3 = 0x00030213,
F_INT16_4 = 0x00040214,
F_UINT16_1 = 0x00010215,
F_UINT16_2 = 0x00020216,
F_UINT16_3 = 0x00030217,
F_UINT16_4 = 0x00040218,
F_NORMINT16_1 = 0x00010219,
F_NORMINT16_2 = 0x0002021A,
F_NORMINT16_3 = 0x0003021B,
F_NORMINT16_4 = 0x0004021C,
F_NORMUINT16_1 = 0x0001021D,
F_NORMUINT16_2 = 0x0002021E,
F_NORMUINT16_3 = 0x0003021F,
F_NORMUINT16_4 = 0x00040220,
F_INT32_1 = 0x00010421,
F_INT32_2 = 0x00020422,
F_INT32_3 = 0x00030423,
F_INT32_4 = 0x00040424,
F_UINT32_1 = 0x00010425,
F_UINT32_2 = 0x00020426,
F_UINT32_3 = 0x00030427,
F_UINT32_4 = 0x00040428,
F_NORMINT32_1 = 0x00010429,
F_NORMINT32_2 = 0x0002042A,
F_NORMINT32_3 = 0x0003042B,
F_NORMINT32_4 = 0x0004042C,
F_NORMUINT32_1 = 0x0001042D,
F_NORMUINT32_2 = 0x0002042E,
F_NORMUINT32_3 = 0x0003042F,
F_NORMUINT32_4 = 0x00040430,
F_FLOAT16_1 = 0x00010231,
F_FLOAT16_2 = 0x00020232,
F_FLOAT16_3 = 0x00030233,
F_FLOAT16_4 = 0x00040234,
F_FLOAT32_1 = 0x00010435,
F_FLOAT32_2 = 0x00020436,
F_FLOAT32_3 = 0x00030437,
F_FLOAT32_4 = 0x00040438,
F_UINT_10_10_10_L1 = 0x00010439,
F_NORMINT_10_10_10_L1 = 0x0001043A,
F_NORMINT_11_11_10 = 0x0001043B,
F_NORMUINT8_4_BGRA = 0x0004013C,
F_NORMINT_10_10_10_2 = 0x0001043D,
F_UINT_10_10_10_2 = 0x0001043E,
F_TYPE_COUNT = 63,
F_MAX_COMP_SIZE = 16
} DataStreamFormat;

typedef enum
Expand Down
Loading