Giter Club home page Giter Club logo

Comments (7)

janso3 avatar janso3 commented on May 25, 2024

When extracting the length from the token byte, you are bitshifting the value by 3 after masking out the other bits. I think that could be the error.

from sourcehold.

PodeCaradox avatar PodeCaradox commented on May 25, 2024

Hm, i changed it to the following but doesnt work too.
help

Maybe u can write me what are the first 2-3 rows of tokens u get from the anim_armourer.gm1(i cant run ur project on windows i tried it over 2 hours :/),
for me they are newline tokens is the following:
first loop:(the next 24 bytes in the array all 128)
byte:128
tokentype:4

Also can u maybe look up which byte length your array of the first tgx file have, for me it have 760 bytes.
Maybe i got your project running than its easier for me to look up the sizes in the debugger.

I tested the Color output(its maybe wrong too, i need to check if c# handles byte diffrent than c++) and get the following(webside about TGX Color encoding: https://stronghold.fandom.com/wiki/TGX_file_format)
byte: 0b0001_1111_0000_0000(should be pure-blue: 00011111-00000000(1F00) (r0 g0 b255)))
color i get:
r:56
g:24
b:0

byte: 0b0000_0000_0111_1100(should be pure-red: 00000000-01111100(007C) (r255 g0 b0))
color i get:
r:56
g:24
b:0

byte: 0b1110_0000_0000_0011;(should be pure-green: 11100000-00000011(E003) (r0 g255 b0))
color i get:
r:192
g:0
b:24

Thank you for ur help, if i get this done i understand much more about tgx files and compression

from sourcehold.

janso3 avatar janso3 commented on May 25, 2024

Maybe try to log an error when the default case in the switch statement is hit. If so, the parsing should be the problem. If not, it could have something to do with endianess (my code assumes little endian...). I hope this helps. Also, can you tell me what the issue is on Windows? That sounds quite bad!

from sourcehold.

PodeCaradox avatar PodeCaradox commented on May 25, 2024

Ich habe gerade gesehen das du aus Deutschland kommst, es ist denke ich einfacher auf Deutsch weiter zu schreiben.

Also beim Parsen komme ich öfters in den default block also scheint dabei etwas nicht zu stimmen.

Mit den Farben habe ich mal eine test Methode gebaut zum swapen von den 2 Bytes(System gibt littleEndian = true an) mit folgenden Farben als Ausgabe:
help

0b0001_1111_0000_0000
R:0 G:0 B:248

0b0000_0000_0111_1100
R:248 G:0 B:0

0b1110_0000_0000_0011
R:0 G:31 B:0

Zu deinem Projekt:
Ich habe dein Projekt in Visual Studio mit der CMakeLists.txt geladen, nur weis ich nicht wie ich genau die thrid-party zusatz Dateien installieren muss ich habe diese jetzt in den Thridparty Ordner abgelegt und die CMakeLists bei den Verzeichnissen wie folgt verändert:(ich kenne mich leider nicht ganz sogut damit aus(neuland für mich))

Find SDL2

include_directories(thirdparty/SDL/include/)

Find OpenAL

include_directories(thirdparty/OpenAL/include/)

Find FFMPEG

include_directories(thirdparty/ffmpeg/include/)

Find swresample

include_directories(thirdparty/libavresample/include/)

Find boost

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME ON)
include_directories(thirdparty/boost_1_70_0/include/)

help

from sourcehold.

janso3 avatar janso3 commented on May 25, 2024

Ach ja, hätte mir bei dem Namen ja denken können, dass du Deutsch sprichst ;-). Die RGB Werte sollten eigentlich stimmen (ohne den Byteswap). Ansonsten könnte ich mir noch vorstellen, dass du beim Lesen der GM1 entries nicht zum offset aus der Liste springst. CMake sollte auch funktionieren, wenn man in der Commandline die -DCMAKE_PREFIX_PATH=... Option benutzt (muss ich mal zur README hinzufügen).

from sourcehold.

PodeCaradox avatar PodeCaradox commented on May 25, 2024

Ja war mir bei deinem zuerst nicht sicher hab es dan aber in GIT gesehen ;-)

Welchen Offset meinst du genau, den von der Image offset list, der ist ja beim ersten bild 0 und das müsste soweit passen oder verstehe ich da etwas falsch?

Beim ersten Bild von der anim_armourer.gm1 Datei ist der offset ja 0 und bei der Image sizes list die zahl 760 hinterlegt

also ich lade ja erst den 88 byte header
danach die 5,120 bytes Palette(die habe ich dan in Uint16 array von der größe 2560 umgewandelt) danach 16 mal den UInt32(4bytes) für den offset,
dan 16 mal UInt32(4bytes) für die größe des arrays,
dan kommen die 16 ImgHeader mit jeweils 16 bytes,
und zum ende kommen 16 Images wo ich die größe und den offset aus den Listen zuvor entnehme und diese in die tgx dateien umwandle => und dabei klappt es gerade nicht.

Zum ende komme ich genau auf die größe der GM1 Datei, also müsste dort ja alles passen vom dekodieren.

from sourcehold.

janso3 avatar janso3 commented on May 25, 2024

Tut mir Leid, sonst fällt mir nichts ein. Viel Glück noch! (Btw, meine email ist [email protected], falls dir noch etwas einfällt)

from sourcehold.

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.