aboutsummaryrefslogtreecommitdiff
path: root/grid.c (follow)
Commit message (Collapse)AuthorAge
* Apply the rotation in Penrose grid descriptions by rotating in theSimon Tatham2011-05-06
| | | | | | | | | | | | | | | | | | | | 4-vector representation, rather than mucking about with sines and cosines after grid generation. _Should_ make no difference in the generated grids (there's a theoretical risk of an unlucky rounding error just about managing to push some point in or out of bounds, but I think it's vanishingly small), but simplifies the coordinate- flattening procedure, and in particular increases its chance of getting vertical lines actually vertical. (Prior to this change, the game ID 10x10t12:G2554,-31,108_a3b12h0a212a3d102b2a23a2e3b01b0a2c2a0c0 was generating a not-quite-vertical edge at top left, in the Java port but not on Linux; I suspect differences in sin and cos as the cause of the discrepancy. With the rotation done like this, the points' x-coordinates are now computed without reference to their y-coordinates.) [originally from svn r9168]
* Portability fixes, mostly from James for Palm purposes. MostlySimon Tatham2011-05-04
| | | | | | | | additions of missing 'static' and explicit 'void' in parameter lists, plus one or two other things like explicitly casting chars in variadic argument lists to int and using DBL_MAX if HUGE_VAL isn't available. [originally from svn r9166]
* Fix two memory leaks reported by Tiago Dionizio in recent LoopySimon Tatham2011-04-26
| | | | | | development. [originally from svn r9163]
* Forgot to set 'has_incentre' on triangular grids, which don't useSimon Tatham2011-04-25
| | | | | | grid_face_add_new(). Oops. [originally from svn r9161]
* From James Harvey (via a period of collaborative polishing), a patchSimon Tatham2011-04-24
| | | | | | | | | | | | | | | | | | to add two kinds of Penrose tiling to the grid types supported by Loopy. This has involved a certain amount of infrastructure work, because of course the whole point of Penrose tilings is that they don't have to be the same every time: so now grid.c has grown the capacity to describe its grids as strings, and reconstitute them from those string descriptions. Hence a Penrose Loopy game description consists of a string identifying a particular piece of Penrose tiling, followed by the normal Loopy clue encoding. All the existing grid types decline to provide a grid description string, so their Loopy game descriptions have not changed encoding. [originally from svn r9159]
* Oops: initialise that new 'has_incentre' flag to false, otherwise theSimon Tatham2011-04-23
| | | | | | | game will sometimes pick random incentres in place of the carefully computed ones. Ahem. [originally from svn r9158]
* Move most of face_text_pos() into grid.c, leaving in loopy.c only theSimon Tatham2011-04-23
| | | | | | | | | | part that converts from abstract grid coordinates into screen coordinates. This should speed up window-resizing by eliminating pointless reiteration of the complicated part of the algorithm: now when a game_drawstate is renewed, only the conversion into screen coordinates has to be redone. [originally from svn r9157]
* Another patch from Chris Moore implementing two more grid types, bothSimon Tatham2011-02-24
| | | | | | involving dodecagons. [originally from svn r9109]
* Retire the 'middle_face' field in 'struct grid', together with theSimon Tatham2011-02-24
| | | | | | | | | | | overly complicated algorithm that uses it to home in on the grid edge closest to a mouse click. That algorithm is being stressed beyond its limit by the new grid type, and it's unnecessary anyway given that no sensibly sized puzzle grid is going to be big enough to make it prohibitively expensive just to do the trivial approach of iterating over all edges and finding the closest of the eligible ones. [originally from svn r9108]
* Patch from Chris Moore to implement an extra grid type, the 'floret'Simon Tatham2011-02-23
| | | | | | pentagonal tiling. [originally from svn r9107]
* Patch from Chris Moore to improve the generality ofSimon Tatham2011-02-23
| | | | | | | grid_nearest_edge(), by having it search harder for a better dot to move to in the first loop. [originally from svn r9106]
* Since the lack of this has caused portability issues in the past:Simon Tatham2008-09-13
| | | | | | | add "-ansi -pedantic" to the main Unix makefile, and clean up a few minor problems pointed out thereby. [originally from svn r8175]
* Patch from James H to make new-Loopy port more easily.Simon Tatham2008-09-10
| | | | [originally from svn r8174]
* How did I manage to check this in without actually trying to buildSimon Tatham2008-09-07
| | | | | | | | | on Windows at all?! Fix some departures from the C standard, mostly declaring variables after a statement has already been issued in the same block. MSVC is picky about this where gcc is forgiving, and TBH I'd change the latter given the choice. [originally from svn r8166]
* Completely re-engineered version of Loopy, courtesy of LambrosSimon Tatham2008-09-06
Lambrou. Now capable of handling triangular and hexagonal grids as well as square ones, and then a number of semiregular plane tilings and duals of semiregular ones. In fact, most of the solver code supports an _arbitrary_ planar graph (well, provided both the graph and its dual have no self-edges), so it could easily be extended further with only a little more effort. [originally from svn r8162]