The plug-ins use the DLL interface.
When the texture editor starts up, it searches the DLLs in the PlugIns directory of the application's directory, checks the name, version and type of each plug-in, and automatically links them.
The name and version information is obtained from the VS_VERSION_INFO of the DLL resource, so be sure to include the version resource in the DLL.
Please prepare a Japanese-language resource (041104b0) and an English-language resource (040904e4) of VS_VERSION_INFO.
Comment is used for detailed information,
CompanyName for the company name,
FileVersion for the plug-in version, and
InternalName for the menu name.
On the DLL side, first int TEPI_getType() is called, and the plug-in type is returned.
Next, BOOL TEPI_isAvail(DWORD version) is called, and the application's 4-byte version is passed as the parameter (0x0100000f in the case of 1.0.0.15). If supported in the application, return TRUE. If not supported, return FALSE.
If the type is Import (the TEPIT_IMPORT flag is up) then a name should be registered in Import of the
File menu
When the user calls the Import plug-in, the corresponding DLL
BOOL TEPI_import(Pic* pInput, Pic* pOutput) is called.
If the type is Export (the TEPIT_EXPORT flag is up) then a name should be registered in Export of the
File menu.
When the user calls the Export plug-in, the corresponding DLL
BOOL TEPI_export(Pic* pInput) is called.
If the type if Preview (the TEPIT_PREVIEW flag is up) then a call is made from Preview of the
View menu.
However, older versions of the texture editor (before 1.0.1.4) support only one preview plug-in, and it cannot be used at the same time as another preview plug-in.
When the user calls the Preview plug-in, the corresponding DLL BOOL TEPI_preview(Pic* pInput) is called.
Up to two Previews are possible from version 1.0.1.5 of the texture editor.
When the user calls the Preview plug-in, the corresponding DLL BOOL TEPI_preview2(Pic* pInput, int no) is called.
struct TMF { }; |
m_width is the image width,
m_height is the image height, and
m_bits is the image bit depth (4 or 8). m_pBitmap is the exact same binary image data as BMP In 4bit mode, 1 byte has 2 pixels of image data: the higher 4bits is the left pixel and the lower 4bits is the right pixel. In 8bit mode, 1 byte has 1 pixel, so they are in order from left to right. Because 1 line has 32bit alignment, the fractional gap on the right end is filled with 0. Size is equal to ((((m_width * m_bits / 8) + 3) & ~3) * m_height) bytes. Note that, like with BMP, pixels are arranged from the bottom of the image to the top, and the Y axis is reversed. |
struct TLF { }; |
m_typeis the palette type (0 = 16bit RGBA/1 = 16bit IA) m_numis the number of palettes (16/256) m_color_array is the palette array. |
struct Pic { }; |
m_pTMF is the TMF pointer m_pTLF is the TLF pointer m_pReserved is for a future attribute table pointer. m_palette is the palette block number for a 4bit image + 256 palettes. |
Returns the type (TEPIT_IMPORT | TEPIT_EXPORT | TEPIT_PREVIEW)
Depending on the plug-in, TEPI_import() | TEPI_export() | TEPI_preview() is called.
This function is only called the first time at start-up.
From the version number of the texture editor (e.g., 1.0.0.15 = 0x0100000f) the validity or invalidity of the plug-in is returned.
If valid, return TRUE. If invalid, return FALSE.
This function is only called the first time at start-up.
This is planned for future implementation.
Quit on TRUE.
This is planned for future implementation.
Please display a dialog with DLL information using AfxMessageBox() etc.
Quit on TRUE.
Called on request from the user when the TEPIT_IMPORT flag is up for type.
A copy of the current image on the texture editor is included in pInput
By passing an image to pOutput you can paste an image imported on the texture editor side.
If the import is successful, return TRUE. If it is cancelled or fails, return FALSE.
Notes:
Called on request from the user when the TEPIT_EXPORT flag is up for the type.
Since a copy of the current image in the texture editor is included in pInput, please use this to perform the Export process.
If the export is successful, return TRUE. I fit is cancelled or fails, return FALSE.
This is called on request from the user when the TEPIT_PREVIEW flag is up for the type.
Called when preview is ON for the texture editor, and when changes are made to images and palettes.
If the preview is successful, return TRUE. If it is cancelled or fails, return FALSE.
#ifndef __tePlugIn_H__ #define __tePlugIn_H__ #ifdef __cplusplus extern "C" { #endif #pragma pack(1) struct TMF { }; struct TLF { }; /* Picture */ struct Pic { }; #pragma pack() //// TextureEditor Plug-In Type enum TEPIT { }; #define DLLEXPORT __declspec(dllexport) /* //// YOU MUST IMPLEMENT THE BELOW FUNCTIONS //// // get type of plug-in // ex) return TEPIT_IMPORT | TEPIT_EXPORT; // caution: preview type plug-in is only one. */ DLLEXPORT int PASCAL EXPORT TEPI_getType(); /* check application version. If available then return TRUE. */ DLLEXPORT BOOL PASCAL EXPORT TEPI_isAvail(DWORD version); DLLEXPORT BOOL PASCAL EXPORT TEPI_property(); DLLEXPORT BOOL PASCAL EXPORT TEPI_about(); DLLEXPORT BOOL PASCAL EXPORT TEPI_import(Pic* pInput, Pic* pOutput); /* called on import. */ DLLEXPORT BOOL PASCAL EXPORT TEPI_export(Pic* pInput); /* called on export. */ DLLEXPORT BOOL PASCAL EXPORT TEPI_preview(Pic* pInput); /* called on update time of TMF/TLF. */ #ifdef __cplusplus }; #endif #endif |
Copyright (C) 1998-1999 NINTENDO Co.,Ltd. Copyright (C) 1998-1999 NINTENDO OF AMERICA, Inc. Copyright (C) 1998-1999 MONEGI CORPORATION. Copyright (C) 1998-1999 INTELLIGENT SYSTEMS Co.,Ltd. All rights reserved. |