ipdf/code.git
10 years agoCrash instead of generating NaN. This breaks everything.
David Gow [Thu, 28 Aug 2014 03:47:43 +0000 (11:47 +0800)]
Crash instead of generating NaN. This breaks everything.

10 years agoInfinite Quadtree precision now works with some Béziers
David Gow [Wed, 27 Aug 2014 15:13:47 +0000 (23:13 +0800)]
Infinite Quadtree precision now works with some Béziers

You can zoom in a long way on some, others exhibit precision problems after
quite a long way. Probably the curve cannot be further simplified or something?

10 years agoAdd a vec2 struct.
David Gow [Wed, 27 Aug 2014 08:24:25 +0000 (16:24 +0800)]
Add a vec2 struct.

10 years agoA Song of Floodfills and Segfaults
Sam Moore [Tue, 26 Aug 2014 10:42:33 +0000 (18:42 +0800)]
A Song of Floodfills and Segfaults

Ok, just need to make the FloodFillOnCPU not stack overflow...

10 years agoMerge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Mon, 25 Aug 2014 08:54:46 +0000 (16:54 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code

Conflicts:
src/document.cpp

10 years agoShading still doesn't work
Sam Moore [Mon, 25 Aug 2014 14:44:33 +0000 (22:44 +0800)]
Shading still doesn't work

Actually it's supposed to be "filling" shading implies the colour changes.
Whatever.

10 years agoSome half-done quadtree experiments.
David Gow [Mon, 25 Aug 2014 08:30:00 +0000 (16:30 +0800)]
Some half-done quadtree experiments.

10 years agoSupport colours in shading
Sam Moore [Sun, 24 Aug 2014 10:30:32 +0000 (18:30 +0800)]
Support colours in shading

Shading doesn't actually work still but that's of minor concern

10 years agoBéziers magically work with the QuadTree (sometimes)
David Gow [Thu, 21 Aug 2014 10:58:24 +0000 (18:58 +0800)]
Béziers magically work with the QuadTree (sometimes)

Also maybe broke qt. It fixed it for my laptop.`

10 years agoMore broken quadtree monstrosity.
David Gow [Thu, 21 Aug 2014 05:15:22 +0000 (13:15 +0800)]
More broken quadtree monstrosity.

10 years agoTotally break Quadtree Béziers.
David Gow [Wed, 20 Aug 2014 17:13:22 +0000 (01:13 +0800)]
Totally break Quadtree Béziers.

10 years agoAdded a Bezier::ReParametrise() function.
David Gow [Wed, 20 Aug 2014 15:06:40 +0000 (23:06 +0800)]
Added a Bezier::ReParametrise() function.

This returns a bezier equivalent to the segment from t0 -> t1 of the
original bezier.

Derivation at: http://davidgow.net/stuff/cubic_bezier_reparam.pdf
for now. If it's not too embarrasing, it might end up in the documents repo.

10 years agoFix adding text.
David Gow [Tue, 19 Aug 2014 12:11:57 +0000 (20:11 +0800)]
Fix adding text.

(And remove some Debug printing)

10 years agoMerge branch 'master' of git.ucc.asn.au:/ipdf/code
Sam Moore [Mon, 18 Aug 2014 13:47:51 +0000 (21:47 +0800)]
Merge branch 'master' of git.ucc.asn.au:/ipdf/code

Noooo

10 years agoGo nuts with Qt
Sam Moore [Mon, 18 Aug 2014 14:47:00 +0000 (22:47 +0800)]
Go nuts with Qt

We can do all the things I promised!*
And we can do it without having to implement a vim style stdio based interface!
Or adding 16 extra mouse buttons!

Qt can parse XML or even SVG all by itself though...
I'm going to ignore that and just keep treating it as a menu system.

* Commit --amend

Well, the set of things we can do is neither a subset nor a superset of the things I promised.

10 years agoFix kerning for the first pair of characters
David Gow [Mon, 18 Aug 2014 13:18:31 +0000 (21:18 +0800)]
Fix kerning for the first pair of characters

10 years agoTerrible hacky SolveCubic.
David Gow [Mon, 18 Aug 2014 13:08:18 +0000 (21:08 +0800)]
Terrible hacky SolveCubic.

(I'm sorry, but I'm going to need more sleep before I tackle
complex numbers here)

10 years agoSlightly better kerning maybe?
David Gow [Mon, 18 Aug 2014 08:59:28 +0000 (16:59 +0800)]
Slightly better kerning maybe?

10 years agoMake Qt4 work
Sam Moore [Mon, 18 Aug 2014 05:18:39 +0000 (13:18 +0800)]
Make Qt4 work

Needed to generate a special "moc" cpp file from the header file

10 years agoInflict Qt4 upon the codebase
Sam Moore [Sun, 17 Aug 2014 09:28:51 +0000 (17:28 +0800)]
Inflict Qt4 upon the codebase

I'm getting issues compiling it though
Qt seems to expect some magical auto-generated Makefile

Remove the not-very-functional control panel with a "CONTROLPANEL_DISABLED" define.

10 years agoMake project relevant to Mechatronics
Sam Moore [Sun, 17 Aug 2014 05:59:26 +0000 (13:59 +0800)]
Make project relevant to Mechatronics

Also fix missing actually setting the origin with the "moveto" path command.

10 years agoDon't write past the end of a GPU mem buffer.
David Gow [Fri, 15 Aug 2014 04:38:08 +0000 (12:38 +0800)]
Don't write past the end of a GPU mem buffer.

(It causes crashiness)

10 years agoRe-fix QuadTree GPU rendering, discard groups
David Gow [Thu, 14 Aug 2014 13:44:14 +0000 (21:44 +0800)]
Re-fix QuadTree GPU rendering, discard groups

10 years agoAttempt Shading + Bezier Bounds (hopefully) correct
Sam Moore [Thu, 14 Aug 2014 20:20:37 +0000 (04:20 +0800)]
Attempt Shading + Bezier Bounds (hopefully) correct

Turns out I can't do high school calculus despite 4 years of Physics study.

The shading algorithm I envisioned has several rather hilarious
things wrong with it...

Although that 'j' does look damn good if you set the zoom *just* right...

10 years agoMake bezier control point coordinates relative
Sam Moore [Thu, 14 Aug 2014 16:48:03 +0000 (00:48 +0800)]
Make bezier control point coordinates relative

So the quad tree should just have to care about bounding rectangles.
Also so the GPU renderer now doesn't need transforming but CPU renderer does now.

AddBezier assumes absolute coordinates and transforms to relative coordinates
AddBezierData is assuming relative coordinates.

Totally clear.

PS: Basically whatever is convenient/efficient for the GPU is inconvenient/inefficient for the CPU
and vice versa. Fun!

10 years agoFix ymax in GROUP bounding box
Sam Moore [Thu, 14 Aug 2014 04:54:57 +0000 (12:54 +0800)]
Fix ymax in GROUP bounding box

svg-tests/circlepath.svg has the right box now

BTW: Segfaults in previous commit occur only for quadtree enabled

10 years agoSVG tests are 100% less symlinky
Sam Moore [Thu, 14 Aug 2014 04:48:04 +0000 (12:48 +0800)]
SVG tests are 100% less symlinky

That's the good news.
The bad news is that somewhere along the way a bunch of them became 100% more segfaulty.

10 years agoGroups are a thing and sort of have a bounding box now
Sam Moore [Thu, 14 Aug 2014 04:34:55 +0000 (12:34 +0800)]
Groups are a thing and sort of have a bounding box now

That was what I forgot in the last commit; I added "GROUP".

So, the idea is that GROUP can be used to shade a path.
Maybe. Eventually.

Or, it could just be used to make quad tree magic easier (?)

Or it could do both! (Since you can pretty easily just turn off the shading...
 but we're getting ahead of ourselves a bit there)

Or, if it gets given a name, then it can be used to implement the <use> SVG tag.
And then we can allow recursion (which regular SVG doesn't support).

Wouldn't it be nice...

10 years agoBezier bounds rectangles are calculated correctly
Sam Moore [Thu, 14 Aug 2014 04:21:31 +0000 (12:21 +0800)]
Bezier bounds rectangles are calculated correctly

CPU rendering and SVG parsing uses absolute coordinates.
GPU rendering uses relative coordinates (relative to the bounding box).

The Objects struct stores the absolute bounding boxes now.

Previously it was just using {0,0,1,1} (and thus the GPU's relative coordinates were
equivelant to the CPU's absolute coordinates).

I might have fixed some other things but I can't remember.

10 years agoSupport some more SVG stuff.
David Gow [Wed, 13 Aug 2014 13:38:56 +0000 (21:38 +0800)]
Support some more SVG stuff.

Can now get a dodgy, slightly hacked bit of gnuplot output to
render.

10 years agoClipping for RECT types. Breaks a little.
David Gow [Wed, 13 Aug 2014 13:09:59 +0000 (21:09 +0800)]
Clipping for RECT types. Breaks a little.

When using QuadTrees, RECT_OUTLINE and RECT_FILLED are clipped to
the quadtree node.

This lets you zoom in forever on rectangles with a couple of caveats:
1. This is technically wrong for RECT_OUTLINE, as more lines will be added.
2. There are a couple of issues related to the fact that only one node is
   visible at a time. Notably:
   (a) You lose the infinite precision when stradling a quadtree boundary,
       which will happen eventually.
   (b) Zooming out will show random broken things.

However, if you look at shape.svg, you can see how moving the camera around when
both the RECT and the BEZIER are in view, the RECT moves smoothly and the BEZIER
doesn't.

10 years agoUse correct font metrics from truetype files.
David Gow [Wed, 13 Aug 2014 12:52:57 +0000 (20:52 +0800)]
Use correct font metrics from truetype files.

Kerning, etc. should now be correct, but we use a monospace font
so it doesn't matter.

10 years agoAutomatically generate quadtree children.
David Gow [Wed, 13 Aug 2014 11:49:33 +0000 (19:49 +0800)]
Automatically generate quadtree children.

This mostly works, and does the view reparenting. It doesn't do any clipping,
so we still hit precision issues as (for example) bézier control points are
outside the quadtree node's coordinate system, and become very, very large.

There are some issues with the boundaries of quadtree nodes, as the system
currently can't display two nodes at once. To compensate, it traverses up the
tree until it finds a single node which contains both, though this will be
a distant anscestor if the nodes are distantly related.

Quadtrees are still disabled by default. There are also a couple of minor
changes to the GL code to make it spit out fewer error messages and run
slightly faster on some hardware.

10 years agoI am an idiot: the quadtree code is now fixed.
David Gow [Wed, 13 Aug 2014 08:05:38 +0000 (16:05 +0800)]
I am an idiot: the quadtree code is now fixed.

tl;dr: needed more * by 2.

iab;wtd*: The index buffers on the GPU contain _two_ elements per object,
one for the top left of the object's bounding box, one for the bottom-right.
We were taking that into account when computing the number of indices to give
the DrawElements() call, but not when calculating the offset into the buffer.

Oops.

*: I am bored; want tedious detail

10 years agoA bunch of OpenGL debug annotations.
David Gow [Wed, 13 Aug 2014 04:45:26 +0000 (12:45 +0800)]
A bunch of OpenGL debug annotations.

(Which will probably break compiling on cabellera)

10 years agoSVG transforms now less broken
Sam Moore [Tue, 12 Aug 2014 16:54:35 +0000 (00:54 +0800)]
SVG transforms now less broken

They work for rabbit_simple.svg now; that's pretty cool
Still appear slightly broken for more complicated SVGs (eg: the fox in ipdf/sam).

svg-tests/recursive.svg produces this error in eye of mate:
(eom:7883): librsvg-WARNING **: Circular SVG reference noticed, dropping

(If you have only one group referencing itself, there is no error but no recursion).

10 years agoMerge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Tue, 12 Aug 2014 14:08:36 +0000 (22:08 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code

10 years agoStill-broken quadtree shenanigans!
David Gow [Tue, 12 Aug 2014 14:07:56 +0000 (22:07 +0800)]
Still-broken quadtree shenanigans!

Quadtrees are, therefore, still disabled by default.

10 years agoOnly slightly totally broken SVG transformations
Sam Moore [Tue, 12 Aug 2014 10:29:59 +0000 (18:29 +0800)]
Only slightly totally broken SVG transformations

Argh

The matrices are ((a c e) (b d f) (0 0 1))

*Not* ((a b c) (d e f) (0 0 1))

I guess it's better than the Rect bounds crap.
But still broken.

10 years agoSVG text and line elements
Sam Moore [Tue, 12 Aug 2014 07:14:40 +0000 (15:14 +0800)]
SVG text and line elements

Totally not done properly but whatever

10 years agoMake adding text to the document easier
Sam Moore [Tue, 12 Aug 2014 06:36:47 +0000 (14:36 +0800)]
Make adding text to the document easier

tl;dr Use Document::AddText() to put text in places
Pass the font file in the Document constructor or call Document::SetFont() to change fonts

ts;iwtrm I am not freeing the font data buffer because I strongly suspect we will want to keep it.

You might be able to have arbitrary precision text only documents really easily if you
just re-add the glyphs at a new scale. That might be better than reparenting each individual bezier.

We could add a Document::Finalize() to free memory like the font data
which is used in creating the document but not needed afterwards.

But I want to be able to interactively add text anyway, so there doesn't seem
to be much point at the moment.

10 years agoDeal with groups in SVG parsing
Sam Moore [Tue, 12 Aug 2014 06:08:00 +0000 (14:08 +0800)]
Deal with groups in SVG parsing

ParseSVGNode will recursively parse <svg>, <g> and <group> nodes.

Basically just going to try and implement a bunch more of SVG now.

The "transform" attribute would be a useful one to deal with because svg editors (at least, inkscape)
seem to be rather liberal in using it.

I hope the timestamp for this is correct, I ran git commit --amend but
I don't know if that will fix it.

10 years agoMerge branch 'master' of git://git.ucc.asn.au/ipdf/code
Sam Moore [Fri, 8 Aug 2014 08:08:30 +0000 (16:08 +0800)]
Merge branch 'master' of git://git.ucc.asn.au/ipdf/code

10 years agoYes, we do need to delete m_op somehow.
David Gow [Thu, 7 Aug 2014 14:45:02 +0000 (22:45 +0800)]
Yes, we do need to delete m_op somehow.

10 years ago"fixed" Rational::ToDouble().
David Gow [Thu, 7 Aug 2014 14:30:37 +0000 (22:30 +0800)]
"fixed" Rational::ToDouble().

Previously if the numerator or denominator was > the range of a double,
Rational.ToDouble() would return NaN. We now check for this case, and
discard precision accordingly.

10 years agoFix compiling with Arbint/Gmpint rationals
David Gow [Thu, 7 Aug 2014 14:05:03 +0000 (22:05 +0800)]
Fix compiling with Arbint/Gmpint rationals

10 years agoFix SVG rendering of glyphs.svg
David Gow [Thu, 7 Aug 2014 13:40:33 +0000 (21:40 +0800)]
Fix SVG rendering of glyphs.svg

- Convert Quadratics -> Cubics properly
- Correctly handle relative movements in LineTo.

10 years agoThe power of truetype font rendering!
David Gow [Thu, 7 Aug 2014 13:34:33 +0000 (21:34 +0800)]
The power of truetype font rendering!

10 years agoMake it work on Cabellera (again)
Sam Moore [Thu, 7 Aug 2014 03:44:01 +0000 (11:44 +0800)]
Make it work on Cabellera (again)

I keep forgetting I shouldn't use C++11 features
THEY ARE JUST SO CONVENIENT!

:(

Clownfish has C++11 but the open source AMD drivers don't like
geometry shaders and sulix threatened me with dire consequences
of installing fglrx...

Also fix the symlinks in svg-tests

10 years agoMerge branch 'master' of git.ucc.asn.au:/ipdf/code
Sam Moore [Thu, 7 Aug 2014 02:46:46 +0000 (10:46 +0800)]
Merge branch 'master' of git.ucc.asn.au:/ipdf/code

Dammit I hate merges

10 years agoCubic Beziers and more SVG stuff
Sam Moore [Thu, 7 Aug 2014 02:42:02 +0000 (10:42 +0800)]
Cubic Beziers and more SVG stuff

Cubic Beziers!
Actually transform the coordinates properly!

Sort of maybe kind of render shape.svg correctly*

* Shading and stroke width will be available in the premium edition, order today for $99.99

10 years agoMerge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Wed, 6 Aug 2014 16:09:37 +0000 (00:09 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code

10 years agoSome QuadTree fixes.
David Gow [Wed, 6 Aug 2014 16:09:23 +0000 (00:09 +0800)]
Some QuadTree fixes.

10 years agoMerge branch 'master' of git.ucc.asn.au:/ipdf/code
Sam Moore [Wed, 6 Aug 2014 10:14:14 +0000 (18:14 +0800)]
Merge branch 'master' of git.ucc.asn.au:/ipdf/code

At least I set my time correctly this time. ho ho.

10 years agoThe view size is not 640x480 and hasn't been for a long time
Sam Moore [Wed, 6 Aug 2014 10:11:40 +0000 (18:11 +0800)]
The view size is not 640x480 and hasn't been for a long time

So taking that plus some other stuff into account, the CPU renderer
for Beziers now uses the same number of lines as the GPU renderer!

Except when the bezier is a straight line. Then it just uses 1.

They still look slightly different. There is probably something wrong
with my Bresenham implementation.

10 years agoQuadTree should segfault less frequently.
David Gow [Wed, 6 Aug 2014 03:56:03 +0000 (11:56 +0800)]
QuadTree should segfault less frequently.

Still gives incorrect results w/ GPU transform.

10 years agoFix Bézier CPU rendering.
David Gow [Tue, 5 Aug 2014 15:10:28 +0000 (23:10 +0800)]
Fix Bézier CPU rendering.

10 years agoFix beziers on GPU.
David Gow [Tue, 5 Aug 2014 14:54:25 +0000 (22:54 +0800)]
Fix beziers on GPU.

We can now render an SVG correctly(ish)! Woah!

10 years agoFix a huge bunch of memory corruption bugs in GL
David Gow [Tue, 5 Aug 2014 14:19:26 +0000 (22:19 +0800)]
Fix a huge bunch of memory corruption bugs in GL

It now is equally broken across Intel and nVidia.

The brokenness can be very pretty, though.

10 years agoDon't try to unmap buffers which aren't mapped.
David Gow [Tue, 5 Aug 2014 13:48:59 +0000 (21:48 +0800)]
Don't try to unmap buffers which aren't mapped.

Fixes the GL_INAVLID_OPERATION that snuck in: this would occur
when calling GraphicsBuffer::Resize() on an unmapped, non-invalidated buffer.

10 years agoPerpetrate SVG on the codebase
Sam Moore [Tue, 5 Aug 2014 18:46:41 +0000 (02:46 +0800)]
Perpetrate SVG on the codebase

Well, parts of it.
We can have black and white SVG only.
I think it's currently buggy.

I figure we should probably be able to actually parse a document format.
And SVG, despite being XML, seems like the least terrible.

Using pugixml for XML parsing and horrible string tokenising because
SVG is not really a DOM language because of the "d" attribute (-_-)

Did I mention it was the least terrible?

Also, there seem to be lots and lots of bugs with things,
including Quadtree rendering of Beziers and actually just  GPU rendering of more than one
Bezier in general.

Also I compiled atril without zoom limits but it crashes
due to things not related to precision. So we're beating atril I guess. Woo!

10 years agoCS Lab machines have met their nemesis
Sam Moore [Mon, 4 Aug 2014 07:52:58 +0000 (15:52 +0800)]
CS Lab machines have met their nemesis

The ongoing adventures of overcomplicated makefile land.

David is dictating this commit message by the way,

PS:
 They are i686 and only g++0x from before 0x

Tune in next week for another exciting episode (or installment, you, the
viewer, decide!) of randomly ifdefing things out! Will our heroes
successfully defeat the 32 bit long? Or will they perish in an integer
overflow?

(I think the project is beginning to affect our minds)

10 years agoApparently things were done
Sam Moore [Mon, 4 Aug 2014 11:16:58 +0000 (19:16 +0800)]
Apparently things were done

10 years agoRemove terrible "pow()" functions
Sam Moore [Sun, 3 Aug 2014 13:55:56 +0000 (21:55 +0800)]
Remove terrible "pow()" functions

There are many reasons why that was terrible and it finally all came apart
in a segfaultastic display.

We now have Power which only works for integer powers
But we only need those at the moment anyway.

10 years agoVFPU derpage fixed
Sam Moore [Sun, 3 Aug 2014 12:50:10 +0000 (20:50 +0800)]
VFPU derpage fixed

In my defence, hex and binary are only 14 digits apart

10 years agoAdd VFPU::Float (but it is broken)
Sam Moore [Tue, 29 Jul 2014 14:36:53 +0000 (22:36 +0800)]
Add VFPU::Float (but it is broken)

Fails every single realops test.
Also it's stuck at 32 bits still.

10 years agoUse "Real" in CPU renderer for filled circles
Sam Moore [Tue, 29 Jul 2014 14:12:16 +0000 (22:12 +0800)]
Use "Real" in CPU renderer for filled circles

10 years agoGet it compiling on Cabellera (g++0x not c++11)
Sam Moore [Fri, 25 Jul 2014 05:03:15 +0000 (13:03 +0800)]
Get it compiling on Cabellera (g++0x not c++11)

... But at what cost?

10 years agoMore QuadTree code.
David Gow [Wed, 23 Jul 2014 04:50:48 +0000 (12:50 +0800)]
More QuadTree code.

10 years agoFix some quadtree rendering bugs.
David Gow [Wed, 16 Jul 2014 07:40:29 +0000 (15:40 +0800)]
Fix some quadtree rendering bugs.

10 years agoQuadtree Rendering for CPU transorm+render
David Gow [Wed, 16 Jul 2014 06:48:11 +0000 (14:48 +0800)]
Quadtree Rendering for CPU transorm+render

10 years agoQuadTree Rendering with GPU coord transform.
David Gow [Tue, 15 Jul 2014 13:26:52 +0000 (21:26 +0800)]
QuadTree Rendering with GPU coord transform.

10 years agoWe should compile even if REAL is not 5
David Gow [Tue, 15 Jul 2014 13:10:05 +0000 (21:10 +0800)]
We should compile even if REAL is not 5

10 years agoActually add the Quadtree coordinate code
David Gow [Mon, 14 Jul 2014 15:12:56 +0000 (23:12 +0800)]
Actually add the Quadtree coordinate code

10 years agoQuadtree transforms
David Gow [Mon, 14 Jul 2014 01:24:00 +0000 (09:24 +0800)]
Quadtree transforms

10 years agoMerge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Mon, 7 Jul 2014 16:02:11 +0000 (00:02 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code

10 years agoQuadtrees! (Almost)
David Gow [Mon, 7 Jul 2014 16:01:55 +0000 (00:01 +0800)]
Quadtrees! (Almost)

10 years agoChange Rational<Arbint> -> Rational<Gmpint>
Sam Moore [Mon, 7 Jul 2014 08:46:12 +0000 (16:46 +0800)]
Change Rational<Arbint> -> Rational<Gmpint>

Works better (not surprising). Can change back @real.h:52

10 years agoNow with GNU MultiPrecision (GMP) integers
Sam Moore [Mon, 7 Jul 2014 08:19:50 +0000 (16:19 +0800)]
Now with GNU MultiPrecision (GMP) integers

gmpint.h is (in theory) mostly inline and shouldn't add much overhead
and was simpler than trying to understand the C++ "binding".

The Str() function is kind of terrible but that can't be helped.

Also fixed bug in realops tester (even the testers have bugs...)
And removed asm tester because the asm function is gone.

The bezier testers now don't compile, I don't think we need them anymore.

10 years agoMerge branch 'master' of git.ucc.asn.au:ipdf/code
David Gow [Mon, 7 Jul 2014 05:15:59 +0000 (13:15 +0800)]
Merge branch 'master' of git.ucc.asn.au:ipdf/code

10 years agoZooming is now sligtly less slow.
David Gow [Mon, 7 Jul 2014 05:14:23 +0000 (13:14 +0800)]
Zooming is now sligtly less slow.

10 years agoC++11 lambdas - are they really worth it?
Sam Moore [Mon, 7 Jul 2014 03:48:36 +0000 (11:48 +0800)]
C++11 lambdas - are they really worth it?

10 years agoDivide some numbers by 5.
David Gow [Mon, 7 Jul 2014 03:10:59 +0000 (11:10 +0800)]
Divide some numbers by 5.

10 years agoFix GPU rendering a bit. Will probably break >1 ob
David Gow [Mon, 7 Jul 2014 02:57:20 +0000 (10:57 +0800)]
Fix GPU rendering a bit. Will probably break >1 ob

10 years agoMerge branch 'master' of git.ucc.asn.au:/ipdf/code
Sam Moore [Mon, 7 Jul 2014 01:53:15 +0000 (09:53 +0800)]
Merge branch 'master' of git.ucc.asn.au:/ipdf/code

We both fixed bugs.

10 years agoClear the carry/borrow flag before add/sub
David Gow [Mon, 7 Jul 2014 01:49:48 +0000 (09:49 +0800)]
Clear the carry/borrow flag before add/sub

10 years agoArbint subtraction/addition deal with borrow/carry correctly, maybe
Sam Moore [Mon, 7 Jul 2014 01:49:20 +0000 (09:49 +0800)]
Arbint subtraction/addition deal with borrow/carry correctly, maybe

Eventually they will be right.

This still doesn't fix the wierd bezier bug or the growing digits really fast (exponential?). I suspect the former is related
to pow(Rational<Arbint>, Rational<Arbint>) and the latter probably makes sense if you do the theory (considering how fast Rational<int64_t> overflowed).

10 years agoArbint subtraction should work* now
Sam Moore [Mon, 7 Jul 2014 01:17:12 +0000 (09:17 +0800)]
Arbint subtraction should work* now

Yes I was being clever and resizing if sub.m_digits.size() > this->m_digits.size()
But I forgot about when this->m_digits.size() > sub.m_digits.size()

Passes tests/realops.test now!

On the other hand, CPU rendering of Beziers doesn't work anymore.
I think it's just drawing two lines instead of lots of them.

10 years agoMore debugging, harder realops test
Sam Moore [Sun, 6 Jul 2014 14:41:19 +0000 (22:41 +0800)]
More debugging, harder realops test

10 years agoMaybe this is more correct. realops likes it.
David Gow [Sun, 6 Jul 2014 14:31:09 +0000 (22:31 +0800)]
Maybe this is more correct. realops likes it.

10 years agodigit_t is now unsigned, asm division for 1 digit
David Gow [Sun, 6 Jul 2014 14:23:57 +0000 (22:23 +0800)]
digit_t is now unsigned, asm division for 1 digit

We now do the "two's complement" in SubBasic by hand. It is maybe even
correct.

10 years agoRational<Arbint> now passes realops.test
David Gow [Sun, 6 Jul 2014 13:51:10 +0000 (21:51 +0800)]
Rational<Arbint> now passes realops.test

10 years agoArbint now does sign in division correctly
Sam Moore [Sun, 6 Jul 2014 12:30:40 +0000 (20:30 +0800)]
Arbint now does sign in division correctly

The tester still sometimes picks up a fith Rational<Arbint> /= operation though.

10 years agoMore testing particularly of negatives
Sam Moore [Sun, 6 Jul 2014 12:17:09 +0000 (20:17 +0800)]
More testing particularly of negatives

10 years agoMerge branch 'master' of git.ucc.asn.au:/ipdf/code
Sam Moore [Sun, 6 Jul 2014 11:45:52 +0000 (19:45 +0800)]
Merge branch 'master' of git.ucc.asn.au:/ipdf/code

Dammit I forgot to `git stash; git pull; git stash apply`

10 years agoImproved "realops" tester
Sam Moore [Sun, 6 Jul 2014 11:44:50 +0000 (19:44 +0800)]
Improved "realops" tester

And there are signs of serious problems in Arbint too!

10 years agoSlightly less memory errors
Sam Moore [Sun, 6 Jul 2014 10:19:34 +0000 (18:19 +0800)]
Slightly less memory errors

Using more std::vector and less memcpy/memset etc.
Still seems to have issues but not segfaulting as much.

Fixed m_sign missing in = operator

10 years agoFix a warning/compile error.
David Gow [Sun, 6 Jul 2014 09:50:49 +0000 (17:50 +0800)]
Fix a warning/compile error.

10 years agoHorribly unreliable Arbint's and Rational<Arbint>'s
Sam Moore [Sun, 6 Jul 2014 09:32:28 +0000 (17:32 +0800)]
Horribly unreliable Arbint's and Rational<Arbint>'s

Changes from before: Arbint's use a division algorithm based on bitshifting.

So, you might get a random segfault (if you scroll you will definitely get a random segfault)
and pretty much every single operation with Rational<Arbints> gives you an accuracy warning...

And yet somehow I can render a Bezier. Really slowly.

10 years agoSome initial QuadTree goodness.
David Gow [Sun, 6 Jul 2014 08:30:39 +0000 (16:30 +0800)]
Some initial QuadTree goodness.

UCC git Repository :: git.ucc.asn.au