Browse Source

add default palette config

pull/3/head
Andy Newjack 5 years ago
parent
commit
021b862081
  1. 67
      src/character/character.rs

67
src/character/character.rs

@ -5,6 +5,66 @@ use psopacket::PSOPacketData;
use crate::{PSOPacketData, PacketParseError}; use crate::{PSOPacketData, PacketParseError};
//use crate::PSOPacketData; //use crate::PSOPacketData;
const DEFAULT_PALETTE_CONFIG: [u8; 0xE8] = [
0, 0, 0, 0,
1, 0, 0, 0,
2, 0, 1, 0,
2, 1, 1, 0,
4, 0, 1, 0,
0, 0, 1, 0,
0, 0, 1, 0,
0, 0, 1, 0,
0, 0, 1, 0,
0, 0, 1, 0,
0, 0, 1, 0,
0, 0, 1, 0,
0, 0, 1, 0,
0, 0, 1, 0,
0, 0, 1, 0,
1, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0
];
#[repr(u32)] #[repr(u32)]
#[derive(Copy, Clone, Hash, PartialEq, Eq)] #[derive(Copy, Clone, Hash, PartialEq, Eq)]
@ -136,7 +196,9 @@ impl Character {
impl std::default::Default for Character { impl std::default::Default for Character {
fn default() -> Character { fn default() -> Character {
Character::from_bytes(&mut std::io::Cursor::new([0; 0x190].to_vec())).unwrap()
let mut c = Character::from_bytes(&mut std::io::Cursor::new([0; 0x190].to_vec())).unwrap();
c.config = DEFAULT_PALETTE_CONFIG;
c
} }
} }
@ -313,11 +375,10 @@ pub struct FullCharacter {
pub section_id: u8, pub section_id: u8,
pub char_class: u8, pub char_class: u8,
pub _unknown2: u32, pub _unknown2: u32,
pub symbol_chats: [u8; 1248],
pub symbol_chats: [u8; 0x4E0],
pub shortcuts: [u8; 2624], pub shortcuts: [u8; 2624],
pub autoreply: [u16; 172], pub autoreply: [u16; 172],
pub info_board: [u16; 172], pub info_board: [u16; 172],
pub _unknown3: [u8; 28],
pub challenge_data: [u8; 320], pub challenge_data: [u8; 320],
pub tech_menu: [u8; 40], pub tech_menu: [u8; 40],
pub _unknown4: [u8; 44], pub _unknown4: [u8; 44],

Loading…
Cancel
Save