diff --git a/.gitignore b/.gitignore index 98591ad..dcd876b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,9 @@ .vs +.vscode build out +venv __pycache__ + +CodeGen/*.json +CodeGen/*.h diff --git a/CodeGen/components.py b/CodeGen/components.py new file mode 100644 index 0000000..c2849d5 --- /dev/null +++ b/CodeGen/components.py @@ -0,0 +1,10 @@ +from dataclasses import dataclass, field +from interfaces.component import IComponent + +@dataclass +class EnumComponent(IComponent): + underlying_type: str = "u32" + values: list[str] = field(default_factory=dict) + + def calculate_bytes(self, registry): + return registry.get_byte_size(self.underlying_type) \ No newline at end of file diff --git a/CodeGen/emitters/buffer.py b/CodeGen/emitters/buffer.py deleted file mode 100644 index 4c7155c..0000000 --- a/CodeGen/emitters/buffer.py +++ /dev/null @@ -1,30 +0,0 @@ -class CodeBuffer: - def __init__(self, indent_string=" "): - self.lines = [] - self._indent_string = indent_string - self._current_indent = 0 - - def indent(self): - self._current_indent += 1 - - def dedent(self): - self._current_indent = max(0, self._current_indent - 1) - - def write_line(self, text=""): - if (text.strip() == ""): - self.lines.append("") - else: - spacing = self._indent_string * self._current_indent - self.lines.append(f"{spacing}{text}") - - def open_block(self, prefix_text=""): - if prefix_text: - self.write_line(prefix_text) - self.indent() - - def close_block(self, suffix_text="};"): - self.dedent() - self.write_line(suffix_text) - - def render(self) -> str: - return "\n".join(self.lines) \ No newline at end of file diff --git a/CodeGen/emitters/code_buffer.py b/CodeGen/emitters/code_buffer.py new file mode 100644 index 0000000..4b8b84a --- /dev/null +++ b/CodeGen/emitters/code_buffer.py @@ -0,0 +1,28 @@ +class CodeBuffer: + def __init__(self, indent_char: str = " "): + self._lines: list[str] = [] + self._indent_level: int = 0 + self._indent_char: str = indent_char + + def write_line(self, text: str = "") -> None: + if text.strip() == "": + self._lines.append("") + else: + indent = self._indent_char * self._indent_level + self._lines.append(f"{indent}{text}") + + def open_block(self, prefix_text: str = "") -> None: + if prefix_text: + self.write_line(prefix_text) + self.write_line("{") + self._indent_level += 1 + + def close_block(self, suffix_text: str = "") -> None: + self._indent_level = max(0, self._indent_level - 1) + self.write_line(f"}}{suffix_text}") + + def comment(self, text: str) -> None: + self.write_line(f"// {text}") + + def get_content(self) -> str: + return "\n".join(self._lines) diff --git a/CodeGen/emitters/default_emitter.py b/CodeGen/emitters/default_emitter.py new file mode 100644 index 0000000..14922af --- /dev/null +++ b/CodeGen/emitters/default_emitter.py @@ -0,0 +1,10 @@ +from .structure_emitter import BaseStructureEmitter + +class DefaultEmitter(BaseStructureEmitter): + def _emit_structure(self, buffer, struct): + buffer.open_block(f"struct {struct.name}") + for name, type in struct.fields.items(): + buffer.write_line(f"{type} {name};") + + buffer.close_block(";") + buffer.write_line() \ No newline at end of file diff --git a/CodeGen/emitters/engine_emitters.py b/CodeGen/emitters/engine_emitters.py deleted file mode 100644 index f4f22b4..0000000 --- a/CodeGen/emitters/engine_emitters.py +++ /dev/null @@ -1,124 +0,0 @@ -from .buffer import CodeBuffer - -class EngineEmitter: - def __init__(self, structures, primitives_registry, namespace=None): - self.structures = structures - self.primitives = primitives_registry - self.namespace = namespace - self.buf = CodeBuffer() - - def emit_all(self, output_filepath): - self.buf.write_line("// AUTOMATICALLY GENERATED FILE - DO NOT MODIFY") - self.buf.write_line("#pragma once") - self.buf.write_line("#include ") - self.buf.write_line() - - if self.namespace: - self.buf.open_block(f"namespace {self.namespace} {{") - self.buf.write_line() - - for struct in self.structures: - self._emit_aos(struct) - self.buf.write_line() - - for struct in self.structures: - self._emit_soa(struct) - self.buf.write_line() - - for struct in self.structures: - self._emit_view(struct) - self.buf.write_line() - - if self.namespace: - self.buf.close_block(f"}}; // namespace {self.namespace}") - - new_content = self.buf.render() - self._write_if_changed(output_filepath, new_content) - - def _get_type_name(self, field, target_track): - if target_track == "aos": - suffix = "AoS" - elif target_track == "soa": - suffix = "SoA" - else: - suffix = "View" - - return f"{field.type_name}{suffix}" - - def _get_field_type(self, field, target_track): - if field.is_primitive: - return self.primitives[field.type_name][target_track] - else: - if target_track == "aos": - suffix = "AoS" - elif target_track == "soa": - suffix = "SoA" - else: - suffix = "View" - - return f"{field.type_name}{suffix}" - - def _emit_aos(self, struct): - align_prefix = f"alignas({struct.alignment}) " if struct.alignment else "" - - self.buf.open_block(f"struct {align_prefix}{struct.name}AoS {{") - for field in struct.fields: - ftype = self._get_field_type(field, "aos") - self.buf.write_line(f"{ftype} {field.name};") - self.buf.close_block() - - def _emit_soa(self, struct): - align_prefix = f"alignas({struct.alignment}) " if struct.alignment else "" - - self.buf.open_block(f"struct {align_prefix}{struct.name}SoA {{") - for field in struct.fields: - ftype = self._get_field_type(field, "soa") - self.buf.write_line(f"{ftype} {field.name};") - self.buf.close_block() - - def _emit_view(self, struct): - self.buf.open_block(f"struct {struct.name}View {{") - - # Write references - for field in struct.fields: - ftype = self._get_field_type(field, "view") - self.buf.write_line(f"{ftype} {field.name};") - self.buf.write_line() - - # FromAoS factory initialization - self.buf.open_block(f"[[nodiscard]] static inline {struct.name}View FromAoS({struct.name}AoS& instance) noexcept {{") - self.buf.open_block(f"return {struct.name}View {{") - - for field in struct.fields: - if field.is_primitive: - self.buf.write_line(f".{field.name} = instance.{field.name},") - else: - self.buf.write_line(f".{field.name} = {field.type_name}View::FromAoS(instance.{field.name}),") - - self.buf.close_block("};") - self.buf.close_block("}") - - # FromSoA factory initialization - self.buf.open_block(f"[[nodiscard]] static inline {struct.name}View FromSoA({struct.name}SoA& instance, uint32_t ix) noexcept {{") - self.buf.open_block(f"return {struct.name}View {{") - - for field in struct.fields: - if field.is_primitive: - self.buf.write_line(f".{field.name} = instance.{field.name}[ix],") - else: - self.buf.write_line(f".{field.name} = {field.type_name}View::FromSoA(instance.{field.name}, ix),") - - self.buf.close_block("};") - self.buf.close_block("}") - - # end structure - self.buf.close_block() - - def _write_if_changed(self, filepath, content): - import os - if os.path.exists(filepath): - with open(filepath, "r") as f: - if f.read() == content: - return - with open(filepath, "w") as f: - f.write(content) diff --git a/CodeGen/emitters/enum_emitter.py b/CodeGen/emitters/enum_emitter.py new file mode 100644 index 0000000..da62b81 --- /dev/null +++ b/CodeGen/emitters/enum_emitter.py @@ -0,0 +1,28 @@ +import components +from .emitter import ICodeEmitter + +class EnumEmitter(ICodeEmitter): + def emit_component(self, buffer, component): + if not isinstance(component, components.EnumComponent): + raise TypeError("EnumEmitter cannot process components other than enum!") + + enum: components.EnumComponent = component + buffer.open_block(f"enum class {enum.name} : {enum.underlying_type}") # open enum + + for idx, val in enumerate(enum.values): + buffer.write_line(f"{val:<24} = {idx},") + + buffer.write_line(f"{'INVALID':<24} = std::numeric_limits<{enum.underlying_type}>::max()") + buffer.close_block(";\n") # close enum + + buffer.open_block(f"[[nodiscard]] inline constexpr const char* ToString({enum.name} value) noexcept") # open function + buffer.open_block("switch (value)") # open switch + + for val in enum.values: + buffer.write_line(f"case {enum.name}::{val}: return \"{val}\";") + buffer.write_line(f"case {enum.name}::INVALID: return \"INVALID\"") + buffer.write_line("default: return \"UNKNOWN\";") + + buffer.close_block() # close switch + buffer.close_block() # close function + buffer.write_line() diff --git a/CodeGen/emitters/soa_emitter.py b/CodeGen/emitters/soa_emitter.py new file mode 100644 index 0000000..c3ebae7 --- /dev/null +++ b/CodeGen/emitters/soa_emitter.py @@ -0,0 +1,10 @@ +from .structure_emitter import BaseStructureEmitter + +class SoAEmitter(BaseStructureEmitter): + def _emit_structure(self, buffer, struct): + buffer.open_block(f"struct {struct.name}SoA") + for name, type in struct.fields.items(): + buffer.write_line(f"{type}* {name};") + + buffer.close_block(";") + buffer.write_line() \ No newline at end of file diff --git a/CodeGen/emitters/structure_emitter.py b/CodeGen/emitters/structure_emitter.py new file mode 100644 index 0000000..c3407e9 --- /dev/null +++ b/CodeGen/emitters/structure_emitter.py @@ -0,0 +1,15 @@ +from components import StructureComponent +from .emitter import ICodeEmitter +from .code_buffer import CodeBuffer +from abc import abstractmethod + +class BaseStructureEmitter(ICodeEmitter): + def emit_component(self, buffer, component): + if not isinstance(component, StructureComponent): + raise TypeError("AosEmitter cannot emit components other than structures") + + self._emit_structure(buffer, component) + + @abstractmethod + def _emit_structure(self, buffer: CodeBuffer, struct: StructureComponent): + pass \ No newline at end of file diff --git a/CodeGen/emitters/view_emitter.py b/CodeGen/emitters/view_emitter.py new file mode 100644 index 0000000..7faa161 --- /dev/null +++ b/CodeGen/emitters/view_emitter.py @@ -0,0 +1,16 @@ +from .structure_emitter import BaseStructureEmitter + +class ViewEmitter(BaseStructureEmitter): + def _emit_structure(self, buffer, struct): + struct_type_name = f"{struct.name}View" + + buffer.open_block(f"struct {struct_type_name}") + buffer.comment("delete default constructor") + buffer.write_line(f"{struct_type_name}() = delete;") + buffer.write_line() + + for name, type in struct.fields.items(): + buffer.write_line(f"{type}& {name};") + + buffer.close_block(";") + buffer.write_line() \ No newline at end of file diff --git a/CodeGen/generators.py b/CodeGen/generators.py new file mode 100644 index 0000000..ab9af53 --- /dev/null +++ b/CodeGen/generators.py @@ -0,0 +1,40 @@ +from interfaces.file_generator import IFileGenerator +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from schema import Schema + +class CppFileGenerator(IFileGenerator): + def write_comment(self, text) -> None: + self.write_line(f"// {text}") + + def open_block(self, prefix: str = "") -> None: + if prefix: + self.write_line(prefix) + + self.write_line("{") + self._indent_level += 1 + + def close_block(self, suffix = ""): + self._indent_level = max(0, self._indent_level - 1) + self.write_line(f"}}{suffix}") + + def generate(self, schema_data, registry): + self.write_comment("="*100) + self.write_comment("FILE GENERATED BY DELTA CODEGEN UTILITY".center(100)) + self.write_comment("="*100) + self.write_line() + + self.write_line("#pragma once") + self.write_line("#include ") + self.write_line("#include ") + self.write_line() + + # TODO: Namespace, structures, enums and anything else + +def select_generator(schema: "Schema", outfile: str) -> IFileGenerator: + type = schema.generator_type.lower() + if type == "cpp": + return CppFileGenerator(outfile) + else: + raise RuntimeError(f"Unrecognized generator type: '{schema.generator_type}'") diff --git a/CodeGen/interfaces/component.py b/CodeGen/interfaces/component.py new file mode 100644 index 0000000..2a3b5f1 --- /dev/null +++ b/CodeGen/interfaces/component.py @@ -0,0 +1,20 @@ +from abc import ABC, abstractmethod +from dataclasses import dataclass, field +from typing import Dict, Any, TYPE_CHECKING + +if TYPE_CHECKING: + from type_registries import ITypeRegistry + +@dataclass +class IComponent(ABC): + _name: str + metadata: Dict[str, Any] = field(default_factory=dict) + + @property + def name(self) -> str: + return self._name + + @abstractmethod + def calculate_bytes(self, registry: "ITypeRegistry") -> int: + """Calculates the byte footprint of the component.""" + pass \ No newline at end of file diff --git a/CodeGen/interfaces/file_generator.py b/CodeGen/interfaces/file_generator.py new file mode 100644 index 0000000..a72d330 --- /dev/null +++ b/CodeGen/interfaces/file_generator.py @@ -0,0 +1,42 @@ +from abc import ABC, abstractmethod +from typing import List, Dict, Any +from .type_registry import ITypeRegistry +from .component import IComponent +from schema import Schema + +class IFileGenerator(ABC): + def __init__(self, filepath: str): + self.filepath = filepath + self._lines: List[str] = [] + self._indent_level: int = 0 + self._indent_char: str = " " + + def write_line(self, text: str = "") -> None: + if text.strip() == "": + self._lines.append("") + else: + indent = self._indent_char * self._indent_level + self._lines.append(f"{indent}{text}") + + @abstractmethod + def write_comment(self, text: str) -> None: + pass + + @abstractmethod + def open_block(self, prefix: str = "") -> None: + pass + + @abstractmethod + def close_block(self, suffix: str = "") -> None: + pass + + @abstractmethod + def generate(self, schema: Schema) -> None: + pass + + def save_to_disk(self) -> None: + content = "\n".join(self._lines) + print(f"--- WRITING FILE: {self.filepath} ---") + + with open(self.filepath, 'w') as f: + f.write(content) \ No newline at end of file diff --git a/CodeGen/interfaces/type_registry.py b/CodeGen/interfaces/type_registry.py new file mode 100644 index 0000000..2c3556e --- /dev/null +++ b/CodeGen/interfaces/type_registry.py @@ -0,0 +1,26 @@ +from abc import ABC, abstractmethod +from typing import Dict, TYPE_CHECKING +from .component import IComponent + +if TYPE_CHECKING: + from .component import IComponent + +class ITypeRegistry(ABC): + def __init__(self): + self.custom_components: Dict[str, "IComponent"] + pass + + def register_custom(self, component: "IComponent") -> None: + if component.name in self.custom_components: + raise KeyError(f"Type Registry Error: component '{component.name}' already exists in the registry.") + self.custom_components[component.name] = component + + @abstractmethod + def resolve_type_string(self, logical_type: str) -> str: + """Translates a logical type (e.g. u32) to a target-language type (e.g. uint32_t)""" + pass + + @abstractmethod + def get_byte_size(self, logical_type: str) -> int: + """Resolved the byte size of a primitive or custom structural layout.""" + pass \ No newline at end of file diff --git a/CodeGen/main.py b/CodeGen/main.py index 9143fa6..d52fa0d 100644 --- a/CodeGen/main.py +++ b/CodeGen/main.py @@ -1,43 +1,28 @@ -import os import sys -import json -from model import load_schemas_tree -from emitters.engine_emitters import EngineEmitter +import os + +import schema +import generators def main(): if len(sys.argv) < 3: print("Error: Missing output file path argument from CMake.", file=sys.stderr) sys.exit(1) - - input_schema_path = sys.argv[1] - output_filepath = sys.argv[2] - - script_dir = os.path.dirname(os.path.abspath(__file__)) - core_types_path = os.path.join(script_dir, "schemas", "core_types.json") - output_directory, _ = os.path.split(output_filepath) - - print(output_directory) - os.makedirs(output_directory, exist_ok=True) - - if not os.path.exists(core_types_path): - print(f"Error: Missing core types registry at {core_types_path}", file=sys.stderr) - sys.exit(1) - with open(core_types_path, "r") as f: - core_data = json.load(f) + schema_path = sys.argv[1] + output_file = sys.argv[2] - primitives_map = {} - for p in core_data.get("primitives", []) + core_data.get("opaque_engine_types", []): - primitives_map[p["name"]] = p + schema_path_absolute = os.path.abspath(schema_path) + output_file_absolute = os.path.abspath(output_file) - if not os.path.exists(input_schema_path): - print(f"Error: Structural schema missing at {input_schema_path}", file=sys.stderr) + try: + schema_decoder = schema.select_decoder(schema_path_absolute) + s = schema_decoder.decode(schema_path_absolute) + generator = generators.select_generator(s, output_file_absolute) + print(generator) + except RuntimeError as e: + print(e) sys.exit(1) - parsed_structures, target_namespace = load_schemas_tree([input_schema_path], primitives_map) - - emitter = EngineEmitter(parsed_structures, primitives_map, target_namespace) - emitter.emit_all(output_filepath) - if __name__ == "__main__": main() diff --git a/CodeGen/model.py b/CodeGen/model.py deleted file mode 100644 index 23cf405..0000000 --- a/CodeGen/model.py +++ /dev/null @@ -1,40 +0,0 @@ -import json - -class Field: - def __init__(self, type_name, name, is_primitive): - self.type_name = type_name - self.name = name - self.is_primitive = is_primitive - -class Structure: - def __init__(self, name, raw_fields, primitives_registry, custom_types, alignment = None): - self.name = name - self.fields = [] - self.alignment = int(alignment) if alignment is not None else None - - for f in raw_fields: - is_prim = f["type"] in primitives_registry - self.fields.append(Field(f["type"], f["name"], is_prim)) - -def load_schemas_tree(schema_files, primitives_registry): - custom_types = set() - raw_structs = [] - target_namespace = None - - for file_path in schema_files: - with open(file_path, "r") as f: - data = json.load(f) - - if "namespace" in data: - target_namespace = data["namespace"] - - for s in data["structures"]: - custom_types.add(s["name"]) - raw_structs.append(s) - - parsed_structures = [ - Structure(s["name"], s["fields"], primitives_registry, custom_types, s.get("alignment")) - for s in raw_structs - ] - - return parsed_structures, target_namespace diff --git a/CodeGen/schema.py b/CodeGen/schema.py new file mode 100644 index 0000000..3681be3 --- /dev/null +++ b/CodeGen/schema.py @@ -0,0 +1,63 @@ +from dataclasses import dataclass, field +from abc import ABC, abstractmethod +from typing import Dict, Any, List +from interfaces.component import IComponent + +import json +import os +import components + +@dataclass +class Schema: + generator_type: str + config: Dict[str, Any] = field(default_factory=dict) + components: List[IComponent] = field(default_factory=list) + +class ISchemaDecoder(ABC): + @abstractmethod + def decode(self, file_path: str) -> Schema: + """Reads a file and builds a standarized schema IR wrapper""" + pass + +class JsonSchemaDecoder(ISchemaDecoder): + def decode(self, file_path): + with open(file_path, "r") as f: + raw_data = json.load(f) + + components = self._parse_components(raw_data["components"]) + + return Schema( + generator_type=raw_data["generator"], + config=raw_data["config"], + components=components + ) + + def _parse_components(self, components_data: Dict[str, Any]) -> List[IComponent]: + parsed_components = [] + + for name, body in components_data.items(): + if "type" not in body: + raise KeyError(f"Component '{name}' is missing the required 'type' field.") + + comp_type = body["type"].lower() + + if comp_type == "enum": + parsed_components.append(components.EnumComponent( + _name = name, + underlying_type=body.get("underlying_type", "u32"), + values=list(body.get("values", [])) + )) + elif comp_type == "struct": + pass # TODO: implement + else: + raise ValueError(f"Unknown component type '{comp_type}' for component '{name}'") + + return parsed_components + +def select_decoder(schema_file: str) -> ISchemaDecoder: + _, ext = os.path.splitext(schema_file) + + if ext.lower() == ".json": + return JsonSchemaDecoder() + else: + raise RuntimeError(f"Unrecognized file format: '{ext}'") \ No newline at end of file diff --git a/CodeGen/schemas/core_types.json b/CodeGen/schemas/core_types.json deleted file mode 100644 index 7193a62..0000000 --- a/CodeGen/schemas/core_types.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "primitives": [ - { - "name": "uint8_t", - "alignment": 1, - "aos": "uint8_t", - "soa": "uint8_t*", - "view": "uint8_t&" - }, - { - "name": "uint16_t", - "alignment": 2, - "aos": "uint16_t", - "soa": "uint16_t*", - "view": "uint16_t&" - }, - { - "name": "uint32_t", - "alignment": 4, - "aos": "uint32_t", - "soa": "uint32_t*", - "view": "uint32_t&" - }, - { - "name": "uint64_t", - "alignment": 8, - "aos": "uint64_t", - "soa": "uint64_t*", - "view": "uint64_t&" - }, - { - "name": "size_t", - "alignment": 8, - "aos": "size_t", - "soa": "size_t*", - "view": "size_t&" - }, - { - "name": "uintptr_t", - "alignment": 8, - "aos": "uintptr_t", - "soa": "uintptr_t*", - "view": "uintptr_t&" - } - ] -} \ No newline at end of file diff --git a/CodeGen/type_registries.py b/CodeGen/type_registries.py new file mode 100644 index 0000000..168bb55 --- /dev/null +++ b/CodeGen/type_registries.py @@ -0,0 +1,32 @@ +from interfaces.type_registry import ITypeRegistry +from typing import Dict, Tuple + +class CppTypeRegistry(ITypeRegistry): + PRIMITIVE_MAP: Dict[str, Tuple[str, int]] = { + "u8": ("uint8_t", 1), + "u16": ("uint16_t", 2), + "u32": ("uint32_t", 4), + "u64": ("uint64_t", 8), + + "i8": ("int8_t", 1), + "i16": ("int16_t", 2), + "i32": ("int32_t", 4), + "i64": ("int64_t", 8), + + "f32": ("float", 4), + "f64": ("double", 8), + + "bool": ("bool", 1), + "usize": ("size_t", 8), + "uintptr": ("uintptr_t", 8) + } + + def resolve_type_string(self, logical_type): + if logical_type in self.PRIMITIVE_MAP: + return self.PRIMITIVE_MAP[logical_type][0] + raise TypeError(f"C++ Type Registry Error: Undefined type reference '{logical_type}'") + + def get_byte_size(self, logical_type): + if logical_type in self.PRIMITIVE_MAP: + return self.PRIMITIVE_MAP[logical_type][1] + raise TypeError(f"C++ Type Registry Error: Undefined type reference '{logical_type}'") \ No newline at end of file diff --git a/Engine/CMakeLists.txt b/Engine/CMakeLists.txt index 5594dc1..e635b35 100644 --- a/Engine/CMakeLists.txt +++ b/Engine/CMakeLists.txt @@ -69,8 +69,8 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") endif() target_precompile_headers(ProjectDelta - PUBLIC "include/delta/pch.h" "include/delta/core/pch.h" "include/delta/platform/pch.h" "include/delta/utils/pch.h" - PRIVATE "src/delta/pch.h" "src/delta/core/pch.h" "src/delta/platform/pch.h" + PUBLIC "include/delta/core/pch.h" "include/delta/platform/pch.h" "include/delta/utils/pch.h" + PRIVATE "src/delta/core/pch.h" "src/delta/platform/pch.h" ) target_include_directories(ProjectDelta diff --git a/Engine/codegen/ThreadContext.json b/Engine/codegen/ThreadContext.json index 7cc0cf7..9728f7d 100644 --- a/Engine/codegen/ThreadContext.json +++ b/Engine/codegen/ThreadContext.json @@ -1,5 +1,17 @@ { - "namespace": "delta::core", + "namespace": "delta::core", + "includes": [ + "#include " + ], + "primitives": [ + { + "name": "std::atomic", + "alignment": 1, + "aos": "std::atomic", + "soa": "std::atomic*", + "view": "std::atomic&" + } + ], "structures": [ { "name": "PageCoordinator", @@ -19,6 +31,15 @@ } ] }, + { + "name": "ThreadState", + "fields": [ + { + "type": "std::atomic", + "name": "state" + } + ] + }, { "name": "ArenaAllocator", "alignment": 8, diff --git a/Engine/include/delta/core/pch.h b/Engine/include/delta/core/pch.h index 05fd1bc..4fcb3ec 100644 --- a/Engine/include/delta/core/pch.h +++ b/Engine/include/delta/core/pch.h @@ -16,6 +16,9 @@ #pragma once +#include +#include + #include "core_types.h" #include "engine.h" #include "memory.h" diff --git a/Engine/include/delta/pch.h b/Engine/include/delta/pch.h deleted file mode 100644 index e9c7a16..0000000 --- a/Engine/include/delta/pch.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2026 Jakub Bączyk - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include - -#include -#include diff --git a/Engine/include/delta/platform/pch.h b/Engine/include/delta/platform/pch.h index ba3d202..5d5f58a 100644 --- a/Engine/include/delta/platform/pch.h +++ b/Engine/include/delta/platform/pch.h @@ -16,6 +16,9 @@ #pragma once +#include +#include + #include "compiler.h" #include "os.h" #include "os_types.h" diff --git a/Engine/src/delta/pch.cpp b/Engine/src/delta/pch.cpp deleted file mode 100644 index 4d901d7..0000000 --- a/Engine/src/delta/pch.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2026 Jakub Bączyk - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include "pch.h" diff --git a/Engine/src/delta/pch.h b/Engine/src/delta/pch.h deleted file mode 100644 index f3d91f5..0000000 --- a/Engine/src/delta/pch.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2026 Jakub Bączyk - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include