add full covers
This commit is contained in:
parent
9644fdc04d
commit
ebfc839acb
Binary file not shown.
Before Width: | Height: | Size: 433 KiB After Width: | Height: | Size: 433 KiB |
@ -19,6 +19,7 @@ namespace scene::tracker::cover {
|
|||||||
float height;
|
float height;
|
||||||
float scale;
|
float scale;
|
||||||
vec3 color;
|
vec3 color;
|
||||||
|
uint32_t texture_full_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
int cover_ix = -1;
|
int cover_ix = -1;
|
||||||
@ -27,6 +28,15 @@ namespace scene::tracker::cover {
|
|||||||
|
|
||||||
static vec3 bg_color = {0, 0, 0};
|
static vec3 bg_color = {0, 0, 0};
|
||||||
|
|
||||||
|
const uint32_t full_texture_size = tsp_instruction_word::texture_u_size::from_int(512)
|
||||||
|
| tsp_instruction_word::texture_v_size::from_int(512);
|
||||||
|
|
||||||
|
const float full_texture_width = 1.0 / 512.f;
|
||||||
|
const float full_texture_height = 1.0 / 512.f;
|
||||||
|
|
||||||
|
const float full_width = 432.0f;
|
||||||
|
const float full_height = 432.0f;
|
||||||
|
|
||||||
static const cover covers[] = {
|
static const cover covers[] = {
|
||||||
[thebeach] = {
|
[thebeach] = {
|
||||||
.texture_offset = texture::offset::thebeach,
|
.texture_offset = texture::offset::thebeach,
|
||||||
@ -49,6 +59,7 @@ namespace scene::tracker::cover {
|
|||||||
.height = 72,
|
.height = 72,
|
||||||
.scale = 6,
|
.scale = 6,
|
||||||
.color = {0x0d, 0x10, 0x1a},
|
.color = {0x0d, 0x10, 0x1a},
|
||||||
|
.texture_full_offset = texture::offset::silvertreesfull,
|
||||||
},
|
},
|
||||||
[redtree] = {
|
[redtree] = {
|
||||||
.texture_offset = texture::offset::redtree,
|
.texture_offset = texture::offset::redtree,
|
||||||
@ -60,6 +71,7 @@ namespace scene::tracker::cover {
|
|||||||
.height = 72,
|
.height = 72,
|
||||||
.scale = 6,
|
.scale = 6,
|
||||||
.color = {0x1a, 0x00, 0x00},
|
.color = {0x1a, 0x00, 0x00},
|
||||||
|
.texture_full_offset = texture::offset::redtreefull,
|
||||||
},
|
},
|
||||||
[mountain] = {
|
[mountain] = {
|
||||||
.texture_offset = texture::offset::mountain,
|
.texture_offset = texture::offset::mountain,
|
||||||
@ -151,6 +163,14 @@ namespace scene::tracker::cover {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr inline vec2 transform_texture_full(const vec2& t)
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
(t.x * full_width) * full_texture_width,
|
||||||
|
(t.y * full_height) * full_texture_height,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
constexpr inline vec2 transform_texture(const cover& cover,
|
constexpr inline vec2 transform_texture(const cover& cover,
|
||||||
const vec2& t)
|
const vec2& t)
|
||||||
{
|
{
|
||||||
@ -223,15 +243,6 @@ namespace scene::tracker::cover {
|
|||||||
|
|
||||||
update_background(cover);
|
update_background(cover);
|
||||||
|
|
||||||
uint32_t texture_size = cover.texture_size
|
|
||||||
| tsp_instruction_word::dst_alpha_instr::zero;
|
|
||||||
|
|
||||||
global_polygon_textured(multi.op,
|
|
||||||
para_control::list_type::translucent,
|
|
||||||
cover.texture_offset,
|
|
||||||
texture_size,
|
|
||||||
texture_control_word::pixel_format::_565);
|
|
||||||
|
|
||||||
float z = 1.0 / 3.0f;
|
float z = 1.0 / 3.0f;
|
||||||
|
|
||||||
int base_color = 0xffffff;
|
int base_color = 0xffffff;
|
||||||
@ -266,12 +277,61 @@ namespace scene::tracker::cover {
|
|||||||
vec2 ct = transform_texture(cover, vtx[2]);
|
vec2 ct = transform_texture(cover, vtx[2]);
|
||||||
vec2 dt = transform_texture(cover, vtx[3]);
|
vec2 dt = transform_texture(cover, vtx[3]);
|
||||||
|
|
||||||
|
if (cover.texture_full_offset == 0) {
|
||||||
|
uint32_t texture_size = cover.texture_size
|
||||||
|
| tsp_instruction_word::dst_alpha_instr::zero;
|
||||||
|
|
||||||
|
global_polygon_textured(multi.op,
|
||||||
|
para_control::list_type::translucent,
|
||||||
|
cover.texture_offset,
|
||||||
|
texture_size,
|
||||||
|
texture_control_word::pixel_format::_565);
|
||||||
|
|
||||||
quad_type_3(multi.op,
|
quad_type_3(multi.op,
|
||||||
ap, at,
|
ap, at,
|
||||||
bp, bt,
|
bp, bt,
|
||||||
cp, ct,
|
cp, ct,
|
||||||
dp, dt,
|
dp, dt,
|
||||||
base_color);
|
base_color);
|
||||||
|
} else {
|
||||||
|
vec2 atf = transform_texture_full(vtx[0]);
|
||||||
|
vec2 btf = transform_texture_full(vtx[1]);
|
||||||
|
vec2 ctf = transform_texture_full(vtx[2]);
|
||||||
|
vec2 dtf = transform_texture_full(vtx[3]);
|
||||||
|
|
||||||
|
uint32_t texture_size = cover.texture_size
|
||||||
|
| tsp_instruction_word::dst_alpha_instr::zero;
|
||||||
|
|
||||||
|
global_polygon_textured_tl(multi.op,
|
||||||
|
para_control::list_type::translucent,
|
||||||
|
cover.texture_offset,
|
||||||
|
texture_size,
|
||||||
|
texture_control_word::pixel_format::_565);
|
||||||
|
|
||||||
|
uint32_t alpha0 = (uint32_t)(255.0 * (1.0 - zoom_interp)) << 24;
|
||||||
|
|
||||||
|
quad_type_3(multi.op,
|
||||||
|
ap, at,
|
||||||
|
bp, bt,
|
||||||
|
cp, ct,
|
||||||
|
dp, dt,
|
||||||
|
alpha0 | base_color);
|
||||||
|
|
||||||
|
uint32_t alpha1 = (uint32_t)(255.0 * (zoom_interp)) << 24;
|
||||||
|
|
||||||
|
global_polygon_textured_tl(multi.op,
|
||||||
|
para_control::list_type::translucent,
|
||||||
|
cover.texture_full_offset,
|
||||||
|
full_texture_size | tsp_instruction_word::dst_alpha_instr::inverse_src_alpha,
|
||||||
|
texture_control_word::pixel_format::_565);
|
||||||
|
|
||||||
|
quad_type_3(multi.op,
|
||||||
|
ap, atf,
|
||||||
|
bp, btf,
|
||||||
|
cp, ctf,
|
||||||
|
dp, dtf,
|
||||||
|
alpha1 | base_color);
|
||||||
|
}
|
||||||
|
|
||||||
if (zoom_interp > 0)
|
if (zoom_interp > 0)
|
||||||
draw_shroud(multi.op, cover);
|
draw_shroud(multi.op, cover);
|
||||||
|
@ -45,6 +45,42 @@ static inline void global_polygon_textured(ta_parameter_writer& writer,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void global_polygon_textured_tl(ta_parameter_writer& writer,
|
||||||
|
uint32_t list_type,
|
||||||
|
uint32_t texture_offset,
|
||||||
|
uint32_t texture_size,
|
||||||
|
uint32_t pixel_format)
|
||||||
|
{
|
||||||
|
const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
|
||||||
|
| list_type
|
||||||
|
| obj_control::col_type::packed_color
|
||||||
|
| obj_control::texture
|
||||||
|
;
|
||||||
|
|
||||||
|
const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater_or_equal
|
||||||
|
| isp_tsp_instruction_word::culling_mode::no_culling;
|
||||||
|
|
||||||
|
const uint32_t tsp_instruction_word = tsp_instruction_word::texture_shading_instruction::modulate_alpha
|
||||||
|
| tsp_instruction_word::src_alpha_instr::src_alpha
|
||||||
|
| tsp_instruction_word::fog_control::no_fog
|
||||||
|
| tsp_instruction_word::use_alpha
|
||||||
|
| texture_size;
|
||||||
|
|
||||||
|
const uint32_t texture_address = texture_memory_alloc.texture.start + texture_offset;
|
||||||
|
const uint32_t texture_control_word = pixel_format
|
||||||
|
| texture_control_word::scan_order::twiddled
|
||||||
|
| texture_control_word::texture_address(texture_address / 8);
|
||||||
|
|
||||||
|
writer.append<ta_global_parameter::polygon_type_0>() =
|
||||||
|
ta_global_parameter::polygon_type_0(parameter_control_word,
|
||||||
|
isp_tsp_instruction_word,
|
||||||
|
tsp_instruction_word,
|
||||||
|
texture_control_word,
|
||||||
|
0, // data_size_for_sort_dma
|
||||||
|
0 // next_address_for_sort_dma
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void global_polygon_intensity(ta_parameter_writer& writer,
|
static inline void global_polygon_intensity(ta_parameter_writer& writer,
|
||||||
uint32_t list_type,
|
uint32_t list_type,
|
||||||
uint32_t texture_offset,
|
uint32_t texture_offset,
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#include "cover/thebeach.data.h"
|
#include "cover/thebeach.data.h"
|
||||||
#include "cover/tree.data.h"
|
#include "cover/tree.data.h"
|
||||||
#include "cover/moonmountains.data.h"
|
#include "cover/moonmountains.data.h"
|
||||||
|
#include "cover/redtreefull.data.h"
|
||||||
|
#include "cover/silvertreesfull.data.h"
|
||||||
|
|
||||||
#include "printf/printf.h"
|
#include "printf/printf.h"
|
||||||
|
|
||||||
@ -94,6 +96,16 @@ namespace texture {
|
|||||||
.size = reinterpret_cast<int>(&_binary_cover_moonmountains_data_size),
|
.size = reinterpret_cast<int>(&_binary_cover_moonmountains_data_size),
|
||||||
.offset = offset::moonmountains,
|
.offset = offset::moonmountains,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.start = reinterpret_cast<void *>(&_binary_cover_redtreefull_data_start),
|
||||||
|
.size = reinterpret_cast<int>(&_binary_cover_redtreefull_data_size),
|
||||||
|
.offset = offset::redtreefull,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.start = reinterpret_cast<void *>(&_binary_cover_silvertreesfull_data_start),
|
||||||
|
.size = reinterpret_cast<int>(&_binary_cover_silvertreesfull_data_size),
|
||||||
|
.offset = offset::silvertreesfull,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const int textures_length = (sizeof (textures)) / (sizeof (textures[0]));
|
const int textures_length = (sizeof (textures)) / (sizeof (textures[0]));
|
||||||
|
@ -21,6 +21,8 @@ namespace texture {
|
|||||||
constexpr int thebeach = silvertrees + 32768;
|
constexpr int thebeach = silvertrees + 32768;
|
||||||
constexpr int tree = thebeach + 32768;
|
constexpr int tree = thebeach + 32768;
|
||||||
constexpr int moonmountains= tree + 32768;
|
constexpr int moonmountains= tree + 32768;
|
||||||
|
constexpr int redtreefull = moonmountains+ 32768;
|
||||||
|
constexpr int silvertreesfull = redtreefull+ 524288;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct texture textures[];
|
extern struct texture textures[];
|
||||||
|
@ -22,7 +22,9 @@ TEXTURE_OBJ = \
|
|||||||
cover/silvertrees.data.o \
|
cover/silvertrees.data.o \
|
||||||
cover/thebeach.data.o \
|
cover/thebeach.data.o \
|
||||||
cover/tree.data.o \
|
cover/tree.data.o \
|
||||||
cover/moonmountains.data.o
|
cover/moonmountains.data.o \
|
||||||
|
cover/redtreefull.data.o \
|
||||||
|
cover/silvertreesfull.data.o
|
||||||
|
|
||||||
PCM_OBJ = \
|
PCM_OBJ = \
|
||||||
pcm/start3.adpcm.o \
|
pcm/start3.adpcm.o \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user