2 * interface functions to core functions
5 /*-------------------- Extern Headers Including --------------------*/
8 /*-------------------- Local Headers Including ---------------------*/
12 /*-------------------- Main Module Header --------------------------*/
16 /*-------------------- Other ----------------------------*/
18 /*-------------------- Global Variables ----------------------------*/
20 /*-------------------- Static Variables ----------------------------*/
22 /*-------------------- Static Prototypes ---------------------------*/
26 /*-------------------- Static Functions ----------------------------*/
28 /*-------------------- Global Functions ----------------------------*/
30 Neuro_PushDraw(u32 layer
, Rectan
*isrc
, Rectan
*idst
, v_object
*isurface
)
32 Graphics_SetSafeDrawOp(1);
33 return Graphics_AddDrawingInstruction(layer
, TDRAW_STATIC
, isrc
, idst
, isurface
);
37 Neuro_FetchDraw(v_elem
*eng
, Rectan
**psrc
, u16
**px
, u16
**py
, v_object
**osurface
)
45 if (Graphics_GetSafeDrawOp() == 0)
49 *psrc
= &eng
->current
->src
;
52 *px
= &eng
->current
->dx
;
55 *py
= &eng
->current
->dy
;
59 /*Debug_Val(0, "surface_ptr 0x%x addr surface_ptr 0x%x\n",
60 eng->surface_ptr, &eng->surface_ptr);*/
61 *osurface
= eng
->current
->surface_ptr
;
68 Neuro_SetDraw(v_elem
*eng
, v_object
*isurface
)
79 if (Graphics_GetSafeDrawOp() == 0)
82 eng
->current
->surface_ptr
= isurface
;
88 Neuro_CleanDraw(v_elem
*eng
)
99 if (Graphics_GetSafeDrawOp() == 0)
102 buf
.x
= eng
->current
->dx
;
103 buf
.y
= eng
->current
->dy
;
104 buf
.w
= eng
->current
->src
.w
;
105 buf
.h
= eng
->current
->src
.h
;
107 /* we start by redrawing above the static
108 * image location to reset its image.
109 * it may be the background or black.
113 Lib_BlitObject(background, &buf, sclScreen2, NULL);
117 screen
= Neuro_GetScreenBuffer();
119 Lib_FillRect(screen
, &buf
, 0);
121 /* redraw_erased_for_object(eng); */
122 Graphics_RedrawSection(eng
);
127 /* this function is to tag the element to be
131 Neuro_FlushDraw(v_elem
*eng
)
139 if (Graphics_GetSafeDrawOp() == 0)
142 if (eng
->current
->type
== TDRAW_SDRAWN
)
144 eng
->current
->type
= TDRAW_SREDRAW
;
146 /* flag the algorithm to tell it something changed
147 * and an action needs to be taken.
149 Neuro_RedrawScreen();
150 /* draw_this_cycle = 1; */
159 Neuro_DestroyDraw(v_elem
*eng
)
167 if (Graphics_GetSafeDrawOp() == 0)
170 if (eng
->current
->type
== TDRAW_STATIC
)
173 if (Graphics_DrawIsPresent(eng
) == 0)
176 eng
->current
->type
= TDRAW_SDESTROY
;
177 /* clean_object(eng); */
179 Neuro_RedrawScreen();
180 /* draw_this_cycle = 1; */
186 Neuro_PushStaticDraw(u32 layer
, Rectan
*isrc
, Rectan
*idst
, v_object
*isurface
)
188 Graphics_AddDrawingInstruction(layer
, TDRAW_STATIC
, isrc
, idst
, isurface
);
192 Neuro_PushDynamicDraw(u32 layer
, Rectan
*isrc
, Rectan
*idst
, v_object
*isurface
)
194 Graphics_AddDrawingInstruction(layer
, TDRAW_DYNAMIC
, isrc
, idst
, isurface
);
197 /* push a drawing instruction that will be deleted from the queue and raw
198 * after being drawn. This replaces the hackish override method with an
199 * ultra versatile one and much less costy ;P.
202 Neuro_PushVolatileDraw(u32 layer
, Rectan
*isrc
, Rectan
*idst
, v_object
*isurface
)
204 Graphics_AddDrawingInstruction(layer
, TDRAW_VOLATILE
, isrc
, idst
, isurface
);