EntityHidden(), BufferWidth()...lotsa new commands

Blitz3D Forums/Blitz3D Programming/EntityHidden(), BufferWidth()...lotsa new commands


No they don't. They go through all the entities that exist, in the order they were created, regardless of hierarchy.



Well they clearly link only to siblings here. Could you post some code showing how you achieve sequential access. I need some basis for comparison. Hmmm. Unless you have updated the DLL to change their behaviour? Because Entity+4 and Entity+8 are the sibling links. Parent and child links are also available as mentioned above. If you are only using +4,8 then maybe things have changed.


[edit]
It's now pretty obvious your code is based on an old version. My info is based on 1.87. For some obscure reason I choose to use the latest version. But I guess I would be reluctant to upgrade if I had a lot of code in production based on these sort of hacks, because it is no five minute job uncovering changes in structures/methods. (Another warning to the unwary). Anyways, ignoring the potential inconveniences...

EntityAutofade values floats at +604,608 (for meshes)
Autofade flag int at +600 (1 if autofade enabled).
Number of surfaces int at +648

Entitycolor, Shininess, FX etc
Brush Stuctures are addressed at entity+580 and 584.
In my tests so far they both address the same structure, unless entityautofade is enabled.
The address changes between 2 or more locations, probably to support tweening and autofade. In that respect the address at +584 may yield more accurate results in respect of current alpha.
setting the byte at entity+588 refreshes the entity with the contents of this structure.
The brush structure is described below. Note the structure is linked directly, there is no offset+0 address.
........................

A brush structure is addressed at brush+0
BrushBlend is an int at +4
Highest Texture layer used is an int at +8
Brushcolor are floats at +16,20,24. These relate to the diffuse colors.
BrushShininess is a float at +28
Brushalpha is a float at +32
BrushFX is an int at +40
I have not found a way to manipulate Ambient or specular colors yet or even know where they are stored. I expect blitz just hardwires them as it does the emmisive colors when you use fx 1.


For each texture layer 2 texture structs are addressed
The first at +44,60,76,92,108,124,140,156
The second at +172,176,180,184,188,192,196,200
In the first structure addressed at +44 etc (which is the texturebuffer structure)...
TextureFlags are stored in an int at +0 (see note below).
buffer width and height and depth are ints at +92,96,100
The second struct address is also the struct addressed at Texture+0 (See below)

............

A Texture structure is addressed at texture+0
TextureBlend at +24
TextureCoords at +28.
TextureScale at +36,40
TexturePosition at +44,48
textureRotation at +52
Transform matrix floats stored at +60,64,68,72,76,80,84,88
Xscale at 60, Xskew at 64, Yskew at 72, Yscale at 76, Xoffset at 84, Yoffset at 88.
Setting the bytes at +56,57 to 1 "activates" these values.
Another struct addressed at +4
In this struct the texture name string is addressed at +8 and the length of this string is at +12

Have not found textureflags reliably yet though, this structure is a bit exotic. [edit] OK, Found them...

Note: Texture Flags are stored in the Int at texturebuffer+0. Bit 13 (4096) is always set (for whatever reason). If bit 3 (masking) is set then bits 1 and 2 will also be set. Texturebuffer+104 is set to 4 if the texture is masked otherwise it is set to 2. I suspect some of the Ints that follow this relate to pixel format and masks, but I have not figured those out yet, that is a whole other ball game.