wonx/WonxText.c
Hiroaki Sakai 5e1a9795b7 Create your own header file. It became compilable with only Wonx.
Since there is a possibility that the Error () function will collide with libwonx.a when linking,
It changed to Wonx_Error ().
Added bios_exit ().
sprite_set_char, sprite_get_char, palette number minus 8
Fixed bug that was not specified.
font_set_monodata (), font_set_colordata (), font_get_data (), disp.c,
The arguments of screen_set_char (), screen_get_char (), sprite_set_data ()
Changed from void * to appropriate type.
Sample program and attached SpeedMac.
I added a document.

Version 0.3 beta - from wonx-b03.tar.gz
2018-03-07 23:06:08 +00:00

56 lines
2.0 KiB
C

/*****************************************************************************/
/* ここから */
/*****************************************************************************/
#include "WonxTextP.h"
#include "etc.h"
/*****************************************************************************/
/* メンバ関数の定義 */
/*****************************************************************************/
WWText WonxText_GetWWText(WonxText wonx_text)
{ return (wonx_text->ww_text); }
WWText WonxText_SetWWText(WonxText wonx_text, WWText ww_text)
{ return (wonx_text->ww_text = ww_text); }
WonxText WonxText_Create(WWScreen screen, int x, int y, int width, int height,
WWPalette palette)
{
WonxText wonx_text;
WWText ww_text;
wonx_text = (WonxText)malloc(sizeof(_WonxText));
if (wonx_text == NULL)
Wonx_Error("WonxText_Create", "Cannot allocate memory.");
ww_text = WWText_Create(screen, x, y, width, height, palette);
if (ww_text == NULL)
Wonx_Error("WonxText_Create", "Cannot create WonderWitch text.");
WonxText_SetWWText(wonx_text, ww_text);
return (wonx_text);
}
WonxText WonxText_Destroy(WonxText wonx_text)
{
if (wonx_text == NULL)
Wonx_Error("WonxText_Destroy", "Object is not created.");
if (WonxText_GetWWText(wonx_text))
WonxText_SetWWText(wonx_text,
WWText_Destroy(WonxText_GetWWText(wonx_text)));
free(wonx_text);
return (NULL);
}
/*****************************************************************************/
/* ここまで */
/*****************************************************************************/
/*****************************************************************************/
/* End of File. */
/*****************************************************************************/