-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open .bsp
s inside archives with a single path, using load_bsp
#190
Comments
The Dreamcast release of Quake III is going to be a pretty essential test case
|
We'll also want to roll However, this means we can roll |
archives should move away from the since we will be opening archives inside other archives in memory
|
|
Here's what our deepest load could end up looking like: from bsp_tool.archives.padus import Cdi
cdi = Cdi.from_file("D:/Emulators/Sega/Dreamcast/quakeiii.cdi")
from bsp_tool.archives.iso import Iso
iso = Iso.from_bytes(cdi.read("1.0.iso"))
from bsp_tool.branches.valve.source import PakFile # or archives.id_software.Pk3
zip_ = PakFile.from_bytes(iso.read("QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP"))
from bsp_tool.id_software import IdTechBsp
from bsp_tool.branches.id_software import quake3
bsp = IdTechBsp.from_bytes(
quake3,
"D:/Emulators/Sega/Dreamcast/quakeiii.cdi/1.0.iso/QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP/maps/dc_map01.bsp",
zip_.read("maps/dc_map01.bsp")) As a one-liner: from bsp_tool.archives.iso import Iso
from bsp_tool.archives.padus import Cdi
from bsp_tool.branches.id_software import quake3
from bsp_tool.branches.valve.source import PakFile # or archives.id_software.Pk3
from bsp_tool.id_software import IdTechBsp
bsp = IdTechBsp.from_bytes(
quake3,
"D:/Emulators/Sega/Dreamcast/quakeiii.cdi/1.0.iso/QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP/maps/dc_map01.bsp",
PakFile.from_bytes(
Iso.from_bytes(
Cdi.from_file("D:/Emulators/Sega/Dreamcast/quakeiii.cdi").read(
"1.0.iso")).read(
"QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP")).read(
"maps/dc_map01.bsp"))
bsp = IdTechBsp.from_bytes(quake3, "D:/Emulators/Sega/Dreamcast/quakeiii.cdi/1.0.iso/QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP/maps/dc_map01.bsp", PakFile.from_bytes(Iso.from_bytes(Cdi.from_file("D:/Emulators/Sega/Dreamcast/quakeiii.cdi").read("1.0.iso")).read("QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP")).read("maps/dc_map01.bsp")) bsp_tool.load_bsp("D:/Emulators/Sega/Dreamcast/quakeiii.cdi/1.0.iso/QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP/maps/dc_map01.bsp") |
I'm currently focused on
All 3 contain |
from bsp_tool.archives import sega
gdrom = sega.GDRom.from_file("D:/Emulators/Sega/Dreamcast/quakeiii.cdi")
from bsp_tool.branches.valve.source import PakFile
zip_ = PakFile.from_bytes(gdrom.read("QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP"))
... Should be nice for other images too:
IDK if any full |
The new GDRom interface is quite nice Working out a new standard for archives will probably be part of #191 Also, Just have to decide on where to keep it Footnotes |
All of the
|
WE HAVE IGNITION >>> from bsp_tool.archives import sega
>>> gdrom = sega.GDRom.from_file("D:/Emulators/Sega/Dreamcast/quakeiii.cdi")
>>> from bsp_tool.branches.valve.source import PakFile
>>> zip_ = PakFile.from_bytes(gdrom.read("QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP"))
>>> from bsp_tool.id_software import IdTechBsp
>>> from bsp_tool.branches.id_software import quake3
>>> bsp = IdTechBsp.from_bytes(
... quake3,
... "D:/Emulators/Sega/Dreamcast/quakeiii.cdi/QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP/maps/dc_map01.bsp",
... zip_.read("maps/dc_map01.bsp"))
<IdTechBsp 'dc_map01.bsp' id_software.quake3 (IBSP version 46)>
>>> _.VERTICES
<BspLump(19827 Vertex) at 0x0000021809B10750> |
what should be possible with IdTechBsp.from_archive(quake3, "maps/dc_map01.bsp",
pkware.Zip.from_archive("QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP",
sega.GDRom.from_file("D:/Emulators/Sega/Dreamcast/quakeiii.cdi"))) |
Building on #21, I want free up my harddrives by only extracting maps when I load them
Rather than add even more complex infrastructure to
tests/megatest.py
, I'd rather just use paths into archivese.g.
D:/SteamLibrary/steamapps/common/Quake/Id1/PAK0.PAK/maps/e1m1.bsp
Challenges
D:/Emulators/Sega/Dreamcast/quakeiii.cdi/quake.16.iso/QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP/maps/dc_map01.bsp
.cdi
->.iso
->.zip
->.bsp
os.listdir
will be useless)RespawnBsp
.ent
&.bsp_lump
).rpak
, extra complexity yayRelated
The text was updated successfully, but these errors were encountered: