Jump to content

Megumi

Members
  • Posts

    6
  • Joined

  • Last visited

Megumi's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. You mentioned that. Why exactly are you changing it? Red Alert uses bitfields to pack all boolean values, this is a optimisation that the Watcom compiler did at the time, and something that is not longer done (as we don't have the constraints they at the time). Second, is that the enumerations where packed depending on the size of the largest entry, so where UNIT_NONE would equal "-1" 32bit integer in our codebase, Red Alert stores this is a "-1" 8bit char. This causes more headaches that you would think. The same goes for some structures too, but this was intentional and no longer applies to us. template<unsigned _Count, typename _Type> struct BitFlags { enum { BitsInSpan = 8, NumSpans = (((_Count + (BitsInSpan - 1)) / BitsInSpan)) }; char m_Value[NumSpans]; }; An enum data type can be similar. This would make it easy to access and work with enums and bitflags of variable length. For example: enum EMyType { MYTYPE_NONE = -1, MYTYPE_0, MYTYPE_1, MYTYPE_2, MYTYPE_3, MYTYPE_4 }; typedef BitFlags<5, EMyType> MyTypeBitFlags; Would result in a 8 bit representation of EMyType. And get the flag with something like void SetFlag(EMyType value) { if (value == MYTYPE_NONE) // -1 { return; // or something else you want -1 to do } m_Value[value / BitsInSpan] |= (1 << value % BitsInSpan) } void RemoveFlag(EMyType value) { if (value == MYTYPE_NONE) // -1 { return; } m_Value[value / BitsInSpan] &= ~(1 << value % BitsInSpan) } bool HasFlag(EMyType value) { if (value == MYTYPE_NONE) { return false; } return m_Value[value / BitsInSpan] & (1 << value % BitsInSpan) } Pretty much no effort involved in having variable size bit fields.
  2. I still find it strange that you use that wine stuff while the wrapper posted on page 2 does everything that is needed on its own.
  3. Doesn't matter, the wrapper does everything you need.
  4. Yeah and I said you can just set both in one place, which in my opinion is more comfortable.
  5. As said, just setting that one option to 1 worked perfectly fine on its own.
  6. So any idea about bad framerates? When I tried Bibbers launchers on Win8 before he uploaded them I used that ddraw wrapper linked here, which worked flawlessly on RA2 where I get all the fps I want with just setting "ForceDirectDrawEmulation = 1" while for TS it did nothing and the game is jumpy as hell (as in it runs a few sec, then slows down, catches up again, slows down, etc). That happens independently of the wrapper, though I didn't test the other options yet. Arg, nevermind, setting "NoVideoMemory = 1" solves that issue. Oh and if someone is wondering how to fix the 16 bit error for windowed stuff (as Win8 x64 doesn't have the option to set the desktop to 16 bit anymore): http://thundermods.net/intern/Lilith/sun.jpg
×
×
  • Create New...