Code Monkey home page Code Monkey logo

Comments (7)

Quaker762 avatar Quaker762 commented on July 30, 2024

I think this might have something to do with weird string null-terminators. I'm being told I can't open a handle to a section due to this..

from sh3redux.

Quaker762 avatar Quaker762 commented on July 30, 2024

So it would seem that loading everything from arc.arc is accurate (as seen in attached log.txt). Therefore this MUST have something to do with actually finding the file in the map, but I can't see anything wrong with the code for it..??

Also note that it complains of multiple files of the same name.
log.txt

from sh3redux.

Quaker762 avatar Quaker762 commented on July 30, 2024

More strange behaviour, attempting to print out keys and indexes results in this each step. I'm surprised it loads anything when I put a different file name in, this is super weird.

EDIT: Okay, I've done a bit more probing, and it seems like there's an error with c_sections. Stepping through after a call to section.Load() returns a map with the keys all the same.

EDIT EDIT: Okay, there is a serious problem here. The map seems to fuck itself right after the for loop where we map the file name to it's index (section.cpp, line 66-77). When I try to search for the file in the map right after it is inserted, it can't find it. This couldn't possibly be a bug in the c++ runtime, could it??

from sh3redux.

z33ky avatar z33ky commented on July 30, 2024

More strange behaviour, attempting to print out keys and indexes results in this each step. I'm surprised it loads anything when I put a different file name in, this is super weird.

You're not iterating over the map here, since you don't increment it.
Try

for(auto i : candidate.fileList)
{
    std::printf("Path: %s, index: %d\n", i.first.c_str(), i.second);
}

While I'm also getting warnings about duplicates, at least the file "data/eff_tex/fire00_tr.pic" is correctly detected to be in section "tex" and "data/tmp/us11.map" to be in section "bgus". Which file are you trying to load that is mapped to the wrong section?
I'm looking further into the duplicate warnings ATM.

from sh3redux.

Quaker762 avatar Quaker762 commented on July 30, 2024

You're not iterating over the map here, since you don't increment it.

Lol, I just realised that when I opened the project again after a few drinks.. Alcohol goes in and code comes out I guess..

Which file are you trying to load that is mapped to the wrong section?

Most files. They end up dumping _CATALOG.VIX for some reason, I'm not sure. That or they fail to open at all and just silently fail (returning ARC_FILE_NOT_FOUND).

It would seem that LoadFile() isn't detecting files in the map correctly. I'm not too up to date with STL stuff like iterators, so I'm not too sure if there are any issues.

from sh3redux.

z33ky avatar z33ky commented on July 30, 2024

#69 with the following patch does the right thing for me, i.e. first opens "tex.arc" and then "bgus.arc":

diff --git a/source/main.cpp b/source/main.cpp
index 9be0896..e23c033 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -71,11 +71,12 @@ int main(int argc, char** argv)
     std::printf("%f\n", static_cast<double>(ret.y));
 
 //    sh3_config config;
-//    sh3_arc arc;
+    sh3_arc arc;
 //
 //    arc.Load();
-//    std::vector<uint8_t> data;
-//    arc.LoadFile("data/eff_tex/fire00_tr.pic", data);
+    std::vector<uint8_t> data;
+    arc.LoadFile("data/eff_tex/fire00_tr.pic", data);
+    arc.LoadFile("data/tmp/us11.map", data);
 //
 //    sh3_window* window = new sh3_window(640, 480, "SILENT HILL 3");

from sh3redux.

Quaker762 avatar Quaker762 commented on July 30, 2024

Those two files seem to work. Try opening data/bg/hu/hu22.kg2 and check the output. It loads _CATALOG.VIX for some reason.

from sh3redux.

Related Issues (20)

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.