Announcement

Collapse
No announcement yet.

bsp version control

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • bsp version control

    (('B' << 0) | ('S' << | ('P' << 16) | ('2'<<24))

    I can't do that in HaXe. HaXe expects those string literals to be ints.

    I googled "c++ bitshift string literals" and other such things but, I can't find anything that tells me what type of int value those characters are perceived as.

    Is it Oct? Dec? Hex? Something Else?

    When I get past this little baby hump I should be able to parse 2PSB, BSP & BSP2. I already made all of the other necessary changes.
    Last edited by MadGypsy; 08-20-2016, 07:24 AM.
    http://www.nextgenquake.com

  • #2
    Its ascii...

    BSP=29 (vanilla)
    2PSB=0x42535032 (node+leaf bounds are still shorts, all other shorts expanded to int)
    BSP2=0x32505342 (node+leaf bounds are floats, all other shorts expanded to int)
    Some Game Thing

    Comment


    • #3
      Protip: Those aren't string literals!

      'B' is a number with the value of 66 (like how 'A' = 65 in ascii)

      int a = 'B'; // a is now 66
      Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

      So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

      Comment


      • #4
        thank you both

        @string literals

        I didn't know how else to describe it. I knew they weren't shifting "BSP2".

        @all shorts ints

        nope... not marksurfaces... Well, according to bspfile.h in Fitzquake Mark V r15. I based my structs on that file.
        Last edited by MadGypsy; 08-20-2016, 12:25 PM.
        http://www.nextgenquake.com

        Comment


        • #5
          'B' would normally be referred to as a character constant.

          and they're ints, not shorts.
          Some Game Thing

          Comment


          • #6
            @char constant

            Ah! I forgot about that term. I don't think any of the languages that I know allow for them, at least not with the string literal syntax.

            aside:
            I'm about 80% of the way through porting my AS3 engine to HaXe. I've been using numerous quake sources to develop this version. The BSP part of my engine should function more or less identical to an advanced quake engine. I don't intend to post much about it til I get quite a bit further but, I wanted you guys to know that I never threw in the towel on my quakelike engine. I just needed some time to learn another language and nail down a fairly solid understanding of C(whatever) in a "fundamentals" regard. I'm more or less reading quake sources without any real questions...at least no questions that I can't figure out on my own, so far. HaXe is more or less what would happen if AS3 and C(probably ++) had a baby so, reading C(whatever) is getting easier all the time.
            http://www.nextgenquake.com

            Comment


            • #7
              @ints not shorts

              to be clear you are saying this is wrong?
              http://www.nextgenquake.com

              Comment


              • #8
                that bss abuse would never fit within quake's dos 8mb ram target.
                the '#ifndef QUAKE_GAME' means that its not used for the engine - its dead code.

                there's also none of the bsp2 struct defs there either.
                with bsp29, marksurfaces is shorts. with bsp2, either kind, its ints.
                Some Game Thing

                Comment


                • #9
                  @no bsp2 structs there

                  The non bsp29 structs are all higher up on the document but, marksurfaces does not have a version specific struct anywhere in the entire document. It's all good, I made sure my structs match what you said.

                  My method makes adding these versions really simple. 2PSB extends BSP29 and overrides accordingly...BSP2 extends 2PSB and overrides readNodes/Leafs. I figured since the enhanced versions are just a modification of the version before it, extending and overriding the specifics made the most sense. Everything gets unified to BSP_t and at that point it really doesn't matter what version it was.

                  Haxe doesn't differentiate types as accurately as short/long/int* within a struct so, the only thing I really had to do was replace BBoxShort_t with BBox_t for all versions. I simply read short/int into the expected float values accordingly and I don't have to create any custom structs per version.

                  *this would all just be Int
                  Last edited by MadGypsy; 08-21-2016, 07:25 AM.
                  http://www.nextgenquake.com

                  Comment

                  Working...
                  X