1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 03:40:14 +00:00

Merge commit '5ee4ce1232b0f334f29dd702f811c58dccf5c00d' into apple-silicon-arm-build

This commit is contained in:
Andrew Dunn 2022-08-17 23:45:51 +10:00
commit 808a2e587a
27 changed files with 73 additions and 34 deletions

View File

@ -652,7 +652,7 @@ Windows_MSBuild_RelWithDebInfo:
script:
- scripts/find_missing_merge_requests.py --project_id=$CI_PROJECT_ID --ignored_mrs_path=$CI_PROJECT_DIR/.resubmitted_merge_requests.txt
flatpak:
.flatpak:
image: 'docker.io/bilelmoussaoui/flatpak-github-actions'
stage: build
script:
@ -670,4 +670,4 @@ flatpak:
- "openmw.flatpak"
# When CCache doesn't exist (e.g. first build on a fork), build takes more than 1h, which is the default for forks.
# Flatpak Builds compile all dependencies aswell so need more time. Build results of libraries are cached
timeout: 4h
timeout: 4h

View File

@ -5,6 +5,7 @@
Bug #5057: Weapon swing sound plays at same pitch whether it hits or misses
Bug #5129: Stuttering animation on Centurion Archer
Bug #5977: Fatigueless NPCs' corpse underwater changes animation on game load
Feature #6945: Support S3TC-compressed and BGR/BGRA NiPixelData
0.48.0
------

View File

