[Ohrrpgce] SVN: teeemcee/10959 Add slice clamping as a privileged sliceedit option and fix compile erro

Ralph Versteegen teeemcee at gmail.com
Thu Jan 31 18:33:59 PST 2019


On Fri, 1 Feb 2019 at 14:19, James Paige <Bob at hamsterrepublic.com> wrote:
>
> > These days, I always try to make the FB and HS interfaces to something the same if possible.
>
> This is wise (if possible!)
>
> > or even storing horiz and vert settings as bits in a single int
>
> I dislike these kind of bits. I know we do it a bunch, but it always bugs me.

I WISH that Slice.Fill and Slice.FillMode were an array of two bits
instead of the incredibly unwieldy way it works!
I think actually we hardly use bits and masks at all. In a C program
everything would be in bits!
Also, I don't like that Slice is huge (now 256 bytes plus slice data)
partially due to all these 32bit properties that only have 2-3
possible values, and you sometimes have tens of thousands of slices. I
have been considering redefining bool as a byte instead of a int, but
that will probably break something. FB also supports C-style bitfields
(eek!) but you can only store 1 in a bitfield, not -1, so it's not
safe for bools either.

But admittedly, putting Vert and Horiz settings in the same int would
be very annoying for implementing it in the slice editor, so I won't
do that.

>
> On Thu, Jan 31, 2019 at 7:28 PM Ralph Versteegen <teeemcee at gmail.com> wrote:
>>
>> The changes I was thinking of making:
>>
>> -I was thinking of having a "Clamp left+right" setting (in fact I
>> already implemented it), like the way the showRight and showLeft
>> RelPos options work: they first clamp to one screen edge, then the
>> other, preferring to show either the left or right part of a
>> larger-than-the-screen object. But this is only useful if the slice
>> *isn't* Aligned to an edge, because in that case the Align effectively
>> clamps to one Edge, and Clamp can clamp the other. For example if you
>> have a tooltip at some point on the screen, and you want it to shift
>> to remain on-screen. Seems like that needs Left+Right+Top+Bottom
>> clamping, scripted or not. I had thought that this could just be
>> accomplished by nesting two clamping slices, but actually that doesn't
>> seem to work.
>>
>> -Rather than using the alignLeft, alignRight constants, I was thinking
>> of using a different enum, so that the default value is 0, not 1, to
>> simplify the code, or even storing horiz and vert settings as bits in
>> a single int. Hmm, but I definitely want to use the existing align
>> constants in scripts so there's no confusion, if there are only Left,
>> Right and None options. These days, I always try to make the FB and HS
>> interfaces to something the same if possible.
>>
>> On Fri, 1 Feb 2019 at 06:57, James Paige <Bob at hamsterrepublic.com> wrote:
>> >
>> > I'll resist the temptation until you declare it stable :)
>> >
>> > On Thursday, January 31, 2019, <subversion at hamsterrepublic.com> wrote:
>> >>
>> >> teeemcee
>> >> 2019-01-31 06:10:48 -0800 (Thu, 31 Jan 2019)
>> >> 244
>> >> Add slice clamping as a privileged sliceedit option and fix compile errors
>> >>
>> >> I didn't mean to check in the slice clamping stuff already! There's a chance I
>> >> might change how it works, creating a file format incompatibility if you
>> >> actually use it.
>> >> ---
>> >> U   wip/sliceedit.bas
>> >> U   wip/slices.bas
>> >> U   wip/util.bi
>> >> _______________________________________________
>> >> Ohrrpgce mailing list
>> >> ohrrpgce at lists.motherhamster.org
>> >> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>> >
>> > _______________________________________________
>> > Ohrrpgce mailing list
>> > ohrrpgce at lists.motherhamster.org
>> > http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>> _______________________________________________
>> Ohrrpgce mailing list
>> ohrrpgce at lists.motherhamster.org
>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org


More information about the Ohrrpgce mailing list