Jo Engine 2026.11.6
Jo Sega Saturn Engine
Loading...
Searching...
No Matches
transparency.h
Go to the documentation of this file.
1/*
2** Jo Sega Saturn Engine
3** Copyright (c) 2012-2026, 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*/
67
68#ifndef __JO_TRANSPARENCY_H__
69# define __JO_TRANSPARENCY_H__
70
71#ifdef JO_COMPILE_WITH_3D_SUPPORT
72
74# define JO_3D_TRANSPARENCY_DEFAULT_WIDTH (160)
76# define JO_3D_TRANSPARENCY_MAX_WIDTH (192)
78# define JO_3D_TRANSPARENCY_MAX_HEIGHT (160)
80# define JO_3D_TRANSPARENCY_DEFAULT_RATIO (14)
81
100bool jo_3d_transparency_init(const int width, const jo_scroll_screen screen);
101
105
111void jo_3d_transparency_set_blend(const jo_vdp2_blend_mode mode, const unsigned char ratio);
112
121
125
134
141
151
154
160
165
170void jo_3d_transparency_get_size(int * const width, int * const height);
171
178
179#endif /* !JO_COMPILE_WITH_3D_SUPPORT */
180
181#endif /* !__JO_TRANSPARENCY_H__ */
182
183/*
184** END OF FILE
185*/
Mesh structure.
Definition 3d.h:248
A rectangle of the screen (pixels, the edges are in it).
Definition 3d.h:1624
jo_3d_mesh * mesh
Definition entity.h:11
int height
Definition entity.h:4
void jo_3d_transparency_mask_end(void)
End drawing masks (see jo_3d_transparency_mask_begin()); jo_3d_transparency_end() ends them too.
bool jo_3d_transparency_init(const int width, const jo_scroll_screen screen)
Start the transparency layer (or change its width or its screen).
void jo_3d_transparency_begin(void)
Start drawing in the layer: the next polygons and billboards of the master CPU go into it (until jo_3...
void jo_3d_transparency_mask_begin(void)
Start drawing masks in the layer (between jo_3d_transparency_begin() and jo_3d_transparency_end()): t...
void jo_3d_transparency_get_size(int *const width, int *const height)
Size of the layer in the frame buffer (see jo_3d_transparency_init()).
void jo_3d_transparency_set_blend(const jo_vdp2_blend_mode mode, const unsigned char ratio)
How the layer is mixed with the image under it.
bool jo_3d_transparency_is_running(void)
The layer is running (see jo_3d_transparency_init()).
void jo_3d_transparency_set_clip(const jo_3d_rect *const rect)
Clip the next drawings in the layer to a rectangle of the screen (between jo_3d_transparency_begin() ...
void jo_3d_transparency_stop(void)
Stop the transparency layer: its bitmap given back (NBG0: the text of jo_printf() again),...
bool jo_3d_transparency_is_used(void)
Something is drawn in the layer in this frame (jo_3d_transparency_begin() was called): the masks of t...
void jo_3d_transparency_end(void)
End drawing in the layer (see jo_3d_transparency_begin()).
void jo_3d_transparency_mask(jo_3d_mesh *const mesh)
Draw an opaque mesh as a mask in the layer (between jo_3d_transparency_begin() and jo_3d_transparency...
jo_fixed jo_3d_transparency_get_scale(void)
Scale of the layer: its pixels for a pixel of the screen (0.5 for a layer of 160 pixels beside a scre...
int jo_fixed
Fixed point Q16.16 number.
Definition types.h:59
jo_scroll_screen
Sega Saturn Scroll Screen Ids.
Definition types.h:340
jo_vdp2_blend_mode
How the screens are mixed with the image under them (see jo_vdp2_set_blend_mode()).
Definition vdp2.h:724