Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions examples/03_objects/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ int main()
t3d_matrix_pop(1);

// ======== Draw (2D) ======== //
rdpq_sync_pipe();

int totalTris = 0;
for(int i=0; i<actorCount; ++i) {
totalTris += triangleCount[(i*3) % 2];
Expand Down
1 change: 0 additions & 1 deletion examples/04_dynamic/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ int main()
t3d_matrix_pop(1);

// ======== Draw (2D) ======== //
rdpq_sync_pipe();
rdpq_text_printf(NULL, FONT_BUILTIN_DEBUG_MONO, 16.0f, 20.0f, "[A] Scroll: %c\n", scrollEnabled ? 'Y' : '-');
rdpq_text_printf(NULL, FONT_BUILTIN_DEBUG_MONO, 16.0f, 32.0f, "[B] Transf: %c\n", transformEnabled ? 'Y' : '-');
rdpq_text_printf(NULL, FONT_BUILTIN_DEBUG_MONO, 220.0f, 20.0f, "FPS: %.4f\n", display_get_fps());
Expand Down
3 changes: 1 addition & 2 deletions examples/05_splitscreen/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ int main()
}

// ======== Draw (2D) ======== //
rdpq_sync_pipe();
rdpq_set_scissor(0, 0, sizeX, sizeY);
rdpq_set_mode_standard();
rdpq_set_mode_fill(RGBA32(0, 0, 0, 0xFF));
Expand All @@ -190,7 +189,7 @@ int main()
// minimap
rdpq_set_mode_standard();
rdpq_mode_alphacompare(128);
rdpq_sync_load();

