Git Product home page Git Product logo

stormjs's People

Contributors

fallenoak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

stormjs's Issues

Add integration tests

Let's define integration tests as: tests utilizing StormJS a la a consumer. We should include an MPQ with a few small files inside to use with these tests.

Feature: open and close files

This ticket will track adding an API to open and close files contained in an MPQ. This will not cover finding or reading files.

The following StormLib APIs will need wrappers added to EmStormLib:

  • SFileOpenFileEx
  • SFileCloseFile

File write

Is it possible to write file to mpq or edit an existing one? Or would I need to edit EmStormLib.cpp to add the binding?

Integrate Travis

This will take some effort, since we'll need a way to get Emscripten installed.

Refactor: Clean up pointer utilities

  • Binding: make EmPtr a simple base class and export as Ptr
  • Binding: subclass EmVoidPtr from EmPtr and export as VoidPtr
  • Binding: subclass EmUint32Ptr from EmPtr and export as Uint32Ptr
  • StormLib: Add NULLPTR export (a Ptr instance set to nullptr)

Bug: MPQs > 2GB fail to load

This appears to be two issues:

Incorrect llseek behavior when seeking >= 2 ** 31

These lines in the emscripten FS layer do not play well with offsets beyond 2 ** 31 bytes.

var stream = SYSCALLS.getStreamFromFD(), offset_high = SYSCALLS.get(), offset_low = SYSCALLS.get(), result = SYSCALLS.get(), whence = SYSCALLS.get();
// NOTE: offset_high is unused - Emscripten's off_t is 32-bit
var offset = offset_low;
FS.llseek(stream, offset, whence);

offset_low is read as a signed integer out of HEAP32 by SYSCALLS.get(). As a result, the value wraps after exceeding 2,147,483,647 bytes, even though it's not surprising to seek past that limit when working with large files.

Runtime assert intersecting with incompatible types

This line in SBaseFileTable.cpp fails, despite the values matching:

assert(pHeader->BlockTableSize64 <= (pHeader->dwBlockTableSize * sizeof(TMPQBlock)));

Presumably, some combination of the types of pHeader->BlockTableSize64, pHeader->dwBlockTableSize, and sizeof(TMPQBlock) prevent the assert's equality comparison from returning true.

Feature: read files

StormJS isn't terribly useful without the ability to read files out of an MPQ.

The following StormLib APIs will need wrappers added to EmStormLib:

  • SFileGetFileSize
  • SFileReadFile
  • SFileSetFilePointer

Depends on #5

Feature: get file name from open file

Given an instance of File, we should be able to retrieve the file name by accessing a name getter.

Similar to EmBuf, we'll probably want to add a EmStr that's capable of receiving C-strings and marshaling them to JS.

The following StormLib APIs will need wrappers added to EmStormLib:

  • SFileGetFileName

Feature: MPQ patching

In order to support opening a merged view of the 12340 client MPQs, we need to support StormLib's patching function.

The following StormLib APIs will need wrappers added to EmStormLib:

  • SFileOpenPatchArchive

Investigate performance benchmarking

Since StormJS APIs will be heavily utilized by the pipeline server, we should explore some options for benchmarking the performance of the library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.