view Engine/AssetsManager.cpp @ 2572:d87bfbd3bb3b

Step towards unification of Texture and RGBTexture (class Image)
author a.parshin
date Sat, 05 Mar 2016 01:51:54 +0200
parents
children dd36326a9994
line wrap: on
line source

#include "Engine/Engine.h"
#include "Engine/AssetsManager.h"
#include "Engine/LOD.h"

AssetsManager *assets = new AssetsManager();



Texture *AssetsManager::GetTexture(const char *name)
{
    //wchar_t wname[1024];
    //swprintf(wname, L"%S", name);

    return pIcons_LOD->LoadTexturePtr(name);
}


Texture *AssetsManager::GetTexture(const wchar_t *wname)
{
    char name[1024];
    sprintf(name, "%S", name);

    return this->GetTexture(name);
}



Image *AssetsManager::GetImage_16BitColorKey(const wchar_t *name, unsigned __int16 colorkey)
{
    Image *img = new Image();
    if (!img->ColorKey_From_LOD(name, colorkey))
    {
        delete img;
        img = nullptr;
    }

    return img;
}

Image *AssetsManager::GetImage_16BitAlpha(const wchar_t *name)
{
    Image *img = new Image();
    if (!img->Alpha_From_LOD(name))
    {
        delete img;
        img = nullptr;
    }

    return img;
}

Image *AssetsManager::GetImage_PCXFromIconsLOD(const wchar_t *name)
{
    Image *img = new Image();
    if (!img->PCX_From_IconsLOD(name))
    {
        delete img;
        img = nullptr;
    }

    return img;
}

Image *AssetsManager::GetImage_PCXFromNewLOD(const wchar_t *name)
{
    Image *img = new Image();
    if (!img->PCX_From_NewLOD(name))
    {
        delete img;
        img = nullptr;
    }

    return img;
}


Image *AssetsManager::GetImage_PCXFromFile(const wchar_t *name)
{
    Image *img = new Image();
    if (!img->PCX_From_File(name))
    {
        delete img;
        img = nullptr;
    }

    return img;
}