Commit Graph

56 Commits

Author SHA1 Message Date
Thomas Goyne 0b19908e7b Use std::prev and std::next where applicable 2012-11-30 10:54:57 -08:00
Thomas Goyne e77e810bd8 Use emplace_back where applicable 2012-11-30 10:44:09 -08:00
Thomas Goyne b6b68b789d Use lambdas in a few places 2012-11-12 19:40:42 -08:00
Thomas Goyne 67df64e879 Use range-based for loops in a bunch of places 2012-11-12 18:35:25 -08:00
Thomas Goyne e44c47c863 Remove $Id$ markers since git doesn't support them 2012-10-25 17:39:49 -07:00
Thomas Goyne 7553534d96 Update all selected rows in the vector clip tool rather than just the active line 2012-10-20 08:07:15 -07:00
Thomas Goyne c7fd04a739 Rename ASS -> Ass in symbol names
Most types and functions used Ass, but a decent number used ASS, so make
them consistent.
2012-10-16 09:52:19 -07:00
Thomas Goyne 53433426bb Fix some stuff from Coverity Scan
Mostly just bugs in unreachable code and stylistic things, but there's a
few incorrect reachable things that were working by coincidence and
gratuitous dynamic_casts.
2012-10-15 18:16:09 -07:00
Thomas Goyne a05d469741 Actually do the smoothing when drawing a smoothed freehand shape
Originally committed to SVN as r6759.
2012-05-11 02:47:18 +00:00
Thomas Goyne b32515da80 Strip trailing whitespace from all cpp and h files
Originally committed to SVN as r6600.
2012-03-25 04:05:06 +00:00
Thomas Goyne 5e96d6e8c3 Remove periods from single-sentence tooltips
Originally committed to SVN as r6449.
2012-02-07 01:22:32 +00:00
Thomas Goyne d001d66b12 Add support for the scale parameter of vector clips. Closes #1415.
Originally committed to SVN as r6364.
2012-01-26 00:29:08 +00:00
Thomas Goyne d1d4d7840b Obey the icon size option in the visual subtoolbars rather than always using 24x24 icons
Originally committed to SVN as r6330.
2012-01-20 23:42:33 +00:00
Thomas Goyne 5e9339611b Return a pair of SplineCurves from SplineCurve::Split rather than mutating the arguments, as it doesn't actually work in-place
Originally committed to SVN as r6100.
2011-12-22 21:25:08 +00:00
Thomas Goyne 4be9c302d3 Fix rendering of the clip visual tools with detached video
Originally committed to SVN as r5847.
2011-11-12 01:23:40 +00:00
Thomas Goyne be77dc8307 Mostly rewrite the visual tools and related classes
Convert all coordinates within the visual tools to Vector2D, which has
been significantly extended. Eliminates a lot of issues with accumulated
rounding errors and simplifies a lot of code.

Modernize the visual tools' interactions with the rest of Aegisub by
connecting to signals directly rather than routing everything through
the video display and converting the main visual tool mode toolbar to
the command system.

Extract all references to OpenGL from the visual tools and move them to
OpenGLWrapper as a first step towards making it possible to implement an
alternative video renderer. In the process, eliminate all uses of OpenGL
immediate mode.

Fix a bunch of minor issues and general instability.

Originally committed to SVN as r5823.
2011-11-06 17:18:20 +00:00
Thomas Goyne d990bbbb99 Eliminate all unnecessary uses of L and _T
Originally committed to SVN as r5611.
2011-09-28 19:43:11 +00:00
Thomas Goyne 256e098aa7 Remove header include order requirements
Originally committed to SVN as r5449.
2011-07-15 04:04:13 +00:00
Thomas Goyne d84b768171 Remove the 'audio' and 'grid' public members from VideoContext and migrate everything that used them over to Context
Originally committed to SVN as r5211.
2011-01-16 07:17:08 +00:00
Amar Takhar c15777f844 Merge audio_display_rewrite branch to trunk. This is not a complete work, don't expect to time anything for a while.
Originally committed to SVN as r4903.
2010-12-08 03:36:10 +00:00
Thomas Goyne 6432ea1f94 Remove the realtime visual tool option, as the threaded video display makes it pointless
Originally committed to SVN as r4825.
2010-10-26 04:12:10 +00:00
Thomas Goyne b4739d2aee gcc 4.5 compilation fixes
Originally committed to SVN as r4797.
2010-10-11 04:25:02 +00:00
Amar Takhar 61656d633b * Make GL_EXT() a noop on OS X, it's not required.
* Conditionalise glMultiDrawArraysFallback since it's not used on OS X.
 * Stub APIENTRY at the top of visual_tool_vector_clip.cpp, this should never be added to a header but at the top of source files.

