#include "SetFormat.h"#include "genesis.h"#include "errorlog.h"#include "ram.h"#include "gebmutil.h"#include <stdlib.h>#include <string.h>#include <assert.h>Go to the source code of this file.
Compounds | |
| struct | Procedural |
Typedefs | |
| typedef Procedural | Procedural |
Functions | |
| Procedural * | SetFormat_Create (geBitmap **ppBitmap, const char *ParmStart) |
| void | SetFormat_Destroy (Procedural *Proc) |
| geBoolean | SetFormat_Animate (Procedural *SetFormat, float ElapsedTime) |
| Procedural_Table * | SetFormat_GetProcedural_Table (void) |
Variables | |
| Procedural_Table | SetFormat_Table |
|
|
|
|
||||||||||||
|
Definition at line 92 of file setformat.c. References GE_TRUE, and geBoolean.
00093 {
00094 return GE_TRUE;
00095 }
|
|
||||||||||||
|
Definition at line 40 of file setformat.c. References Procedural::Bitmap, geBitmap_Info::Format, GE_PIXELFORMAT_16BIT_4444_ARGB, geBitmap_CreateRef(), geBitmap_GetInfo(), geBitmap_SetFormatMin(), geBitmapUtil_SetAlphaFromBrightness(), geErrorLog_AddString, gePixelFormat, gePixelFormat_HasAlpha(), gePixelFormat_IsValid(), geRam_Allocate, and NULL.
00041 {
00042 Procedural * P;
00043 gePixelFormat Format;
00044 geBitmap_Info Info;
00045
00046 if ( ! ppBitmap || ! *ppBitmap )
00047 return NULL;
00048
00049 if ( ! InParams )
00050 {
00051 Format = GE_PIXELFORMAT_16BIT_4444_ARGB;
00052 }
00053 else
00054 {
00055 Format = atol(InParams);
00056 if ( ! gePixelFormat_IsValid(Format) )
00057 return NULL;
00058 }
00059
00060 P = geRam_Allocate(sizeof(Procedural));
00061 assert(P);
00062 memset(P,0,sizeof(Procedural));
00063
00064 P->Bitmap = *ppBitmap;
00065
00066 geBitmap_CreateRef(P->Bitmap);
00067
00068 geBitmap_GetInfo(P->Bitmap,&Info,NULL);
00069
00070 if ( gePixelFormat_HasAlpha(Format) && ! gePixelFormat_HasAlpha(Info.Format) )
00071 {
00072 geBitmapUtil_SetAlphaFromBrightness(P->Bitmap);
00073 }
00074
00075 if ( ! geBitmap_SetFormatMin(P->Bitmap,Format) )
00076 {
00077 geErrorLog_AddString(-1,"Setformat failed!",NULL);
00078 }
00079
00080 return P;
00081 }
|
|
|
Definition at line 83 of file setformat.c. References Procedural::Bitmap, geBitmap_Destroy(), and geRam_Free.
00084 {
00085 if ( ! P )
00086 return;
00087 if ( P->Bitmap )
00088 geBitmap_Destroy(&(P->Bitmap));
00089 geRam_Free(P);
00090 }
|
|
|
Definition at line 26 of file setformat.c. References SetFormat_Table.
00027 {
00028 return &SetFormat_Table;
00029 }
|
|
|
Initial value:
{
Procedurals_Version,Procedurals_Tag,
"SetFormat",
SetFormat_Create,
SetFormat_Destroy,
SetFormat_Animate
}
Definition at line 17 of file setformat.c. Referenced by SetFormat_GetProcedural_Table(). |
1.3.2