Skip to content

Commit

Permalink
Doc comments and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
foxnne committed Jan 27, 2025
1 parent 175542a commit c385fd0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
7 changes: 7 additions & 0 deletions src/internal/Frame.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
const std = @import("std");
const pixi = @import("../pixi.zig");

/// A frame is the necessary data to create a transformation frame control around a sprite
/// and move/scale/rotate it within the editor.
///
/// The vertices correspond to each corner where a stretch control exists,
/// and a pivot, which is moveable and changes the rotation control pivot.
const Frame = @This();

const File = @import("File.zig");

vertices: [4]File.TransformVertex,
Expand Down
28 changes: 14 additions & 14 deletions src/pixi.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ pub const version: std.SemanticVersion = .{ .major = 0, .minor = 2, .patch = 0 }

// Generated files, these contain helpers for autocomplete
// So you can get a named index into atlas.sprites
pub const paths = @import("assets.zig");
pub const atlas = paths.pixi_atlas;
pub const animations = @import("animations.zig");
pub const atlas = paths.pixi_atlas;
pub const paths = @import("assets.zig");
pub const shaders = @import("shaders.zig");

// Other helpers and namespaces
pub const fs = @import("tools/fs.zig");
pub const algorithms = @import("algorithms/algorithms.zig");
pub const fa = @import("tools/font_awesome.zig");
pub const math = @import("math/math.zig");
pub const fs = @import("tools/fs.zig");
pub const gfx = @import("gfx/gfx.zig");
pub const input = @import("input/input.zig");
pub const algorithms = @import("algorithms/algorithms.zig");
pub const math = @import("math/math.zig");

/// Internal types
/// These types contain additional data to support the editor
Expand All @@ -27,13 +27,13 @@ pub const Internal = struct {
pub const Animation = @import("internal/Animation.zig");
pub const Atlas = @import("internal/Atlas.zig");
pub const Buffers = @import("internal/Buffers.zig");
pub const File = @import("internal/File.zig");
pub const Frame = @import("internal/Frame.zig");
pub const History = @import("internal/History.zig");
pub const Keyframe = @import("internal/Keyframe.zig");
pub const KeyframeAnimation = @import("internal/KeyframeAnimation.zig");
pub const Layer = @import("internal/Layer.zig");
pub const Palette = @import("internal/Palette.zig");
pub const File = @import("internal/File.zig");
pub const Reference = @import("internal/Reference.zig");
pub const Sprite = @import("internal/Sprite.zig");
};
Expand All @@ -44,12 +44,12 @@ pub const Animation = Internal.Animation;
/// pixi.atlas, which contains a list of sprites and animations
pub const Atlas = @import("Atlas.zig");

/// pixi.layer, which contains information such as the name, visibility, and collapse settings
pub const Layer = @import("Layer.zig");

/// pixi.file, this is the data that gets written to disk in a .pixi file and read back into this type
pub const File = @import("File.zig");

/// pixi.layer, which contains information such as the name, visibility, and collapse settings
pub const Layer = @import("Layer.zig");

/// pixi.sprite, which is just a name, source location within the atlas texture, and origin
/// TODO: can we discover a new way to handle this and remove the name field?
/// Names could instead be derived from what animations they take part in
Expand All @@ -64,22 +64,22 @@ pub var packer: *Packer = undefined;
// Modules
pub const App = @import("App.zig");
pub const Editor = @import("editor/Editor.zig");
pub const Packer = @import("tools/Packer.zig");
pub const Popups = @import("editor/popups/Popups.zig");
pub const Explorer = @import("editor/explorer/Explorer.zig");
pub const Artboard = @import("editor/artboard/Artboard.zig");
pub const Sidebar = @import("editor/Sidebar.zig");
pub const Packer = @import("tools/Packer.zig");

// The set of Mach modules our application may use.
const Modules = mach.Modules(.{
mach.Core,
App,
Artboard,
Core,
Editor,
Popups,
Explorer,
Artboard,
Sidebar,
Packer,
Popups,
Sidebar,
});

// TODO: move this to a mach "entrypoint" zig module which handles nuances like WASM requires.
Expand Down

0 comments on commit c385fd0

Please sign in to comment.