@ -4,6 +4,7 @@
#include "importscri.hpp"
#include <components/esm3/loadscpt.hpp>
#include <components/esm/esmcommon.hpp>
namespace ESM
{

View File

@ -48,6 +48,7 @@
#include <components/vfs/manager.hpp>
#include <components/widgets/tags.hpp>
#include <components/widgets/widgets.hpp>
#include <components/misc/resourcehelpers.hpp>
#include <components/misc/frameratelimiter.hpp>

View File

@ -1,5 +1,7 @@
#include "recastmesh.hpp"
#include <algorithm>
#include <components/sceneutil/recastmesh.hpp>
#include <components/resource/resourcesystem.hpp>
#include <components/resource/scenemanager.hpp>
@ -12,6 +14,7 @@
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
namespace MWRender
{
RecastMesh::RecastMesh(const osg::ref_ptr<osg::Group>& root, bool enabled)

View File

@ -3,6 +3,7 @@
#include <LinearMath/btTransform.h>
#include <BulletCollision/CollisionShapes/btCollisionShape.h>
#include <BulletCollision/Gimpact/btBoxCollision.h>
inline bool operator==(const btAABB& lhs, const btAABB& rhs)
{

View File

@ -4,7 +4,6 @@
#include "parser.hpp"
#include "scriptparser.hpp"
#include "locals.hpp"
#include "literals.hpp"
namespace Compiler
{

View File

@ -3,7 +3,6 @@
#include "cellref.hpp"
#include "components/esm/defs.hpp"
#include "effectlist.hpp"
#include <string>
#include <vector>

View File

@ -3,7 +3,7 @@
#include <string>
#include <vector>
#include <stdint.h>
#include <cstdint>
namespace ESM
{

View File

@ -4,7 +4,6 @@
#include <string>
#include <vector>
#include "components/esm/esmcommon.hpp"
#include "components/esm/defs.hpp"
namespace ESM

View File

@ -5,7 +5,6 @@
#include <vector>
#include "components/esm/defs.hpp"
#include "components/esm/esmcommon.hpp"
namespace ESM
{

View File

@ -5,7 +5,6 @@
#include <vector>
#include "components/esm/defs.hpp"
#include "components/esm/esmcommon.hpp"
namespace ESM
{

View File

@ -18,8 +18,6 @@
#include <components/misc/strings/format.hpp>
#include <components/debug/debuglog.hpp>
#include "pass.hpp"
namespace fx
{
namespace Types

View File

@ -11,7 +11,6 @@
#include <components/misc/strings/format.hpp>
#include "technique.hpp"
#include "types.hpp"
namespace Gui

View File

@ -3,6 +3,7 @@
#include <sol/sol.hpp>
#include <MyGUI_Types.h>
#include <MyGUI_Colour.h>
#include <osg/Vec2>
#include <components/lua/luastate.hpp>

View File

@ -1,6 +1,8 @@
#ifndef OPENMW_COMPONENTS_MISC_BUDGETMEASUREMENT_H
#define OPENMW_COMPONENTS_MISC_BUDGETMEASUREMENT_H
#include <array>
#include <cstddef>
namespace Misc
{

View File

@ -24,10 +24,9 @@
#ifndef OPENMW_COMPONENTS_NIF_DATA_HPP
#define OPENMW_COMPONENTS_NIF_DATA_HPP
#include "base.hpp"
#include "nifkey.hpp"
#include "niftypes.hpp" // Transformation
#include "recordptr.hpp"
namespace Nif
{
@ -115,10 +114,11 @@ struct NiPixelData : public Record
NIPXFMT_RGBA8,
NIPXFMT_PAL8,
NIPXFMT_PALA8,
NIPXFMT_BGR8,
NIPXFMT_BGRA8,
NIPXFMT_DXT1,
NIPXFMT_DXT3,
NIPXFMT_DXT5,
NIPXFMT_DXT5_ALT
NIPXFMT_DXT5
};
Format fmt{NIPXFMT_RGB8};

View File

@ -1,13 +1,24 @@
#ifndef OPENMW_COMPONENTS_NIF_PHYSICS_HPP
#define OPENMW_COMPONENTS_NIF_PHYSICS_HPP
#include "base.hpp"
#include "record.hpp"
#include "recordptr.hpp"
#include <osg/Vec3f>
#include <osg/Vec4f>
#include <osg/Quat>
#include <cstdint>
#include <vector>
// This header contains certain record definitions
// specific to Bethesda implementation of Havok physics
namespace Nif
{
class NIFStream;
class NIFFile;
/// Non-record data types
struct bhkWorldObjCInfoProperty

View File

@ -1480,17 +1480,39 @@ namespace NifOsg
{
osg::ref_ptr<osg::Image> image (new osg::Image);
// Pixel row alignment, defining it to be consistent with OSG DDS plugin
int packing = 1;
GLenum pixelformat = 0;
switch (pixelData->fmt)
{
case Nif::NiPixelData::NIPXFMT_RGB8:
case Nif::NiPixelData::NIPXFMT_PAL8:
pixelformat = GL_RGB;
break;
case Nif::NiPixelData::NIPXFMT_RGBA8:
case Nif::NiPixelData::NIPXFMT_PALA8:
pixelformat = GL_RGBA;
break;
case Nif::NiPixelData::NIPXFMT_PAL8:
case Nif::NiPixelData::NIPXFMT_PALA8:
pixelformat = GL_RED; // Each color is defined by a byte.
break;
case Nif::NiPixelData::NIPXFMT_BGR8:
pixelformat = GL_BGR;
break;
case Nif::NiPixelData::NIPXFMT_BGRA8:
pixelformat = GL_BGRA;
break;
case Nif::NiPixelData::NIPXFMT_DXT1:
pixelformat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
packing = 2;
break;
case Nif::NiPixelData::NIPXFMT_DXT3:
pixelformat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
packing = 4;
break;
case Nif::NiPixelData::NIPXFMT_DXT5:
pixelformat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
packing = 4;
break;
default:
Log(Debug::Info) << "Unhandled internal pixel format " << pixelData->fmt << " in " << mFilename;
return nullptr;
@ -1507,7 +1529,7 @@ namespace NifOsg
{
const Nif::NiPixelData::Mipmap& mip = pixelData->mipmaps[i];
size_t mipSize = mip.height * mip.width * pixelData->bpp / 8;
size_t mipSize = osg::Image::computeImageSizeInBytes(mip.width, mip.height, 1, pixelformat, GL_UNSIGNED_BYTE, packing);
if (mipSize + mip.dataOffset > pixelData->data.size())
{
Log(Debug::Info) << "Internal texture's mipmap data out of bounds, ignoring texture";
@ -1534,10 +1556,15 @@ namespace NifOsg
{
case Nif::NiPixelData::NIPXFMT_RGB8:
case Nif::NiPixelData::NIPXFMT_RGBA8:
case Nif::NiPixelData::NIPXFMT_BGR8:
case Nif::NiPixelData::NIPXFMT_BGRA8:
case Nif::NiPixelData::NIPXFMT_DXT1:
case Nif::NiPixelData::NIPXFMT_DXT3:
case Nif::NiPixelData::NIPXFMT_DXT5:
{
unsigned char* data = new unsigned char[pixels.size()];
memcpy(data, pixels.data(), pixels.size());
image->setImage(width, height, 1, pixelformat, pixelformat, GL_UNSIGNED_BYTE, data, osg::Image::USE_NEW_DELETE);
image->setImage(width, height, 1, pixelformat, pixelformat, GL_UNSIGNED_BYTE, data, osg::Image::USE_NEW_DELETE, packing);
break;
}
case Nif::NiPixelData::NIPXFMT_PAL8:
@ -1548,6 +1575,7 @@ namespace NifOsg
Log(Debug::Info) << "Palettized texture in " << mFilename << " is invalid, ignoring";
return nullptr;
}
pixelformat = pixelData->fmt == Nif::NiPixelData::NIPXFMT_PAL8 ? GL_RGB : GL_RGBA;
// We're going to convert the indices that pixel data contains
// into real colors using the palette.
const auto& palette = pixelData->palette->colors;
@ -1559,7 +1587,9 @@ namespace NifOsg
memcpy(pixel, &palette[index], sizeof(unsigned char) * numChannels);
pixel += numChannels;
}
image->setImage(width, height, 1, pixelformat, pixelformat, GL_UNSIGNED_BYTE, data, osg::Image::USE_NEW_DELETE);
for (unsigned int& offset : mipmapVector)
offset *= numChannels;
image->setImage(width, height, 1, pixelformat, pixelformat, GL_UNSIGNED_BYTE, data, osg::Image::USE_NEW_DELETE, packing);
break;
}
default:

View File

@ -8,8 +8,6 @@
#include <osg/ref_ptr>
#include <osg/Referenced>
#include "controller.hpp"
namespace osg
{
class Node;

View File

@ -21,6 +21,8 @@
#include <components/debug/debuglog.hpp>
#include <components/nifosg/nifloader.hpp>
#include <components/nifosg/controller.hpp>
#include <components/nif/niffile.hpp>
#include <components/misc/pathhelpers.hpp>

View File

@ -6,9 +6,9 @@
#include <osg/ref_ptr>
#include <osgAnimation/UpdateMatrixTransform>
#include <components/sceneutil/controller.hpp>
#include <components/sceneutil/nodecallback.hpp>
#include <components/sceneutil/keyframe.hpp>
#include "nodecallback.hpp"
#include "keyframe.hpp"
#include <components/resource/animation.hpp>
namespace SceneUtil

View File

@ -10,9 +10,10 @@
#include <memory>
#include <array>
#include <components/stereo/types.hpp>
#include <components/shader/shadermanager.hpp>
#include "types.hpp"
namespace osg
{
class FrameBufferObject;

View File

@ -3,8 +3,6 @@
#include <osg/StateSet>
#include "defs.hpp"
namespace osg
{
class Texture2D;

View File

@ -1,9 +1,7 @@
#ifndef COMPONENTS_TERRAIN_VIEW_H
#define COMPONENTS_TERRAIN_VIEW_H
#include <osg/ref_ptr>
#include <osg/Referenced>
#include <osg/Vec3f>
namespace Terrain
{

View File

@ -10,7 +10,6 @@
#include <components/sceneutil/nodecallback.hpp>
#include "defs.hpp"
#include "cellborder.hpp"
namespace osg

View File

@ -1,10 +1,10 @@
#ifndef OPENMW_WIDGETS_WRAPPER_H
#define OPENMW_WIDGETS_WRAPPER_H
#include "widgets.hpp"
#include <components/settings/settings.hpp>
#include <algorithm>
namespace Gui
{
template<class T>