62 lines
1.2 KiB
C++
62 lines
1.2 KiB
C++
|
|
#include "TRACK.h"
|
|
#include "MEDIA.h"
|
|
|
|
|
|
class ERROR_Grabber:public INPUT_IO
|
|
{
|
|
public:
|
|
int INIT (class WORLD*){return 0;};
|
|
int FRAME (void){return 0;};
|
|
int END (void){return 0;};
|
|
IOTYPE GetType() {return IOtype_ERR;};
|
|
|
|
};
|
|
|
|
|
|
|
|
INPUT_IO *ERROR_CREATE(char *Error)
|
|
{
|
|
u32 SX,SY;
|
|
INPUT_IO *Ret;
|
|
SX = 128;
|
|
SY = 128;
|
|
Ret = (INPUT_IO *)new(ERROR_Grabber);
|
|
strcpy((char*)Ret->MediaName,Error);
|
|
|
|
Ret->IsValidForMosaique = 1;
|
|
Ret->dTotalTime = 0;
|
|
Ret->dAvgFramePerSecond = 30.0;
|
|
|
|
#ifdef UNIC_MEDIA_ERROR
|
|
static MAP UnicError;
|
|
static u32 UnicErrorInit = 0;
|
|
|
|
if (!UnicErrorInit)
|
|
{
|
|
AllocMap(&UnicError, SX, SY);
|
|
int *ImgEnd = UnicError.BASE + SX * SY;
|
|
while (ImgEnd-- > UnicError.BASE)
|
|
*ImgEnd = 0xff000000;
|
|
DRawTEXT_Soft_B_Centered((u8*)"File not found",(u32*)UnicError.BASE,SX, SY, 0xffff0000);
|
|
UnicErrorInit = 1;
|
|
}
|
|
|
|
Ret->Image = UnicError;
|
|
#else
|
|
Ret->Image.SetSize(SX, SY);
|
|
int *ImgEnd = Ret->Image.GetBase() + SX * SY;
|
|
while (ImgEnd-- > Ret->Image.GetBase())
|
|
*ImgEnd = 0xff000000;
|
|
|
|
DRawTEXT_Soft_B_Centered((u8*)Error,(u32*)Ret->Image.GetBase(),SX, SY, 0xffff0000);
|
|
|
|
#endif
|
|
|
|
//memset(Ret->Image.BASE,0,SX * SY * 4);
|
|
|
|
|
|
return (INPUT_IO *)Ret;
|
|
};
|
|
|
|
|