Skip to content

Commit

Permalink
Rename deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Jun 2, 2023
1 parent d907787 commit fd1dc91
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions examples/rdpqdemo/rdpqdemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ int main()
// render mode, and then restore it at the end.
rdpq_mode_push();
rdpq_mode_tlut(TLUT_RGBA16);
rdpq_tex_load_tlut(sprite_get_palette(tiles_sprite), 0, 16);
rdpq_tex_upload_tlut(sprite_get_palette(tiles_sprite), 0, 16);
tlut = true;
}
uint32_t tile_width = tiles_sprite->width / tiles_sprite->hslices;
Expand All @@ -164,7 +164,7 @@ int main()
// Notice that this code is agnostic to both the texture format
// and the render mode (standard vs copy), it will work either way.
int s = RANDN(2)*32, t = RANDN(2)*32;
rdpq_tex_load_sub(TILE0, &tiles_surf, NULL, s, t, s+32, t+32);
rdpq_tex_upload_sub(TILE0, &tiles_surf, NULL, s, t, s+32, t+32);
rdpq_texture_rectangle(TILE0, tx, ty, tx+32, ty+32, s, t);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/rdpq/rdpq_font.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static rdpq_tile_t atlas_activate(atlas_t *atlas)
if (draw_ctx.last_atlas != atlas) {
draw_ctx.atlas_tile = (draw_ctx.atlas_tile + 2) & 7;
surface_t s = surface_make_linear(atlas->buf, atlas->fmt, atlas->width, atlas->height);
rdpq_tex_load(draw_ctx.atlas_tile, &s, NULL);
rdpq_tex_upload(draw_ctx.atlas_tile, &s, NULL);
draw_ctx.last_atlas = atlas;
}
return draw_ctx.atlas_tile;
Expand Down
12 changes: 6 additions & 6 deletions tests/test_rdpq.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ void test_rdpq_syncfull_resume(TestContext *ctx)
debugf("Dynamic mode\n");
for (int j=0;j<4;j++) {
for (int i=0;i<80;i++) {
rdpq_tex_load_sub(TILE0, &tex, NULL, 0, 0, WIDTH, WIDTH);
rdpq_tex_upload_sub(TILE0, &tex, NULL, 0, 0, WIDTH, WIDTH);
rdpq_texture_rectangle(TILE0, 0, 0, WIDTH, WIDTH, 0, 0);
}
rdpq_sync_full(NULL, NULL);
Expand All @@ -815,7 +815,7 @@ void test_rdpq_syncfull_resume(TestContext *ctx)
debugf("Dynamic mode with multiple syncs per buffer\n");
for (int j=0;j<4;j++) {
for (int i=0;i<6;i++) {
rdpq_tex_load_sub(TILE0, &tex, NULL, 0, 0, WIDTH, WIDTH);
rdpq_tex_upload_sub(TILE0, &tex, NULL, 0, 0, WIDTH, WIDTH);
rdpq_texture_rectangle(TILE0, 0, 0, WIDTH, WIDTH, 0, 0);
}
rdpq_sync_full(NULL, NULL);
Expand All @@ -829,7 +829,7 @@ void test_rdpq_syncfull_resume(TestContext *ctx)
debugf("Dynamic mode with buffer change\n");
for (int j=0;j<4;j++) {
for (int i=0;i<80;i++) {
rdpq_tex_load_sub(TILE0, &tex, NULL, 0, 0, WIDTH, WIDTH);
rdpq_tex_upload_sub(TILE0, &tex, NULL, 0, 0, WIDTH, WIDTH);
rdpq_texture_rectangle(TILE0, 0, 0, WIDTH, WIDTH, 0, 0);
}
rdpq_sync_full(NULL, NULL);
Expand All @@ -841,7 +841,7 @@ void test_rdpq_syncfull_resume(TestContext *ctx)
debugf("Block mode\n");
rspq_block_begin();
for (int i=0;i<80;i++) {
rdpq_tex_load_sub(TILE0, &tex, NULL, 0, 0, WIDTH, WIDTH);
rdpq_tex_upload_sub(TILE0, &tex, NULL, 0, 0, WIDTH, WIDTH);
rdpq_texture_rectangle(TILE0, 0, 0, WIDTH, WIDTH, 0, 0);
}
rspq_block_t *rect_block = rspq_block_end();
Expand All @@ -858,7 +858,7 @@ void test_rdpq_syncfull_resume(TestContext *ctx)
debugf("Block mode with sync inside\n");
rspq_block_begin();
for (int i=0;i<80;i++) {
rdpq_tex_load_sub(TILE0, &tex, NULL, 0, 0, WIDTH, WIDTH);
rdpq_tex_upload_sub(TILE0, &tex, NULL, 0, 0, WIDTH, WIDTH);
rdpq_texture_rectangle(TILE0, 0, 0, WIDTH, WIDTH, 0, 0);
}
rdpq_sync_full(NULL, NULL);
Expand Down Expand Up @@ -1229,7 +1229,7 @@ void test_rdpq_blender_memory(TestContext *ctx) {

rdpq_set_fog_color(RGBA32(0,0,0,0x80));
rdpq_set_color_image(&fb);
rdpq_tex_load(TILE0, &tex, NULL);
rdpq_tex_upload(TILE0, &tex, NULL);
rdpq_set_mode_standard();
rdpq_mode_blender(RDPQ_BLENDER_MULTIPLY);
rdpq_triangle(&TRIFMT_TEX,
Expand Down
12 changes: 6 additions & 6 deletions tests/test_rdpq_tex.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static color_t surface_debug_expected_color(surface_t *surf, int x, int y)
}
}

void test_rdpq_tex_load(TestContext *ctx) {
void test_rdpq_tex_upload(TestContext *ctx) {
RDPQ_INIT();

static const tex_format_t fmts[] = {
Expand Down Expand Up @@ -153,7 +153,7 @@ void test_rdpq_tex_load(TestContext *ctx) {

// Activate the palette if needed for this format
if (fmt == FMT_CI4 || fmt == FMT_CI8) {
rdpq_tex_load_tlut(tlut, 0, 256);
rdpq_tex_upload_tlut(tlut, 0, 256);
rdpq_mode_tlut(TLUT_RGBA16);
} else {
rdpq_mode_tlut(TLUT_NONE);
Expand All @@ -170,9 +170,9 @@ void test_rdpq_tex_load(TestContext *ctx) {
surface_clear(&fb, 0);

if (off == 0)
rdpq_tex_load(TILE2,&surf, NULL);
rdpq_tex_upload(TILE2,&surf, NULL);
else
rdpq_tex_load_sub(TILE2,&surf, NULL, off, off, surf.width, surf.width);
rdpq_tex_upload_sub(TILE2,&surf, NULL, off, off, surf.width, surf.width);
rdpq_texture_rectangle(TILE2,
5, 5, 5+surf.width-off, 5+surf.width-off,
off, off);
Expand All @@ -196,7 +196,7 @@ void test_rdpq_tex_load(TestContext *ctx) {
}
}

void test_rdpq_tex_load_multi(TestContext *ctx) {
void test_rdpq_tex_upload_multi(TestContext *ctx) {
RDPQ_INIT();

surface_t tex1 = surface_alloc(FMT_RGBA32, 8, 8);
Expand Down Expand Up @@ -347,7 +347,7 @@ void test_rdpq_tex_blit_normal(TestContext *ctx)

// Activate the palette if needed for this format
if (fmt == FMT_CI4 || fmt == FMT_CI8) {
rdpq_tex_load_tlut(tlut, 0, 256);
rdpq_tex_upload_tlut(tlut, 0, 256);
rdpq_mode_tlut(TLUT_RGBA16);
} else {
rdpq_mode_tlut(TLUT_NONE);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_rdpq_tri.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void test_rdpq_triangle_w1(TestContext *ctx) {
surface_clear(&tex, 0);

rdpq_set_color_image(&fb);
rdpq_tex_load(TILE0, &tex, NULL);
rdpq_tex_upload(TILE0, &tex, NULL);
rdpq_set_mode_standard();
rspq_wait();

Expand Down
4 changes: 2 additions & 2 deletions tests/testrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ static const struct Testsuite
TEST_FUNC(test_rdpq_triangle_w1, 0, TEST_FLAGS_NO_BENCHMARK),
TEST_FUNC(test_rdpq_attach_clear, 0, TEST_FLAGS_NO_BENCHMARK),
TEST_FUNC(test_rdpq_attach_stack, 0, TEST_FLAGS_NO_BENCHMARK),
TEST_FUNC(test_rdpq_tex_load, 0, TEST_FLAGS_NO_BENCHMARK),
TEST_FUNC(test_rdpq_tex_load_multi, 0, TEST_FLAGS_NO_BENCHMARK),
TEST_FUNC(test_rdpq_tex_upload, 0, TEST_FLAGS_NO_BENCHMARK),
TEST_FUNC(test_rdpq_tex_upload_multi, 0, TEST_FLAGS_NO_BENCHMARK),
TEST_FUNC(test_rdpq_tex_blit_normal, 0, TEST_FLAGS_NO_BENCHMARK),
TEST_FUNC(test_mpeg1_idct, 0, TEST_FLAGS_NO_BENCHMARK),
TEST_FUNC(test_mpeg1_block_decode, 0, TEST_FLAGS_NO_BENCHMARK),
Expand Down

0 comments on commit fd1dc91

Please sign in to comment.