Originally committed to SVN as r4737.
2010-08-13 00:24:35 +00:00
Thomas Goyne 2a51ad837e Fix non-precompiled header compilation
Originally committed to SVN as r4723.
2010-08-02 22:14:11 +00:00
Thomas Goyne c10e9e3a5b Make video and audio providers throw typed exceptions.
Don't display error messages and try other providers when the user
cancels loading a file.

Remove files from the MRU lists if they can't be found.

Closes #717.

Originally committed to SVN as r4717.
2010-08-02 06:32:01 +00:00
Thomas Goyne 5ed8bf89f6 Fix gcc build errors
Originally committed to SVN as r4658.
2010-07-06 19:33:09 +00:00
Thomas Goyne be1ed9e672 Make visual tools pass around iterators for everything related to visual features rather than a mix of pointers and indices, and clean up feature creation. Fixes a large pile of selection-related bugs.
Originally committed to SVN as r4648.
2010-06-30 06:29:14 +00:00
Thomas Goyne 5588cda268 Significantly revamp how visual tools interact with the rest of the program
Rather than just have a single Refresh method that gets called whenever
something happens that could possibly be of interest to the visual
tools, add seperate methods for signaling frame number changes and
changes to the file, and use the new SelectionController stuff for other
things that used to merit a Refresh. This eliminates a large amount of
redundant reparsing of lines which happened on paint, as well as a large
number of redundant repaints.

Frame data is now only uploaded to the video card when the frame number changes
rather than when anything at all changes, slightly improving performance when
using mesa's software opengl implementation.

Vector clip and drag tools now do a slightly better job of not
discarding the user's selection for no apparent reason, and strange
selection behavior from clicking on visual features should now be
entirely fixed.

Everything but the constructor and toolbar event handler in the visual
tool implementations are now private.

Originally committed to SVN as r4631.
2010-06-28 07:13:15 +00:00
Thomas Goyne caba46bf0b Remove features for deleted control points
Originally committed to SVN as r4620.
2010-06-27 07:53:14 +00:00
Amar Takhar 46da1e538d Merge r4450 to unbreak non precompiled header building.
Originally committed to SVN as r4586.
2010-06-24 01:50:16 +00:00
Thomas Goyne cfa1758d2a Improve the handling of selected features in the vector clip tool and moderately improve performance
Originally committed to SVN as r4548.
2010-06-18 07:14:23 +00:00
Thomas Goyne 227f6b1d69 In the vector clip tool, draw the line to be inserted between the right points when there are multiple paths in the clip
Originally committed to SVN as r4547.
2010-06-18 07:14:17 +00:00
Thomas Goyne 5338a60cdb Fix compilation errors when not using precompiled headers
Originally committed to SVN as r4511.
2010-06-14 19:26:27 +00:00
Thomas Goyne c290b6b811 Silence some prefast warnings
Originally committed to SVN as r4472.
2010-06-11 02:24:59 +00:00
Thomas Goyne f361d1a67b Add support for rendering vector clips with multiple 'm' commands.
Originally committed to SVN as r4463.
2010-06-08 06:09:19 +00:00
Thomas Goyne b867eec7f3 Make the vector clip visual tool use vertex arrays rather than immediate mode to render the spline
Originally committed to SVN as r4458.
2010-06-07 07:24:43 +00:00
Thomas Goyne 3fbdf5b7e5 Make the vector clip tool mask based on winding number so that the masking matches VSFilter's clipping.
Originally committed to SVN as r4442.
2010-06-05 22:40:16 +00:00
Thomas Goyne eff4dcf404 Fix might-as-well-be-inifinite loop in VisualToolVectorClip
Originally committed to SVN as r4431.
2010-06-04 03:08:10 +00:00
Thomas Goyne 71300869da Fix order that VisualToolVectorClip's members are initialized
Originally committed to SVN as r4421.
2010-06-03 20:32:10 +00:00
Thomas Goyne 877eabdce7 Fix selection issues with visual features
Selections in drag mode now follow the following rules:

 * If a line is selected in the grid, at least one visual feature
   corresponding to the line is selected.

 * If a line has any features selected, that line is selected in the
   grid.