rdpq_sprite_blit(spriteMinimap,
display_get_width()/2 - 29,
display_get_height()/2 - 29,
Expand Down
2 changes: 0 additions & 2 deletions examples/06_offscreen/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ void dynamic_tex_cb(void* userData, const T3DMaterial* material, rdpq_texparms_t
if(tile != TILE0)return; // this callback can happen 2 times per mesh, you are allowed to skip calls

surface_t *offscreenSurf = (surface_t*)userData;
rdpq_sync_tile();

int sHalf = OFFSCREEN_SIZE / 2;
int sFull = OFFSCREEN_SIZE;
Expand Down Expand Up @@ -166,7 +165,6 @@ int main()
rspq_block_run(dplBox);
t3d_matrix_pop(1);

rdpq_sync_pipe();
rdpq_text_printf(NULL, FONT_BUILTIN_DEBUG_MONO, 16, 14, "%.1f FPS\n", display_get_fps());
}

Expand Down
1 change: 0 additions & 1 deletion examples/07_skeleton/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ int main()
t3d_matrix_pop(1);

// ======== Draw (UI) ======== //
rdpq_sync_pipe();

// Bone View
float posX = 12;
Expand Down
1 change: 0 additions & 1 deletion examples/08_animation/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ int main()
float posX = 16;
float posY = 24;

rdpq_sync_pipe();
rdpq_text_printf(NULL, FONT_BUILTIN_DEBUG_MONO, posX, posY, "[A] Attack: %d", isAttack);

posY = 216;
Expand Down
1 change: 0 additions & 1 deletion examples/09_anim_viewer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ int main()
float posX = 16;
float posY = 20;

rdpq_sync_pipe();
rdpq_text_printf(NULL, FONT_BUILTIN_DEBUG_MONO, posX, posY, STYLE(STYLE_TITLE) "[L/R] Model: %d/%d", modelIdx+1, MODEL_COUNT);
posY += 10;
rdpq_text_printf(NULL, FONT_BUILTIN_DEBUG_MONO, posX, posY, STYLE(STYLE_TITLE) "[C] Animations:");
Expand Down
1 change: 0 additions & 1 deletion examples/10_flipbook_tex/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ void dynamic_tex_cb(void* userData, const T3DMaterial* material, rdpq_texparms_t
// 'userData' is a value you can pass into 't3d_model_draw_custom', this can be any value or struct you want...
surface_t* surface = (surface_t*)userData; // ...in this case it is a surface pointer

rdpq_sync_tile();
rdpq_mode_tlut(TLUT_NONE);
rdpq_tex_upload(TILE0, surface, NULL);
}
Expand Down
1 change: 0 additions & 1 deletion examples/12_uv_gen/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ int main()
t3d_matrix_pop(1);

// ======== 2D ======== //
rdpq_sync_pipe();

rdpq_textparms_t texParam = {
.width = display_get_width(),
Expand Down
2 changes: 0 additions & 2 deletions examples/13_cel_shading/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ int main()
t3d_matrix_pop(1);

// ======== 2D ======== //
rdpq_sync_pipe();

rdpq_textparms_t texParam = {
.width = display_get_width(),
.align = ALIGN_CENTER,
Expand Down
2 changes: 0 additions & 2 deletions examples/14_outline/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ int main()
{
rspq_block_begin();

rdpq_sync_pipe();
rdpq_sync_tile();
rdpq_set_mode_standard();
rdpq_mode_combiner(RDPQ_COMBINER1((0,0,0,PRIM), (PRIM,0,TEX0,0)));
rdpq_mode_blender(RDPQ_BLENDER_MULTIPLY);
Expand Down
5 changes: 0 additions & 5 deletions examples/15_pointlight/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ int main()
height = fminf(1.0f, fmaxf(0.0f, height));
height = (height*height) * -74.0f;

rdpq_sync_pipe();
rdpq_sync_tile();

rdpq_textparms_t txtParam = {.align = ALIGN_CENTER, .width = 320, .wrap = WRAP_WORD};
rdpq_text_printf(&txtParam, FONT_BUILTIN_DEBUG_MONO, 0, 240 - height - 64, "L/R - Change Light");
rdpq_text_printf(&txtParam, FONT_BUILTIN_DEBUG_MONO, 0, 240 - height - 48, "C - Height / Strength");
Expand All @@ -266,8 +263,6 @@ int main()
}

if(joypad.btn.a) {
rdpq_sync_pipe();
rdpq_sync_tile();
rdpq_text_printf(NULL, FONT_BUILTIN_DEBUG_MONO, 20, 240-20, "FPS: %.2f", display_get_fps());
}

Expand Down
2 changes: 0 additions & 2 deletions examples/16_light_clip/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ int main()
t3d_matrix_pop(1);

// ----------- DRAW (2D) ------------ //
rdpq_sync_pipe();
rdpq_sync_tile();
const char* MODES[] = {"Reveal", "Cutout", "Mixed", "Light"};
const char* DITHER[] = {"None", "Square", "Noise"};

Expand Down
2 changes: 0 additions & 2 deletions examples/18_particles/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ int main()
//
// In our case, we want to combine it with env. color in the CC.
// In order to have depth, you also need to enable `rdpq_mode_zoverride` so the ucode can set this correctly.
rdpq_sync_pipe();
rdpq_sync_tile();
rdpq_set_mode_standard();
rdpq_mode_zbuf(true, true);
rdpq_mode_zoverride(true, 0, 0);
Expand Down
3 changes: 0 additions & 3 deletions examples/19_particles_tex/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@ int main()
}

// ======== Draw (Particles) ======== //
rdpq_sync_pipe();
rdpq_sync_tile();
rdpq_sync_load();
rdpq_set_mode_standard();
rdpq_mode_antialias(AA_NONE);
rdpq_mode_zbuf(true, true);
Expand Down
2 changes: 0 additions & 2 deletions examples/20_mipmaps/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ int main()
t3d_matrix_pop(1);

// ======== 2D ======== //
rdpq_sync_pipe();
rdpq_sync_tile();
rdpq_set_mode_standard();

// clear coverage + backdrop for text
Expand Down
1 change: 0 additions & 1 deletion examples/21_fresnel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ int main()
t3d_matrix_pop(1);

// ======== 2D ======== //
rdpq_sync_pipe();
rdpq_set_mode_standard();

// clear coverage + backdrop for text
Expand Down
4 changes: 0 additions & 4 deletions examples/22_bigtex/src/render/debugDraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ void Debug::init() {
font = sprite_load("rom:/font.ia4.sprite");

rspq_block_begin();
rdpq_sync_pipe();
rdpq_sync_tile();
rdpq_sync_load();

rdpq_mode_begin();
rdpq_mode_blender(0);
rdpq_mode_persp(false);
Expand Down
2 changes: 0 additions & 2 deletions examples/22_bigtex/src/render/hdModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ HDModel::HDModel(const std::string &t3dmPath, Textures& textures) {
dplDraw = rspq_block_end();

rspq_block_begin();
rdpq_sync_pipe();
rdpq_mode_combiner(RDPQ_COMBINER1((1, SHADE, PRIM, 0), (0,0,0,1)));
rdpq_mode_blender(0);
rdpq_mode_alphacompare(0);
Expand All @@ -103,7 +102,6 @@ HDModel::HDModel(const std::string &t3dmPath, Textures& textures) {
int noDepth = obj->material->name[0] == '_' ? 1 : 0;
if(noDepth != lastNoDepth)
{
rdpq_sync_pipe();
if(noDepth) {
rdpq_change_other_modes_raw(SOM_ZMODE_MASK | SOM_Z_COMPARE | SOM_Z_WRITE, 0);
} else {
Expand Down
4 changes: 0 additions & 4 deletions examples/22_bigtex/src/scene/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ void Scene::draw(const Memory::FrameBuffers &buffers, surface_t *surf)
skybox.draw();
if(state.drawMap)mapModel.draw();

rdpq_sync_pipe();
rdpq_mode_zbuf(false, false);

// Second draw, if shading is enabled, this will draw the lighting + vertex colors into a different buffer
Expand All @@ -105,13 +104,10 @@ void Scene::draw(const Memory::FrameBuffers &buffers, surface_t *surf)
rdpq_fill_rectangle(0,0, SCREEN_WIDTH, SCREEN_HEIGHT);
rdpq_mode_pop();
mapModel.drawShade();
rdpq_sync_pipe();
}

t3d_matrix_pop(1);

rdpq_sync_tile();
rdpq_sync_load();
rdpq_set_color_image(surf);
rdpq_set_mode_standard();

Expand Down
14 changes: 5 additions & 9 deletions examples/23_hdr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ int main()
rspq_block_begin();
t3d_matrix_set(modelMatFP, true);

rdpq_sync_pipe();
rdpq_mode_antialias(AA_STANDARD);

// then all objects with depth
Expand Down Expand Up @@ -248,23 +247,20 @@ int main()

t3d_light_set_exposure(exposure);
t3d_matrix_push(t3d_segment_address(1, rotMatFP));
rdpq_sync_pipe();

skydome_set_viewport(sky, &viewport);
skydome_cloud_pass(sky, display_get_delta_time() * 1000); // move the clouds with time
rdpq_sync_pipe();

// Draw sky without any depth first
rdpq_mode_zbuf(false, false);
rdpq_mode_antialias(AA_NONE);
rdpq_sync_pipe();

skydome_draw(sky); // draw the main halfsphere first with no zbuf
rdpq_sync_pipe();

t3d_light_set_ambient(colorAmbient);
t3d_light_set_count(0);
rdpq_sync_pipe();

rspq_block_run(model->userBlock);
rdpq_sync_pipe();
rdpq_sync_tile();
rdpq_sync_load();
//rdpq_text_printf(NULL, 1, 240, 210, "%llu", TICKS_TO_US(ticks));
//rdpq_text_printf(NULL, 1, 260, 220, "%.2f", display_get_fps());

Expand Down
6 changes: 2 additions & 4 deletions examples/23_hdr/skydome.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void skydome_draw(skydome_t* skydome){

rdpq_set_blend_color(skydome->color.clouds);
rdpq_set_fog_color(skydome->color.fog);
rdpq_sync_pipe();

if(!skydome->__vars.modelblock) {
rspq_block_begin();
rdpq_mode_mipmap(MIPMAP_NONE, 0);
Expand All @@ -180,15 +180,13 @@ void skydome_draw(skydome_t* skydome){

rdpq_mode_antialias(AA_NONE);
rdpq_mode_zbuf(false,false);
rdpq_sync_pipe();

t3d_model_draw_object(obj, NULL);
rdpq_sync_pipe();
skydome->__vars.modelblock = rspq_block_end();
}

// for the actual draw, you can use the generic rspq-api.
rspq_block_run(skydome->__vars.modelblock);
rdpq_sync_pipe();
t3d_frame_start();
}

Expand Down
2 changes: 0 additions & 2 deletions examples/24_hdr_bloom/src/actors/pointGlobe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ namespace Actor
ptTex = sprite_load("rom:/spheres.i8.sprite");

rspq_block_begin();
rdpq_sync_pipe();
rdpq_sync_tile();

rdpq_mode_combiner(RDPQ_COMBINER1((PRIM,0,TEX0,0), (0,0,0,TEX0)));
rdpq_mode_zbuf(true, true);
Expand Down
4 changes: 0 additions & 4 deletions examples/24_hdr_bloom/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,11 @@ int main()
postProc[frameIdx].endFrame();
auto surfBlur = postProc[frameIdxLast].applyEffects(*fb);

rdpq_sync_pipe();
rdpq_set_color_image(fb);

// Debug: show last offscreen buffer (downscaled and/or blur)
if(state.showOffscreen)
{
rdpq_sync_tile();
rdpq_sync_load();

rdpq_set_mode_standard();
rdpq_mode_combiner(RDPQ_COMBINER_TEX);
rdpq_mode_blender(0);
Expand Down
2 changes: 0 additions & 2 deletions examples/24_hdr_bloom/src/postProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ void PostProcess::endFrame()
if(!blockRDPScale)
{
rspq_block_begin();
rdpq_sync_pipe();
rdpq_sync_load();
rdpq_set_mode_standard();

rdpq_mode_begin();
Expand Down
4 changes: 0 additions & 4 deletions examples/24_hdr_bloom/src/render/debugDraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ void Debug::init() {
font = sprite_load("rom:/font.ia4.sprite");

rspq_block_begin();
rdpq_sync_pipe();
rdpq_sync_tile();
rdpq_sync_load();

rdpq_mode_begin();
rdpq_set_mode_standard();
rdpq_mode_blender(0);
Expand Down
2 changes: 0 additions & 2 deletions examples/24_hdr_bloom/src/scene/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ void Scene::draw(float deltaTime)
t3d_matrix_pop(1);

// particles
rdpq_sync_pipe();

rdpq_mode_begin();
rdpq_mode_zbuf(true, true);
rdpq_mode_zoverride(true, 0, 0);
Expand Down
1 change: 0 additions & 1 deletion examples/24_hdr_bloom/src/scene/scenes/sceneMagic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ void SceneMagic::draw3D(float deltaTime)
rspq_block_run(objSky->userBlock);

// Main map mesh
rdpq_sync_pipe();
rdpq_mode_zbuf(true, true);

t3d_matrix_set(mapMatFP, true);
Expand Down
1 change: 0 additions & 1 deletion examples/24_hdr_bloom/src/scene/scenes/scenePixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ void ScenePixel::draw3D(float deltaTime)
rspq_block_run(objSky->userBlock);

// Main map mesh
rdpq_sync_pipe();
rdpq_mode_zbuf(true, true);
rdpq_set_prim_color({0xFF, 0xFF, 0xFF, 0xFF});
rdpq_set_env_color({0xFF, 0xFF, 0xFF, (uint8_t)(doCutout ? 0x00 : 0x70)});
Expand Down
7 changes: 1 addition & 6 deletions examples/99_testscene/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ int main()
{
profile_data.frame_count = 0;

// @TODO: game random slows down under different code.
// investigate what part of the shifting code/data is causing this
#if RSPQ_PROFILE == 1
debug_init_isviewer();
debug_init_usblog();
#endif
debug_init_isviewer();

asset_init_compression(2);

Expand Down
Loading
Loading