AbitTheGray / Decay-Library

Work-In-Progress | Library for parsing BSP/WAD files from GoldSrc.
https://graymadness.net/game/decay/
MIT License
5 stars 0 forks source link

Issue when parsing model #26

Open rickomax opened 5 months ago

rickomax commented 5 months ago

A few BSP files contains models that generates wrong faces when parsed.

This is a small file that can reproduce the issue: wrong.zip

This is how model *2 is supposed to look:

image

This is how model 2 geometry look when parsed with Decay-Library. Looks like it is getting indices from other models and also missing a few indices from model 2 itself: image

Model *2 is just the orange column

rickomax commented 5 months ago

This issue is caused when you itereate thru your edges list in Tree.cpp You are using a 16-bits index value where some models can more than 65535 edges I've implemented a quick BSP parser myself and managed to reproduce the same issue as yours