mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 16:34:23 -05:00
Bytereader working. May not need Bitreader anymore, but it's already in use by D2Item, so we'll leave it.
This commit is contained in:
@@ -56,7 +56,6 @@ class D2BitReader {
|
||||
|
||||
public function getBit(string $bitNum): int {
|
||||
if ($bitNum < 0 || $bitNum > strlen($this->bits)) {
|
||||
|
||||
return false;
|
||||
}
|
||||
return ((int) $this->bits[$bitNum] ? 1 : 0 );
|
||||
|
@@ -191,6 +191,8 @@ class D2Char {
|
||||
fseek($this->fp, $this->sData->wpOffsetsNorm + 4);
|
||||
$a5 = strrev(strtobits(fread($this->fp, 1)));
|
||||
$wp['Norm'] = str_split($a1 . $a2 . $a3 . $a4 . $a5);
|
||||
|
||||
ddump($wp['Norm']);
|
||||
|
||||
fseek($this->fp, $this->sData->wpOffsetsNM);
|
||||
$a1 = strrev(strtobits(fread($this->fp, 1)));
|
||||
|
@@ -85,7 +85,7 @@ function setBit(int $n, int $p, bool $b){
|
||||
}
|
||||
|
||||
function getBit(int $b, int $p){
|
||||
return intval(($b & (1 << $p)) != 0);
|
||||
return intval(($b & (1 << $p)) !== 0);
|
||||
}
|
||||
|
||||
function checksum($fileData) {
|
||||
|
Reference in New Issue
Block a user