mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 20:33:40 +01:00
chore: throw in LoadImage/Raw if scene isn't ready
This commit is contained in:
parent
a43d9665d0
commit
cccf69c001
1 changed files with 9 additions and 0 deletions
|
|
@ -284,6 +284,9 @@ namespace Dalamud.Interface.Internal
|
|||
/// <returns>A texture, ready to use in ImGui.</returns>
|
||||
public TextureWrap? LoadImage(string filePath)
|
||||
{
|
||||
if (this.scene == null)
|
||||
throw new InvalidOperationException("Scene isn't ready.");
|
||||
|
||||
try
|
||||
{
|
||||
return this.scene?.LoadImage(filePath) ?? null;
|
||||
|
|
@ -303,6 +306,9 @@ namespace Dalamud.Interface.Internal
|
|||
/// <returns>A texture, ready to use in ImGui.</returns>
|
||||
public TextureWrap? LoadImage(byte[] imageData)
|
||||
{
|
||||
if (this.scene == null)
|
||||
throw new InvalidOperationException("Scene isn't ready.");
|
||||
|
||||
try
|
||||
{
|
||||
return this.scene?.LoadImage(imageData) ?? null;
|
||||
|
|
@ -325,6 +331,9 @@ namespace Dalamud.Interface.Internal
|
|||
/// <returns>A texture, ready to use in ImGui.</returns>
|
||||
public TextureWrap? LoadImageRaw(byte[] imageData, int width, int height, int numChannels)
|
||||
{
|
||||
if (this.scene == null)
|
||||
throw new InvalidOperationException("Scene isn't ready.");
|
||||
|
||||
try
|
||||
{
|
||||
return this.scene?.LoadImageRaw(imageData, width, height, numChannels) ?? null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue