Skip to content

Commit

Permalink
refactor: replace repeated reading using times with array binaryio me…
Browse files Browse the repository at this point in the history
…thods
  • Loading branch information
meszaros-lajos-gyorgy committed Dec 19, 2024
1 parent 29ccb98 commit 6730035
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/fts/Polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ export class Polygon {
textureContainerId: binary.readInt32(),
norm: binary.readVector3(),
norm2: binary.readVector3(),
normals: times(() => {
return binary.readVector3()
}, 4) as QuadrupleOf<ArxVector3>,
normals: binary.readVector3Array(4) as QuadrupleOf<ArxVector3>,
transval: binary.readFloat32(),
area: binary.readFloat32(),
flags: binary.readInt32(),
Expand Down
4 changes: 1 addition & 3 deletions src/fts/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export class Room {
const { numberOfPortals, numberOfPolygons } = RoomData.readFrom(binary)

return {
portals: times(() => {
return binary.readInt32()
}, numberOfPortals),
portals: binary.readInt32Array(numberOfPortals),
polygons: times(() => {
return EPData.readFrom(binary)
}, numberOfPolygons),
Expand Down

0 comments on commit 6730035

Please sign in to comment.