In addition, all control points now start out selected in the vector
clip tool, and all tools should no longer discard the current selection
at unpredictable or unintended times.

Updates #513.

Originally committed to SVN as r4363.
2010-05-26 07:17:39 +00:00
Thomas Goyne 23972b10bc Add selection and control of multiple visual features
Make all visual tools support selecting and manipulating multiple visual
features at once, allowing multiple lines to be moved at once, entire
vector clips to be translated, etc. Controls:

  - Left click: Select control clicked control only
  - Ctrl-left click: Add/remove control to selection
  - Drag control (with or without ctrl): Move all selected controls,
    after setting/adding to selection if target is not in the selection
  - Click on no control: Clear selection

Lots of little stuff to fix still.

Updates #513.

Originally committed to SVN as r4322.
2010-05-20 08:55:58 +00:00
Thomas Goyne 8ff2728322 Move all userdata in VisualDraggableFeature not used by VisualTool to subclasses specific to each tool that needs userdata.
Originally committed to SVN as r4321.
2010-05-20 08:55:52 +00:00
Thomas Goyne 40a0c8994a Simplify the VisualTool interface a bit.
Originally committed to SVN as r4318.
2010-05-20 08:55:35 +00:00
Thomas Goyne e023831134 Detangle the visual tools from SubsEditBox a bit by making changes to the file no longer go through the edit box.
Originally committed to SVN as r4317.
2010-05-20 08:55:29 +00:00
Thomas Goyne 519039131f Fix crash in freehand draw mode of the vector clip visual tool
Originally committed to SVN as r4313.
2010-05-20 08:55:08 +00:00
Thomas Goyne 2c876e79c3 Make visual tools use only screen coordinates.
Previously the visual typesetting tools and the overlay mask used
several coordinate frames, converting between them in many places in
inconsistent ways.  This elimiates all uses of coordinate frames other
than screen and script, and makes the conversion done in one place, and
only when parsing or serializing ASS.

This fixes:

 - A few minor rounding errors

 - Horrible brokeness when only part of the video frame is being
   displayed, due to higher levels of zoom than fit onscreen or panning
   the video

 - Distortion of the visual typesetting tools when the combination of
   overridden aspect ratio, script resolution, and video resolution did
   not result in square pixels.

 - Resolution-dependence of the visual typesetting tools, which resulted
   in some tools becoming hard to use at zooms outside the range of
   100-200%.

 - Some draggable controls used the mouse's script coordinates,
   resulting in noticable jerky movement at high zoom levels or when
   using strange script resolutions.

Closes #966.

Originally committed to SVN as r4289.
2010-05-16 06:39:11 +00:00
Thomas Goyne c7e06e9451 Change the uses of -1 for invalid positions in the visual typesetting tools to INT_MIN, as -1 is sometimes a perfectly valid coordinate
Originally committed to SVN as r4258.
2010-05-01 01:45:16 +00:00
Amar Takhar d348b4e33e Fix all the headers in *.cpp, this includes:
* Wrapping all headers that are in agi_pre.h with AGI_PRE.
 * Sorting alphabetically.

Originally committed to SVN as r3515.
2009-09-10 13:06:40 +00:00
Thomas Goyne 1a4e7375fd Add some documentation to VideoDisplay and clean up the includes a bit.
Originally committed to SVN as r3501.
2009-09-10 01:41:34 +00:00
Amar Takhar 6ee2f98349 Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs.  This isn't the actual document in itself but empty documentation using any old documentation if it was there.

This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.

Some notes:
 * Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
 * Some multiline comments may have been munged into single line comments
 * Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
 * Enum comments can go after the enumeration itself '[value] /// comment'
 * include/aegisub/*.h haven't been converted yet, this will be done in a later commit
 * Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.

See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.

Originally committed to SVN as r3312.
2009-07-29 22:59:22 +00:00