Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
81
Src/Wasabi/api/imgldr/imgldrapi.cpp
Normal file
81
Src/Wasabi/api/imgldr/imgldrapi.cpp
Normal file
|
@ -0,0 +1,81 @@
|
|||
#include "precomp.h"
|
||||
#include <api.h>
|
||||
#include "imgldrapi.h"
|
||||
#include <api/imgldr/imgldr.h>
|
||||
|
||||
#include <api/skin/skinelem.h>
|
||||
imgldr_api *imgLoaderApi = NULL;
|
||||
|
||||
ARGB32 *ImgLdrApi::imgldr_makeBmp(const wchar_t *filename, int *has_alpha, int *w, int *h)
|
||||
{
|
||||
if (filename == NULL)
|
||||
{
|
||||
DebugString("illegal param : filename == NULL");
|
||||
return NULL;
|
||||
}
|
||||
return imageLoader::makeBmp(filename, NULL, has_alpha, w, h, NULL, TRUE, NULL);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
ARGB32 *ImgLdrApi::imgldr_makeBmp2(HINSTANCE hInst, int id, int *has_alpha, int *w, int *h, const wchar_t *colorgroup)
|
||||
{
|
||||
return imageLoader::makeBmp(hInst, id, has_alpha,w,h, colorgroup);
|
||||
}
|
||||
#endif
|
||||
|
||||
void ImgLdrApi::imgldr_releaseBmp(ARGB32 *bmpbits)
|
||||
{
|
||||
if (bmpbits == NULL) {
|
||||
DebugString("illegal param : bmpbits == NULL");
|
||||
return;
|
||||
}
|
||||
imageLoader::release(bmpbits);
|
||||
}
|
||||
|
||||
#ifdef WASABI_COMPILE_SKIN
|
||||
|
||||
ARGB32 *ImgLdrApi::imgldr_requestSkinBitmap(const wchar_t *file, int *has_alpha, int *x, int *y, int *subw, int *subh, int *w, int *h, int cached)
|
||||
{
|
||||
if (file == NULL)
|
||||
{
|
||||
DebugString("illegal param : file == NULL");
|
||||
return NULL;
|
||||
}
|
||||
return imageLoader::requestSkinBitmap(file, has_alpha, x, y, subw, subh, w, h, cached);
|
||||
}
|
||||
|
||||
void ImgLdrApi::imgldr_releaseSkinBitmap(ARGB32 *bmpbits)
|
||||
{
|
||||
if (bmpbits == NULL)
|
||||
{
|
||||
DebugString("illegal param : bmpbits == NULL");
|
||||
return;
|
||||
}
|
||||
imageLoader::releaseSkinBitmap(bmpbits);
|
||||
}
|
||||
|
||||
RegionServer *ImgLdrApi::imgldr_requestSkinRegion(const wchar_t *id)
|
||||
{
|
||||
if (id == NULL)
|
||||
{
|
||||
DebugString("illegal param : id == NULL");
|
||||
return NULL;
|
||||
}
|
||||
return WASABI_API_PALETTE->requestSkinRegion(id);
|
||||
}
|
||||
|
||||
void ImgLdrApi::imgldr_cacheSkinRegion(const wchar_t *id, api_region *r)
|
||||
{
|
||||
if (id == NULL)
|
||||
{
|
||||
DebugString("illegal param : id == NULL");
|
||||
}
|
||||
if (r == NULL)
|
||||
{
|
||||
DebugString("illegal param : region == NULL");
|
||||
}
|
||||
WASABI_API_PALETTE->cacheSkinRegion(id, r);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue