flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > How define vEye as World D3DXVECTOR4 ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 2134
Roman 22 Sep 2026, 20:40
fasmw 1.73
Code:
struct D3DXVECTOR4
       x dd 0
       y dd 0
       z dd 0
       w dd 0
ends

vEye: World D3DXVECTOR4


movss xmm0,[vEye.z] ;fasm get error

movss xmm0,[World.z] ;fasm compiled fine
    


My another code used vEye.z not World.z

I want somehow defined World as vEye

Using virtual for this ?
Post 22 Sep 2026, 20:40
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1238
Location: Russia
macomics 23 Sep 2026, 01:18
Code:
struct D3DXVECTOR4
       x dd 0
       y dd 0
       z dd 0
       w dd 0
ends

vEye D3DXVECTOR4
virtual at vEye
World D3DXVECTOR4
end virtual


movss xmm0,[vEye.z]

movss xmm0,[World.z]    

ADD:
Code:
struc assume Base*, Type& { if ~ Type eq
        virtual at Base
            . Type
            if ~ definite .Length
                label .Length at ( $ - $$ )
            end virtual
        end virtual
    else
        label . at Base
        label .Length at 0
    end if
}
struct D3DXVECTOR4
       x dd 0
       y dd 0
       z dd 0
       w dd 0
ends

World D3DXVECTOR4
vEye assume World, D3DXVECTOR4


movss xmm0,[vEye.z]

movss xmm0,[World.z]    
Post 23 Sep 2026, 01:18
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 2134
Roman 23 Sep 2026, 05:23
Thanks.
This work too
Code:
struc assume Base*, Type& { if ~ Type eq
        virtual at Base
            . Type
            ;if ~ definite .Length
            ;    label .Length at ( $ - $$ )
            ;end virtual
        end virtual
    else
        label . at Base
        label .Length at 0
    end if
}

World D3DXVECTOR4
vEye assume World, D3DXVECTOR4
    
Post 23 Sep 2026, 05:23
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.