Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion DarkEdif/DarkEdif Template/DarkExt.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
{
"Type": "FolderEnd"
},
{
"Title": "Props outside folder",
"Info": "This blue header is called a group inside the DarkExt.json file.",
"Type": "Group"
},
{
"Title": "Static text 1",
"Info": "Blank text",
Expand Down Expand Up @@ -139,7 +144,7 @@
"About": {
"Name": "Exemple objet",
"Author": "Votre Nom",
"Copyright": "Copyright \u00A9 2022 par Votre Nom",
"Copyright": "Copyright \u00A9 2026 par Votre Nom",
"Comment": "Une ou deux phrases pour décrire votre poste",
"Help": "Help/Example.chm",
"URL": "http://www.example.com/"
Expand Down Expand Up @@ -209,6 +214,11 @@
{
"Type": "FolderEnd"
},
{
"Title": "Groupe",
"Info": "Voir le fichier DarkExt.json.",
"Type": "Group"
},
{
"Title": "Texte statique 1",
"Info": "Texte vide",
Expand Down
7 changes: 7 additions & 0 deletions DarkEdif/DarkEdif Template/Edittime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ int FusionAPI MakeIconEx(mv * mV, cSurface * pIconSf, TCHAR * lpName, ObjInfo *
{
#pragma DllExportHint
pIconSf->Delete();
#ifdef MULTIPLEICONS
pIconSf->Clone(*Edif::SDK->Image);
#else
pIconSf->Clone(*Edif::SDK->Icon);
#endif

pIconSf->SetTransparentColor(RGB(255, 0, 255));
return 0;
Expand Down Expand Up @@ -153,6 +157,8 @@ BOOL FusionAPI EditObject(mv *mV, ObjInfo * oiPtr, LevelObject * loPtr, EDITDATA
// PROPERTIES
// ============================================================================

#ifndef NOPROPS

// Inserts properties into the properties of the object.
BOOL FusionAPI GetProperties(mv * mV, EDITDATA * edPtr, BOOL bMasterItem)
{
Expand Down Expand Up @@ -227,6 +233,7 @@ void FusionAPI ReleasePropCreateParam(mv *mV, EDITDATA *edPtr, unsigned int Prop
#pragma DllExportHint
return DarkEdif::DLL::DLL_ReleasePropCreateParam(mV, edPtr, PropID, lParam);
}
#endif

// ============================================================================
// ROUTINES USED WHEN BUILDING
Expand Down
3 changes: 3 additions & 0 deletions DarkEdif/DarkEdif Template/Ext.rc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ END

#if EditorBuild
IDR_EDIF_ICON Edif "Icon.png"
#ifdef MULTIPLEICONS
IDR_EDIF_IMAGE Edif "Image.png"
#endif
#if !defined(DARKEXT_JSON_FILE_EXTERNAL)
IDR_EDIF_JSON Edif "DarkExt.json"
#endif
Expand Down
Binary file added DarkEdif/DarkEdif Template/Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions DarkEdif/DarkEdif Template/Resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Microsoft Developer Studio generated include file.
// Used by Ext.rc
//
#ifdef MULTIPLEICONS
#define IDR_EDIF_IMAGE 100
#endif
#define IDR_EDIF_ICON 101
#define IDR_EDIF_JSON 102

Expand Down
4 changes: 4 additions & 0 deletions DarkEdif/Inc/Shared/Edif.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ namespace Edif
#if EditorBuild
cSurface * Icon = nullptr;
DarkEdif::Surface * ExtIcon = nullptr;
#ifdef MULTIPLEICONS
cSurface * Image = nullptr;
DarkEdif::Surface * ExtImage = nullptr;
#endif
std::unique_ptr<PropData[]> EdittimeProperties;

#ifndef NOPROPS
Expand Down
1 change: 1 addition & 0 deletions DarkEdif/Lib/Shared/DarkEdif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "Extension.hpp"
#include <atomic>
#include <math.h>
#include <cctype>

#ifdef _WIN32
extern HINSTANCE hInstLib;
Expand Down
47 changes: 47 additions & 0 deletions DarkEdif/Lib/Shared/Edif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,53 @@ Edif::SDKClass::SDKClass(mv * mV, json_value &_json) : json (_json)
DarkEdif::MsgBox::Error(_T("DarkEdif error"), _T("Blitting to ext icon surface failed. Last error: %i."), tempIcon->GetLastError());
}
ExtIcon = new DarkEdif::Surface(nullptr, Icon);

#ifdef MULTIPLEICONS
Image = new cSurface();
char * ImageData;
size_t ImageSize;

int resultTwo = Edif::GetDependency (ImageData, ImageSize, _T("png"), IDR_EDIF_IMAGE);
if (resultTwo != Edif::DependencyNotFound)
{
CInputMemFile * File = CInputMemFile::NewInstance();
File->Create((LPBYTE)ImageData, ImageSize);

const std::unique_ptr<cSurface> tempImage = std::make_unique<cSurface>();
const bool loadedOK = ImportImageFromInputFile(mV->ImgFilterMgr, File, tempImage.get(), NULL, 0);
if (!loadedOK)
{
// Read PNG bit depth: Skip 8 byte PNG header, IHDR 4 byte chunk length/type, img width/height,
// and then get bit depth byte.
// 4 bit or less bit depth is not loadable by Fusion's PNG filter.
const std::uint8_t bitDepth = File->GetMemBuffer()[8 + 4 + 4 + 4 + 4];

if (bitDepth <= 4)
DarkEdif::MsgBox::Error(_T("Failed to load ext image"), _T("" PROJECT_NAME "'s Image.png uses a bit depth of %hhu, which is too small."), bitDepth);
else
DarkEdif::MsgBox::Error(_T("Failed to load ext image"), _T("" PROJECT_NAME "'s Image.png failed to load."));
}

File->Delete();

if (!tempImage->HasAlpha())
tempImage->SetTransparentColor(RGB(255, 0, 255));

if (resultTwo != Edif::DependencyWasResource)
free(ImageData);

Image->Create(tempImage->GetWidth(), tempImage->GetHeight(), proto);

if (!tempImage->HasAlpha())
Image->SetTransparentColor(RGB(255, 0, 255));
else
Image->CreateAlpha();

if (loadedOK && tempImage->Blit(*Image) == FALSE)
DarkEdif::MsgBox::Error(_T("DarkEdif error"), _T("Blitting to ext image surface failed. Last error: %i."), tempImage->GetLastError());
}
ExtImage = new DarkEdif::Surface(nullptr, Image);
#endif
}

#if USE_DARKEDIF_UPDATE_CHECKER
Expand Down
214 changes: 0 additions & 214 deletions MMF2SDK/VOLINFO/Ext.rc

This file was deleted.

Loading