Skip to content
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

core: introduce patch data classes and crude parser upgrade beginnings #1

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sinewavey
Copy link
Owner

This commit introduces a few changes to prepare for integrating Quake 3's quadratic Bezier patches: updating the token parser and scope.

Part 1 of at least 2.

@sinewavey sinewavey marked this pull request as draft April 26, 2024 11:14
@@ -79,7 +84,7 @@ func build_gamepack_text() -> String:
if sound_type != sound_types[-1]:
soundtypes_str += " "

var gamepack_text: String = """<?xml version="1.0"?>
var gamepack_text: String = """<?xm000l version="1.0"?>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops- fix this

@@ -133,3 +133,13 @@ class FuncGodotTextureData:

func _init(in_name: String):
name = in_name

class FuncGodotPatchVertex:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't feel like a great solution, but for now and simplicity's sake, I'm treating patches as special objects, though in the map file proper they are part of brush defs.

0: current_patch.texture_idx = map_data.register_texture(buf_str)
1,2: current_patch.indices[component_idx - 1] = float(buf_str)
3,4,5: pass # Contains face attributes, which are currently unsupported in func_godot

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs the rest of the vertices to be read

@@ -286,13 +349,20 @@ func commit_face() -> void:
current_brush.faces.append(current_face)
current_face = FuncGodotMapData.FuncGodotFace.new()

func commit_patch() -> void:

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this overall split is kept, the current_patch = patch.new() call should happen here instead of where it's currently happening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant