Comments (7)
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.
Hm, i changed it to the following but doesnt work too.
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.
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.
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:
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/)
from sourcehold.
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.
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.
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)
- feature: cleaner build output on Apple platforms HOT 1
- I need data HOT 3
- I have a question HOT 5
- Stronghold Definitive Edition HOT 9
- feature: FFMPEG interface
- guideline/template: creating game scenes
- feature: decrease shared_pointer usage and move to ECS and DoD
- feature: interface for peripherals and display
- refactor: startup -> main menu procedure
- refactor: small and easy to read source file to initialize subsystems
- feature: build tests on iOS
- feature: interface for single-instance SDL objects and runtime
- feature: RAII wrappers for common SDL objects HOT 1
- feature: common Color functionality
- refactor: Texture
- refactor: Surface
- refactor: Renderer
- refactor: Display
- refactor: TexutreAtlas
- refactor: TileSet
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sourcehold.