Jo Engine  2020.06.22
Jo Sega Saturn Engine
sprites.h
Go to the documentation of this file.
1 /*
2 ** Jo Sega Saturn Engine
3 ** Copyright (c) 2012-2020, Johannes Fetz (johannesfetz@gmail.com)
4 ** All rights reserved.
5 **
6 ** Redistribution and use in source and binary forms, with or without
7 ** modification, are permitted provided that the following conditions are met:
8 ** * Redistributions of source code must retain the above copyright
9 ** notice, this list of conditions and the following disclaimer.
10 ** * Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
13 ** * Neither the name of the Johannes Fetz nor the
14 ** names of its contributors may be used to endorse or promote products
15 ** derived from this software without specific prior written permission.
16 **
17 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 ** DISCLAIMED. IN NO EVENT SHALL Johannes Fetz BE LIABLE FOR ANY
21 ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
35 #ifndef __JO_SPRITES_H__
36 # define __JO_SPRITES_H__
37 
38 /*
39 ██╗███╗ ██╗████████╗███████╗██████╗ ███╗ ██╗ █████╗ ██╗
40 ██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗████╗ ██║██╔══██╗██║
41 ██║██╔██╗ ██║ ██║ █████╗ ██████╔╝██╔██╗ ██║███████║██║
42 ██║██║╚██╗██║ ██║ ██╔══╝ ██╔══██╗██║╚██╗██║██╔══██║██║
43 ██║██║ ╚████║ ██║ ███████╗██║ ██║██║ ╚████║██║ ██║███████╗
44 ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝
45 ▲ DO NOT USE THESE FUNCTIONS ▲
46 */
47 
55 extern jo_texture_definition __jo_sprite_def[JO_MAX_SPRITE];
59 void jo_sprite_draw(const int sprite_id, const jo_pos3D * const pos, const bool centered_style_coordinates, const bool billboard);
63 void jo_sprite_draw_rotate(const int sprite_id, const jo_pos3D * const pos, const int angle, const bool centered_style_coordinates, const bool billboard);
65 static __jo_force_inline void __internal_jo_sprite_set_position3D(const int x, const int y, const int z)
66 {
67  extern jo_pos3D __jo_sprite_pos;
68  __jo_sprite_pos.x = x;
69  __jo_sprite_pos.y = y;
70  __jo_sprite_pos.z = z;
71 }
72 
73 /*
74  █████╗ ██████╗ ██████╗ ██╗██████╗ ███████╗██████╗ ██╗ █████╗ ██████╗███████╗ ██╗███████╗██████╗ ███████╗███████╗
75 ██╔══██╗██╔══██╗██╔══██╗ ██╔╝██╔══██╗██╔════╝██╔══██╗██║ ██╔══██╗██╔════╝██╔════╝ ██╔╝██╔════╝██╔══██╗██╔════╝██╔════╝
76 ███████║██║ ██║██║ ██║ ██╔╝ ██████╔╝█████╗ ██████╔╝██║ ███████║██║ █████╗ ██╔╝ █████╗ ██████╔╝█████╗ █████╗
77 ██╔══██║██║ ██║██║ ██║ ██╔╝ ██╔══██╗██╔══╝ ██╔═══╝ ██║ ██╔══██║██║ ██╔══╝ ██╔╝ ██╔══╝ ██╔══██╗██╔══╝ ██╔══╝
78 ██║ ██║██████╔╝██████╔╝██╔╝ ██║ ██║███████╗██║ ███████╗██║ ██║╚██████╗███████╗██╔╝ ██║ ██║ ██║███████╗███████╗
79 ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝
80 */
81 
86 
91 int jo_sprite_add(const jo_img * const img);
92 
98 int jo_sprite_add_8bits_image(const jo_img_8bits * const img);
99 
105 int jo_sprite_replace(const jo_img * const img, const int sprite_id);
106 
111 void jo_sprite_free_from(const int sprite_id);
112 
117 {
119 }
120 
121 # ifdef JO_COMPILE_WITH_SPRITE_HASHTABLE
122 
127 int jo_sprite_name2id(const char *const filename);
128 #endif
129 
130 /*
131 ████████╗██████╗ █████╗ ███╗ ██╗███████╗██████╗ █████╗ ██████╗ ███████╗███╗ ██╗ ██████╗██╗ ██╗
132 ╚══██╔══╝██╔══██╗██╔══██╗████╗ ██║██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝████╗ ██║██╔════╝╚██╗ ██╔╝
133  ██║ ██████╔╝███████║██╔██╗ ██║███████╗██████╔╝███████║██████╔╝█████╗ ██╔██╗ ██║██║ ╚████╔╝
134  ██║ ██╔══██╗██╔══██║██║╚██╗██║╚════██║██╔═══╝ ██╔══██║██╔══██╗██╔══╝ ██║╚██╗██║██║ ╚██╔╝
135  ██║ ██║ ██║██║ ██║██║ ╚████║███████║██║ ██║ ██║██║ ██║███████╗██║ ╚████║╚██████╗ ██║
136  ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝
137 */
138 
139 /*
140 ** Screen doors filter (old school transparency)
141 */
142 
146 {
148 }
149 
153 {
155 }
156 
157 /*
158 ** Half transparency
159 */
160 
164 {
166 }
167 
171 {
173 }
174 
175 /*
176 ███████╗██╗ ██╗ █████╗ ██████╗ ██████╗ ██╗ ██╗
177 ██╔════╝██║ ██║██╔══██╗██╔══██╗██╔═══██╗██║ ██║
178 ███████╗███████║███████║██║ ██║██║ ██║██║ █╗ ██║
179 ╚════██║██╔══██║██╔══██║██║ ██║██║ ██║██║███╗██║
180 ███████║██║ ██║██║ ██║██████╔╝╚██████╔╝╚███╔███╔╝
181 ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚══╝╚══╝
182 */
183 
187 {
189 }
190 
194 {
196 }
197 
198 /*
199 ** Dark filter
200 */
201 
205 {
207 }
208 
212 {
214 }
215 
216 /*
217  ██████╗ ██████╗ ██╗ ██╗██████╗ █████╗ ██╗ ██╗██████╗ ███████╗██╗ ██╗ █████╗ ██████╗ ██╗███╗ ██╗ ██████╗
218 ██╔════╝ ██╔═══██╗██║ ██║██╔══██╗██╔══██╗██║ ██║██╔══██╗ ██╔════╝██║ ██║██╔══██╗██╔══██╗██║████╗ ██║██╔════╝
219 ██║ ███╗██║ ██║██║ ██║██████╔╝███████║██║ ██║██║ ██║ ███████╗███████║███████║██║ ██║██║██╔██╗ ██║██║ ███╗
220 ██║ ██║██║ ██║██║ ██║██╔══██╗██╔══██║██║ ██║██║ ██║ ╚════██║██╔══██║██╔══██║██║ ██║██║██║╚██╗██║██║ ██║
221 ╚██████╔╝╚██████╔╝╚██████╔╝██║ ██║██║ ██║╚██████╔╝██████╔╝ ███████║██║ ██║██║ ██║██████╔╝██║██║ ╚████║╚██████╔╝
222  ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝
223 */
224 
226 # define JO_NO_GOURAUD_COLOR (0xc210)
227 
234 void jo_set_gouraud_shading_colors(const jo_color topleft_color,
235  const jo_color topright_color,
236  const jo_color bottomright_color,
237  const jo_color bottomleft_color);
238 
242 {
244 }
245 
249 {
251 }
252 
254 # define JO_DEFAULT_BRIGHTNESS (16)
255 
257 # define JO_MAX_BRIGHTNESS (31)
258 
262 void jo_set_gouraud_shading_brightness(const unsigned char brightness);
263 
264 /*
265 ██╗ ██╗ ██████╗ ██████╗ ██╗███████╗ ██╗██╗ ██╗███████╗██████╗ ████████╗ ███████╗██╗ ██╗██████╗
266 ██║ ██║██╔═══██╗██╔══██╗██║╚══███╔╝ ██╔╝██║ ██║██╔════╝██╔══██╗╚══██╔══╝ ██╔════╝██║ ██║██╔══██╗
267 ███████║██║ ██║██████╔╝██║ ███╔╝ ██╔╝ ██║ ██║█████╗ ██████╔╝ ██║ █████╗ ██║ ██║██████╔╝
268 ██╔══██║██║ ██║██╔══██╗██║ ███╔╝ ██╔╝ ╚██╗ ██╔╝██╔══╝ ██╔══██╗ ██║ ██╔══╝ ██║ ██║██╔═══╝
269 ██║ ██║╚██████╔╝██║ ██║██║███████╗██╔╝ ╚████╔╝ ███████╗██║ ██║ ██║ ██║ ███████╗██║██║
270 ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚══════╝╚═╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝╚═╝
271 */
272 
276 {
278 }
279 
283 {
285 }
286 
289 {
291 }
292 
296 {
298 }
299 
300 /*
301 ███████╗ ██████╗ █████╗ ██╗ ███████╗
302 ██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
303 ███████╗██║ ███████║██║ █████╗
304 ╚════██║██║ ██╔══██║██║ ██╔══╝
305 ███████║╚██████╗██║ ██║███████╗███████╗
306 ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝
307 */
308 
310 # define JO_NO_ZOOM (65535)
311 
315 static __jo_force_inline void jo_sprite_change_sprite_scale(const float scale)
316 {
319 }
320 
325 static __jo_force_inline void jo_sprite_change_sprite_scale_xy(const float scale_x, const float scale_y)
326 {
329 }
330 
336 {
339 }
340 
344 {
347 }
348 
349 /*
350 ██████╗ ██████╗ █████╗ ██╗ ██╗
351 ██╔══██╗██╔══██╗██╔══██╗██║ ██║
352 ██║ ██║██████╔╝███████║██║ █╗ ██║
353 ██║ ██║██╔══██╗██╔══██║██║███╗██║
354 ██████╔╝██║ ██║██║ ██║╚███╔███╔╝
355 ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝
356 */
357 
361 static __jo_force_inline void jo_sprite_set_palette(int palette_id)
362 {
364 }
365 
373 static __jo_force_inline void jo_sprite_draw3D_and_rotate(const int sprite_id, const int x, const int y, const int z, const int angle)
374 {
375  extern jo_pos3D __jo_sprite_pos;
377  jo_sprite_draw_rotate(sprite_id, &__jo_sprite_pos, angle, true, false);
378 }
379 
386 static __jo_force_inline void jo_sprite_draw3D(const int sprite_id, const int x, const int y, const int z)
387 {
388  extern jo_pos3D __jo_sprite_pos;
390  jo_sprite_draw(sprite_id, &__jo_sprite_pos, true, false);
391 }
392 
400 static __jo_force_inline void jo_sprite_draw3D_and_rotate2(const int sprite_id, const int x, const int y, const int z, const int angle)
401 {
402  extern jo_pos3D __jo_sprite_pos;
404  jo_sprite_draw_rotate(sprite_id, &__jo_sprite_pos, angle, false, false);
405 }
406 
413 static __jo_force_inline void jo_sprite_draw3D2(const int sprite_id, const int x, const int y, const int z)
414 {
415  extern jo_pos3D __jo_sprite_pos;
417  jo_sprite_draw(sprite_id, &__jo_sprite_pos, false, false);
418 }
419 
420 void jo_sprite_draw_4p_fixed(const int sprite_id, const jo_pos2D_fixed * const four_points, const jo_fixed z, const bool centered_style_coordinates);
421 
422 /*
423  ██████╗██╗ ██╗██████╗ ██████╗ ██╗███╗ ██╗ ██████╗
424 ██╔════╝██║ ██║██╔══██╗██╔══██╗██║████╗ ██║██╔════╝
425 ██║ ██║ ██║██████╔╝██████╔╝██║██╔██╗ ██║██║ ███╗
426 ██║ ██║ ██║██╔═══╝ ██╔═══╝ ██║██║╚██╗██║██║ ██║
427 ╚██████╗███████╗██║██║ ██║ ██║██║ ╚████║╚██████╔╝
428  ╚═════╝╚══════╝╚═╝╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝
429 */
430 
435 {
436  __jo_sprite_attributes.clipping = outside ? Window_Out : Window_In;
437 }
438 
442 {
443  __jo_sprite_attributes.clipping = No_Window;
444 }
445 
446 
454 void jo_sprite_set_clipping_area(const unsigned int x, const unsigned int y, const unsigned int width, const unsigned int height, const int depth);
455 
456 /*
457  ██████╗ ███████╗████████╗ ███████╗██████╗ ██████╗ ██╗████████╗███████╗ ██╗███╗ ██╗███████╗ ██████╗
458 ██╔════╝ ██╔════╝╚══██╔══╝ ██╔════╝██╔══██╗██╔══██╗██║╚══██╔══╝██╔════╝ ██║████╗ ██║██╔════╝██╔═══██╗
459 ██║ ███╗█████╗ ██║ ███████╗██████╔╝██████╔╝██║ ██║ █████╗ ██║██╔██╗ ██║█████╗ ██║ ██║
460 ██║ ██║██╔══╝ ██║ ╚════██║██╔═══╝ ██╔══██╗██║ ██║ ██╔══╝ ██║██║╚██╗██║██╔══╝ ██║ ██║
461 ╚██████╔╝███████╗ ██║ ███████║██║ ██║ ██║██║ ██║ ███████╗ ██║██║ ╚████║██║ ╚██████╔╝
462  ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═════╝
463 */
464 
471 static __jo_force_inline jo_color jo_sprite_get_pixel_color(const jo_color * const data, const unsigned int x, const unsigned int y, const unsigned int image_width)
472 {
473  return (data[x + y * image_width]);
474 }
475 
483 static __jo_force_inline bool jo_sprite_is_pixel_transparent(const jo_color * const data, const unsigned int x, const unsigned int y, const unsigned int image_width)
484 {
485  return (jo_sprite_get_pixel_color(data, x, y, image_width) == JO_COLOR_Transparent);
486 }
487 
492 static __jo_force_inline int jo_sprite_get_width(const int sprite_id)
493 {
494  return (__jo_sprite_def[sprite_id].width);
495 }
496 
501 static __jo_force_inline int jo_sprite_get_height(const int sprite_id)
502 {
503  return (__jo_sprite_def[sprite_id].height);
504 }
505 
506 /*
507 ███████╗████████╗ █████╗ ████████╗██╗███████╗████████╗██╗ ██████╗███████╗
508 ██╔════╝╚══██╔══╝██╔══██╗╚══██╔══╝██║██╔════╝╚══██╔══╝██║██╔════╝██╔════╝
509 ███████╗ ██║ ███████║ ██║ ██║███████╗ ██║ ██║██║ ███████╗
510 ╚════██║ ██║ ██╔══██║ ██║ ██║╚════██║ ██║ ██║██║ ╚════██║
511 ███████║ ██║ ██║ ██║ ██║ ██║███████║ ██║ ██║╚██████╗███████║
512 ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
513 */
514 
519 {
520  return (jo_get_last_sprite_id() + 1);
521 }
522 
528 
529 #endif /* !__JO_SPRITES_H__ */
530 
531 /*
532 ** END OF FILE
533 */
jo_sprite_get_height
static __jo_force_inline int jo_sprite_get_height(const int sprite_id)
Get sprite height.
Definition: sprites.h:501
jo_sprite_enable_half_transparency
static __jo_force_inline void jo_sprite_enable_half_transparency(void)
Activate half transparency for every sprite displayed after this call.
Definition: sprites.h:163
jo_sprite_enable_dark_filter
static __jo_force_inline void jo_sprite_enable_dark_filter(void)
Activate dark filter for every sprite displayed after this call.
Definition: sprites.h:204
jo_sprite_draw3D
static __jo_force_inline void jo_sprite_draw3D(const int sprite_id, const int x, const int y, const int z)
Display a sprite in 3 dimensional space.
Definition: sprites.h:386
jo_sprite_change_sprite_scale_xy_fixed
static __jo_force_inline void jo_sprite_change_sprite_scale_xy_fixed(const jo_fixed scale_x, const jo_fixed scale_y)
Change scale for every sprite displayed after this call using fixed number.
Definition: sprites.h:335
jo_sprite_enable_horizontal_flip
static __jo_force_inline void jo_sprite_enable_horizontal_flip(void)
Activate horizontal flip for every sprite displayed after this call.
Definition: sprites.h:288
jo_sprite_disable_half_transparency
static __jo_force_inline void jo_sprite_disable_half_transparency(void)
Disable half transparency for every sprite displayed after this call.
Definition: sprites.h:170
jo_sprite_enable_screen_doors_filter
static __jo_force_inline void jo_sprite_enable_screen_doors_filter(void)
Activate screen doors filter for every sprite displayed after this call.
Definition: sprites.h:145
jo_set_gouraud_shading_colors
void jo_set_gouraud_shading_colors(const jo_color topleft_color, const jo_color topright_color, const jo_color bottomright_color, const jo_color bottomleft_color)
Change Gouraud Shading colors.
jo_sprite_change_sprite_scale
static __jo_force_inline void jo_sprite_change_sprite_scale(const float scale)
Change scale for every sprite displayed after this call.
Definition: sprites.h:315
jo_set_gouraud_shading_brightness
void jo_set_gouraud_shading_brightness(const unsigned char brightness)
Change Gouraud Shading brightness.
JO_REMOVE_FLAG
#define JO_REMOVE_FLAG(BYTEFIELD, FLAG)
Remove flag in bytefield.
Definition: math.h:330
jo_sprite_attributes::effect
unsigned short effect
Definition: types.h:248
__jo_sprite_attributes
jo_sprite_attributes __jo_sprite_attributes
Current displayed sprite attribute (internal engine usage)
__jo_force_inline
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition: conf.h:154
jo_texture_definition
Texture definition.
Definition: types.h:190
jo_sprite_disable_screen_doors_filter
static __jo_force_inline void jo_sprite_disable_screen_doors_filter(void)
Disable screen doors filter for every sprite displayed after this call.
Definition: sprites.h:152
jo_sprite_get_pixel_color
static __jo_force_inline jo_color jo_sprite_get_pixel_color(const jo_color *const data, const unsigned int x, const unsigned int y, const unsigned int image_width)
Get a specific pixel color from image bytes.
Definition: sprites.h:471
jo_sprite_enable_clipping
static __jo_force_inline void jo_sprite_enable_clipping(bool outside)
Activate sprite clipping for every sprite displayed after this call.
Definition: sprites.h:434
jo_sprite_change_sprite_scale_xy
static __jo_force_inline void jo_sprite_change_sprite_scale_xy(const float scale_x, const float scale_y)
Change scale for every sprite displayed after this call.
Definition: sprites.h:325
jo_sprite_attributes::color_table_index
unsigned int color_table_index
Definition: types.h:250
jo_sprite_draw3D_and_rotate
static __jo_force_inline void jo_sprite_draw3D_and_rotate(const int sprite_id, const int x, const int y, const int z, const int angle)
Display a sprite in 3 dimensional space.
Definition: sprites.h:373
jo_sprite_draw
void jo_sprite_draw(const int sprite_id, const jo_pos3D *const pos, const bool centered_style_coordinates, const bool billboard)
(internal engine usage)
JO_MULT_BY_256
#define JO_MULT_BY_256(X)
Multiply a variable by 256.
Definition: math.h:108
jo_sprite_attributes::fixed_scale_y
jo_fixed fixed_scale_y
Definition: types.h:253
jo_pos3D::z
int z
Definition: types.h:69
jo_sprite_disable_shadow_filter
static __jo_force_inline void jo_sprite_disable_shadow_filter(void)
Disable shadow filter for every sprite displayed after this call.
Definition: sprites.h:193
jo_sprite_disable_horizontal_flip
static __jo_force_inline void jo_sprite_disable_horizontal_flip(void)
Disable horizontal flip for every sprite displayed after this call.
Definition: sprites.h:295
jo_color
unsigned short jo_color
15 bits color type
Definition: types.h:39
jo_sprite_count
static __jo_force_inline int jo_sprite_count(void)
Get sprite count.
Definition: sprites.h:518
jo_sprite_attributes::direction
unsigned short direction
Definition: types.h:249
jo_img_8bits
8 bits image struct
Definition: types.h:215
jo_sprite_add
int jo_sprite_add(const jo_img *const img)
Add a sprite.
jo_sprite_free_all
static __jo_force_inline void jo_sprite_free_all(void)
Free all sprites.
Definition: sprites.h:116
jo_fixed
int jo_fixed
Fixed point Q16.16 number.
Definition: types.h:46
JO_COLOR_Transparent
#define JO_COLOR_Transparent
Transparent color.
Definition: colors.h:87
jo_pos3D::y
int y
Definition: types.h:68
jo_sprite_disable_vertical_flip
static __jo_force_inline void jo_sprite_disable_vertical_flip(void)
Disable vertical flip for every sprite displayed after this call.
Definition: sprites.h:282
JO_ADD_FLAG
#define JO_ADD_FLAG(BYTEFIELD, FLAG)
Add flag in bytefield.
Definition: math.h:324
jo_sprite_free_from
void jo_sprite_free_from(const int sprite_id)
Free all sprites from the given sprite_id.
jo_sprite_disable_clipping
static __jo_force_inline void jo_sprite_disable_clipping(void)
Disable sprite clipping for every sprite displayed after this call.
Definition: sprites.h:441
jo_sprite_set_palette
static __jo_force_inline void jo_sprite_set_palette(int palette_id)
Change palette for every 8 bits sprite displayed after this call.
Definition: sprites.h:361
jo_sprite_set_clipping_area
void jo_sprite_set_clipping_area(const unsigned int x, const unsigned int y, const unsigned int width, const unsigned int height, const int depth)
Set user clipping area.
jo_sprite_disable_dark_filter
static __jo_force_inline void jo_sprite_disable_dark_filter(void)
Disable dark filter for every sprite displayed after this call.
Definition: sprites.h:211
jo_sprite_enable_vertical_flip
static __jo_force_inline void jo_sprite_enable_vertical_flip(void)
Activate vertical flip for every sprite displayed after this call.
Definition: sprites.h:275
jo_sprite_replace
int jo_sprite_replace(const jo_img *const img, const int sprite_id)
Replace a sprite.
jo_sprite_draw3D2
static __jo_force_inline void jo_sprite_draw3D2(const int sprite_id, const int x, const int y, const int z)
Display a sprite in 3 dimensional space.
Definition: sprites.h:413
jo_sprite_disable_gouraud_shading
static __jo_force_inline void jo_sprite_disable_gouraud_shading(void)
Disable Gouraud Shading for every sprite displayed after this call.
Definition: sprites.h:248
jo_sprite_get_width
static __jo_force_inline int jo_sprite_get_width(const int sprite_id)
Get sprite width.
Definition: sprites.h:492
jo_sprite_restore_sprite_scale
static __jo_force_inline void jo_sprite_restore_sprite_scale(void)
Restore default scale for every sprite displayed after this call.
Definition: sprites.h:343
jo_sprite_draw_rotate
void jo_sprite_draw_rotate(const int sprite_id, const jo_pos3D *const pos, const int angle, const bool centered_style_coordinates, const bool billboard)
(internal engine usage)
jo_pos3D
3D position
Definition: types.h:66
jo_pos3D::x
int x
Definition: types.h:67
jo_sprite_attributes::fixed_scale_x
jo_fixed fixed_scale_x
Definition: types.h:252
jo_sprite_draw3D_and_rotate2
static __jo_force_inline void jo_sprite_draw3D_and_rotate2(const int sprite_id, const int x, const int y, const int z, const int angle)
Display a sprite in 3 dimensional space.
Definition: sprites.h:400
__internal_jo_sprite_set_position3D
static __jo_force_inline void __internal_jo_sprite_set_position3D(const int x, const int y, const int z)
Internal usage don't use it.
Definition: sprites.h:65
jo_sprite_is_pixel_transparent
static __jo_force_inline bool jo_sprite_is_pixel_transparent(const jo_color *const data, const unsigned int x, const unsigned int y, const unsigned int image_width)
Get if a specific pixel is transparent (JO_COLOR_Transparent) in image bytes.
Definition: sprites.h:483
jo_sprite_attributes::clipping
unsigned int clipping
Definition: types.h:254
jo_sprite_attributes
Sprite attributes.
Definition: types.h:247
jo_sprite_name2id
int jo_sprite_name2id(const char *const filename)
Retrive the Sprite Id from filename based on the four first character in the filename.
jo_sprite_enable_shadow_filter
static __jo_force_inline void jo_sprite_enable_shadow_filter(void)
Activate shadow filter for every sprite displayed after this call.
Definition: sprites.h:186
jo_get_last_sprite_id
int jo_get_last_sprite_id(void)
Get last Sprite Id.
jo_float2fixed
static __jo_force_inline jo_fixed jo_float2fixed(const float x)
Convert float to jo engine fixed (avoid usage of GCC Soft Float)
Definition: math.h:423
jo_sprite_draw_4p_fixed
void jo_sprite_draw_4p_fixed(const int sprite_id, const jo_pos2D_fixed *const four_points, const jo_fixed z, const bool centered_style_coordinates)
jo_pos2D_fixed
2D position using fixed number
Definition: types.h:57
jo_sprite_usage_percent
int jo_sprite_usage_percent(void)
Get sprite memory usage.
jo_sprite_add_8bits_image
int jo_sprite_add_8bits_image(const jo_img_8bits *const img)
Add a 8 bits sprite.
jo_img
15 bits image struct
Definition: types.h:207
__jo_sprite_def
jo_texture_definition __jo_sprite_def[JO_MAX_SPRITE]
(internal engine usage)
JO_NO_ZOOM
#define JO_NO_ZOOM
Value used to keep the original scale.
Definition: sprites.h:310
jo_sprite_enable_gouraud_shading
static __jo_force_inline void jo_sprite_enable_gouraud_shading(void)
Activate Gouraud Shading for every sprite displayed after this call.
Definition: sprites.h:241