08-26-2025, 12:11 AM
It doesnt work, but with me giving subtle hints and QB64 rules...very soon it will! i could have done it myself, over many weeks/months/years but this "not quite right but close enough" assistance is to me at least, invaluable...i've also already got it to make EVERYTHING i need for Quake 2 BSP maps too! Its like "SANYO", not quite "SONY" but it'll play your tapes!
As QB64 is such a basic language...anyone who thinks me using AI to push/speed up/expand functionality....well, me thinks you and Clippy will have a good old time discussing it whilst I crack on!
AI is my b*thc and i'll be damned if QB is to remain a forgotten language! BASIC it maybe but only in syntax, it's future is bright! (well as long as lighting is enabled!) and even if i get no responses to posts or simply ignored...I WILL PUSH IT!
Unseen, Unforgiving and Unphased!
As QB64 is such a basic language...anyone who thinks me using AI to push/speed up/expand functionality....well, me thinks you and Clippy will have a good old time discussing it whilst I crack on!
Code: (Select All)
Code: (Select All)SUB GDK2_GL_BSP_Load (BSP AS GDK2_GL_BSP, File$)
DIM FFile& AS INTEGER
DIM CurrentLump AS BSP_D_Entry
IF _FILEEXISTS(File$) THEN
FFile& = FREEFILE
OPEN File$ FOR BINARY AS #FFile&
' Get header data
GET #FFile&, 1, BSP.Header
' Make _MEM pointers for all lumps and get the data
' Entities lump is text data, typically read separately.
' Plane data (Lump 1)
CurrentLump = BSP.Header.Planes
IF CurrentLump.Size > 0 THEN
BSP.Plane_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.Plane_Data, CurrentLump.Size
END IF
' MipTex data (Lump 2)
CurrentLump = BSP.Header.MipTex
IF CurrentLump.Size > 0 THEN
BSP.MipTex_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.MipTex_Data, CurrentLump.Size
END IF
' Vertex data (Lump 3)
CurrentLump = BSP.Header.Vertices
IF CurrentLump.Size > 0 THEN
BSP.Vertex_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.Vertex_Data, CurrentLump.Size
END IF
' VisiList data (Lump 4)
CurrentLump = BSP.Header.VisiList
IF CurrentLump.Size > 0 THEN
BSP.VisiList_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.VisiList_Data, CurrentLump.Size
END IF
' Node data (Lump 5)
CurrentLump = BSP.Header.Nodes
IF CurrentLump.Size > 0 THEN
BSP.Node_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.Node_Data, CurrentLump.Size
END IF
' TexInfo data (Lump 6)
CurrentLump = BSP.Header.TexInfo
IF CurrentLump.Size > 0 THEN
BSP.Texture_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.Texture_Data, CurrentLump.Size
END IF
' Face data (Lump 7)
CurrentLump = BSP.Header.Faces
IF CurrentLump.Size > 0 THEN
BSP.Face_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.Face_Data, CurrentLump.Size
END IF
' LightMaps data (Lump 8)
CurrentLump = BSP.Header.LightMaps
IF CurrentLump.Size > 0 THEN
BSP.L_Map_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.L_Map_Data, CurrentLump.Size
END IF
' Clip Node data (Lump 9)
CurrentLump = BSP.Header.ClipNodes
IF CurrentLump.Size > 0 THEN
BSP.ClipNode_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.ClipNode_Data, CurrentLump.Size
END IF
' Leaf data (Lump 10)
CurrentLump = BSP.Header.Leaves
IF CurrentLump.Size > 0 THEN
BSP.Leaf_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.Leaf_Data, CurrentLump.Size
END IF
' ListFace (MarkSurfaces) data (Lump 11)
CurrentLump = BSP.Header.ListFace
IF CurrentLump.Size > 0 THEN
BSP.FaceList_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.FaceList_Data, CurrentLump.Size
END IF
' Edge data (Lump 13)
CurrentLump = BSP.Header.Edges
IF CurrentLump.Size > 0 THEN
BSP.Edge_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.Edge_Data, CurrentLump.Size
END IF
' Edge List data (Lump 14)
CurrentLump = BSP.Header.ListEdges
IF CurrentLump.Size > 0 THEN
BSP.EdgeList_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.EdgeList_Data, CurrentLump.Size
END IF
' Model data (Lump 15)
CurrentLump = BSP.Header.Models
IF CurrentLump.Size > 0 THEN
BSP.Model_Data = _MEMNEW(CurrentLump.Size)
GET #FFile&, CurrentLump.Offset + 1, BSP.Model_Data, CurrentLump.Size
END IF
CLOSE #FFile&
END IF
END SUB
AI is my b*thc and i'll be damned if QB is to remain a forgotten language! BASIC it maybe but only in syntax, it's future is bright! (well as long as lighting is enabled!) and even if i get no responses to posts or simply ignored...I WILL PUSH IT!
Unseen, Unforgiving and Unphased!

