1 #include "xr_d3d_light.h" 2 #include "xr_reader.h" 3 #include "xr_writer.h" 4 5 using namespace xray_re; 6 load(xr_reader & r)7void d3d_light::load(xr_reader& r) 8 { 9 type = r.r_u32(); 10 r.r_fcolor(diffuse); 11 r.r_fcolor(specular); 12 r.r_fcolor(ambient); 13 r.r_fvector3(position); 14 r.r_fvector3(direction); 15 range = r.r_float(); 16 falloff = r.r_float(); 17 attenuation0 = r.r_float(); 18 attenuation1 = r.r_float(); 19 attenuation2 = r.r_float(); 20 theta = r.r_float(); 21 phi = r.r_float(); 22 } 23 save(xr_writer & w) const24void d3d_light::save(xr_writer& w) const 25 { 26 w.w_u32(type); 27 w.w_fcolor(diffuse); 28 w.w_fcolor(specular); 29 w.w_fcolor(ambient); 30 w.w_float(range); 31 w.w_float(falloff); 32 w.w_float(attenuation0); 33 w.w_float(attenuation1); 34 w.w_float(attenuation2); 35 w.w_float(theta); 36 w.w_float(phi); 37 } 38