forked from Ryan-rsm-McKenzie/CommonLibSSE
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
449 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSFixedString.h" | ||
#include "RE/N/NiTexture.h" | ||
|
||
namespace RE | ||
{ | ||
class BSScaleformExternalTexture | ||
{ | ||
public: | ||
BSScaleformExternalTexture() : | ||
gamebryoTexture{ nullptr }, | ||
renderTarget(0), | ||
pad0C(0) | ||
{} | ||
|
||
~BSScaleformExternalTexture() | ||
{ | ||
ReleaseTexture(); | ||
} | ||
|
||
BSScaleformExternalTexture(const BSScaleformExternalTexture&) = delete; | ||
BSScaleformExternalTexture(BSScaleformExternalTexture&&) = delete; | ||
BSScaleformExternalTexture& operator=(const BSScaleformExternalTexture&) = delete; | ||
BSScaleformExternalTexture& operator=(BSScaleformExternalTexture&&) = delete; | ||
|
||
bool LoadPNG(const BSFixedString& a_path) | ||
{ | ||
using func_t = decltype(&BSScaleformExternalTexture::LoadPNG); | ||
REL::Relocation<func_t> func{ RELOCATION_ID(80298, 82321) }; | ||
return func(this, a_path); | ||
} | ||
|
||
void ReleaseTexture() | ||
{ | ||
using func_t = decltype(&BSScaleformExternalTexture::ReleaseTexture); | ||
REL::Relocation<func_t> func{ RELOCATION_ID(80294, 82317) }; | ||
return func(this); | ||
} | ||
|
||
bool SetTexture(NiTexture* a_texture) | ||
{ | ||
using func_t = decltype(&BSScaleformExternalTexture::SetTexture); | ||
REL::Relocation<func_t> func{ RELOCATION_ID(80295, 82318) }; | ||
return func(this, a_texture); | ||
} | ||
|
||
// members | ||
NiPointer<NiTexture> gamebryoTexture; // 00 | ||
std::uint32_t renderTarget; // 08 | ||
std::uint32_t pad0C; // 0C | ||
BSFixedString filePath; // 10 | ||
}; | ||
static_assert(sizeof(BSScaleformExternalTexture) == 0x18); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSTHashMap.h" | ||
#include "RE/G/GFxImageLoader.h" | ||
#include "RE/G/GPtr.h" | ||
|
||
namespace RE | ||
{ | ||
class BSScaleformExternalTexture; | ||
class GTexture; | ||
class NiTexture; | ||
|
||
class BSScaleformImageLoader : public GFxImageLoader | ||
{ | ||
public: | ||
inline static constexpr auto RTTI = RTTI_BSScaleformImageLoader; | ||
|
||
class TextureEntry | ||
{ | ||
public: | ||
GPtr<GTexture> texture; // 00 | ||
NiTexture* sourceTexture; // 08 | ||
std::uint32_t refCount; // 10 | ||
std::uint32_t pad14; // 14 | ||
}; | ||
static_assert(sizeof(TextureEntry) == 0x18); | ||
|
||
virtual ~BSScaleformImageLoader(); // 00 | ||
|
||
// override (GFxImageLoader) | ||
GImageInfoBase* LoadImage(const char* a_url) override; // 01 | ||
|
||
bool AddTexture(BSScaleformExternalTexture& a_texture) | ||
{ | ||
using func_t = decltype(&BSScaleformImageLoader::AddTexture); | ||
REL::Relocation<func_t> func{ RELOCATION_ID(82382, 84469) }; | ||
return func(this, a_texture); | ||
} | ||
|
||
void RemoveTexture(BSScaleformExternalTexture& a_texture) | ||
{ | ||
using func_t = decltype(&BSScaleformImageLoader::RemoveTexture); | ||
REL::Relocation<func_t> func{ RELOCATION_ID(82383, 84470) }; | ||
return func(this, a_texture); | ||
} | ||
|
||
// members | ||
BSTHashMap<std::uint32_t, TextureEntry> textures; // 18 | ||
}; | ||
static_assert(sizeof(BSScaleformImageLoader) == 0x48); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#include "RE/G/GFxState.h" | ||
|
||
namespace RE | ||
{ | ||
class GImageInfoBase; | ||
|
||
class GFxImageLoader : public GFxState | ||
{ | ||
public: | ||
inline static constexpr auto RTTI = RTTI_GFxImageLoader; | ||
|
||
virtual ~GFxImageLoader(); // 00 | ||
|
||
// add | ||
virtual GImageInfoBase* LoadImage(const char* a_url) = 0; // 01 | ||
}; | ||
static_assert(sizeof(GFxImageLoader) == 0x18); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include "RE/G/GFxResource.h" | ||
#include "RE/G/GFxResourceKey.h" | ||
#include "RE/G/GPtr.h" | ||
|
||
namespace RE | ||
{ | ||
class GImageInfoBase; | ||
|
||
class GFxImageResource : public GFxResource | ||
{ | ||
public: | ||
~GFxImageResource() override; // 00 | ||
|
||
GImageInfoBase* GetImageInfo() const | ||
{ | ||
return _imageInfo.get(); | ||
} | ||
|
||
protected: | ||
// members | ||
GPtr<GImageInfoBase> _imageInfo; // 18 | ||
GFxResourceKey _key; // 20 | ||
ResourceUse _useType; // 30 | ||
}; | ||
static_assert(sizeof(GFxImageResource) == 0x38); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include "RE/G/GImageInfoBaseImpl.h" | ||
|
||
namespace RE | ||
{ | ||
class GImageInfo : public GImageInfoBaseImpl | ||
{ | ||
public: | ||
~GImageInfo() override; // 00 | ||
|
||
// override (GImageInfoImpl) | ||
std::uint32_t GetWidth() const override; // 01 | ||
std::uint32_t GetHeight() const override; // 02 | ||
GTexture* GetTexture(GRenderer* a_renderer) override; // 03 | ||
std::uint32_t GetImageInfoType() const override; // 06 | ||
|
||
// override (GTexture::ChangeHandler) | ||
void OnChange(GRenderer* a_renderer, EventType a_changeType) override; // 01 | ||
bool Recreate(GRenderer* a_renderer) override; // 02 | ||
|
||
// members | ||
GPtr<GImage> image; // 28 | ||
std::uint32_t targetWidth; // 30 | ||
std::uint32_t targetHeight; // 34 | ||
bool releaseImage; // 38 | ||
std::uint8_t pad39; // 39 | ||
std::uint16_t pad3A; // 3A | ||
std::uint32_t pad3C; // 3C | ||
}; | ||
static_assert(sizeof(GImageInfo) == 0x40); | ||
} |
Oops, something went wrong.