Skip to content

Commit 41522de

Browse files
committed
rebase and fix
1 parent 2c8c959 commit 41522de

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

examples/crab-rave/src/main.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use core::f32::consts::PI;
55

66
use psp::{
7-
math::{cosf32, sinf32},
7+
math::{cosf, sinf},
88
sys::{
99
self, ClearBuffer, DepthFunc, DisplayPixelFormat, FrontFaceDirection, GuContextType,
1010
GuPrimitive, GuState, GuSyncBehavior, GuSyncMode, LightComponent, LightType::Pointlight,
@@ -46,7 +46,7 @@ fn psp_main() {
4646
sys::sceKernelChangeCurrentThreadAttr(0, sys::ThreadAttributes::VFPU);
4747
sys::sceKernelDcacheWritebackAll();
4848

49-
let mut allocator = get_vram_allocator().unwrap();
49+
let allocator = get_vram_allocator().unwrap();
5050
let fbp0 = allocator
5151
.alloc_texture_pixels(BUF_WIDTH, SCREEN_HEIGHT, TexturePixelFormat::Psm8888)
5252
.as_mut_ptr_from_zero();
@@ -126,9 +126,9 @@ fn psp_main() {
126126

127127
for i in 0..4 {
128128
let pos = ScePspFVector3 {
129-
x: cosf32(i as f32 * (PI / 2.0) + val as f32 * (PI / 180.0)) * LIGHT_DISTANCE,
129+
x: cosf(i as f32 * (PI / 2.0) + val as f32 * (PI / 180.0)) * LIGHT_DISTANCE,
130130
y: 25.0,
131-
z: (sinf32(i as f32 * (PI / 2.0) + val as f32 * (PI / 180.0)) * LIGHT_DISTANCE),
131+
z: (sinf(i as f32 * (PI / 2.0) + val as f32 * (PI / 180.0)) * LIGHT_DISTANCE),
132132
};
133133
sys::sceGuLight(
134134
i,
@@ -141,11 +141,6 @@ fn psp_main() {
141141
sys::sceGuLightAtt(i, 0.0, 0.66, 0.0);
142142
}
143143

144-
/*sys::sceGuSpecular(1000.0);
145-
sys::sceGuSendCommandf(psp::sys::GeCommand::Light0Diffuse, 0.0);
146-
sys::sceGuSendCommandf(psp::sys::GeCommand::Light1Diffuse, 0.0);
147-
sys::sceGuSendCommandf(psp::sys::GeCommand::Light2Diffuse, 0.0);
148-
sys::sceGuSendCommandf(psp::sys::GeCommand::Light3Diffuse, 0.0);*/
149144
sys::sceGuAmbient(0x0022_2222);
150145

151146
sys::sceGumMatrixMode(MatrixMode::Projection);

0 commit comments

Comments
 (0)