How to programmicly convert rgb(255,255,255) to $FFFF00 ???
How to programmicly convert rgb(255,255,255) to $FFFF00 ???
Does anybody know how to programmicly convert rgb(255,255,255) to $FFFF00 ???
-
- Enthusiast
- Posts: 499
- Joined: Wed Sep 17, 2003 9:17 pm
- Location: Southern California
- Contact:
They should probably take bytes but... then it doesn't work correctly...
Code: Select all
Procedure RGB_24(r.l,g.l,b.l)
ProcedureReturn (r<<16)|(g<<8)|b
EndProcedure
Procedure RGB_16_565(r.l,g.l,b.l)
ProcedureReturn (r<<11)|(g<<5)|b
EndProcedure
Procedure RGB_16_555(r.l,g.l,b.l)
ProcedureReturn (r<<10)|(g<<5)|b
EndProcedure
Skunk, check your sig, "development" is typo'd..
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
-
- Enthusiast
- Posts: 499
- Joined: Wed Sep 17, 2003 9:17 pm
- Location: Southern California
- Contact:
Well, what I am basically trying to do is color vertices per Danillo's sample near the bottom of viewtopic.php?t=8938
And in the example, it is called by ...
So I am trying to have it pass RGB values, which I am assuming needs to be HEXed before passed or so. Thus the reason for the need of programmically hex the RGB values.
With what you have above, may work, if I could figure out what video card format the card runs on
I think ...
Code: Select all
Procedure SetSprite3DColor(sprite,a,b,c,d)
;
; set a color for the 4 Sprite3D corners
;
*p.PB_Sprite3D
;!extrn _PB_Sprite3D_ObjectsArea
!MOV dword EBX,[_PB_Sprite3D_ObjectsArea]
!MOV dword EAX,136
!MUL dword [ESP]
!ADD dword EBX,EAX
!MOV dword [ESP+20],EBX
*p\Vertice[0]\color = $FF000000+a
*p\Vertice[1]\color = $FF000000+b
*p\Vertice[2]\color = $FF000000+c
*p\Vertice[3]\color = $FF000000+d
EndProcedure
Code: Select all
SetSprite3DColor(1,$FFFF00,$FF0000,$0000FF,$00FFFF)
With what you have above, may work, if I could figure out what video card format the card runs on

-
- Enthusiast
- Posts: 203
- Joined: Sat Apr 26, 2003 6:33 pm
- Location: Spain
- Contact:
-
- Enthusiast
- Posts: 203
- Joined: Sat Apr 26, 2003 6:33 pm
- Location: Spain
- Contact:
Unfortuinately, no go
For example, if you replace the SetSprite3DColor line with
It will be a blank texture. so I dont think that is working properly, even if I change the transparency to 0. I do not know if it is Danilo's code or the RGB thing isnt working properly.

Code: Select all
SetSprite3DColor(1,RGB(255, 255, 255) + (255 << 24) ,$FF0000,$0000FF,$00FFFF)
-
- Enthusiast
- Posts: 203
- Joined: Sat Apr 26, 2003 6:33 pm
- Location: Spain
- Contact:
Not here
It gives a blank white texture.
Ok, if we cant figure this out, the I'll know it's a bug in Danilo's code.
Ah, it turns out that his compiled exe uses different code then what is provided in the source ..
Danilo, if your reading this, please provide the code used in the EXE. Since the EXE works but the source code does not.
Code: Select all
SetSprite3DColor(1,RGB(255, 0, 255) ,RGB(255, 0, 0),RGB(255, 255, 0),RGB(255, 0, 200))
Ok, if we cant figure this out, the I'll know it's a bug in Danilo's code.
Ah, it turns out that his compiled exe uses different code then what is provided in the source ..
Danilo, if your reading this, please provide the code used in the EXE. Since the EXE works but the source code does not.
-
- Enthusiast
- Posts: 203
- Joined: Sat Apr 26, 2003 6:33 pm
- Location: Spain
- Contact:
With some graphic cards sprites must have a specific size, 32x32, 128x128, 256x256, check the size of the sprites, you can use directly Direct3D, i made an example:
viewtopic.php?t=13590
viewtopic.php?t=13590
-
- Enthusiast
- Posts: 499
- Joined: Wed Sep 17, 2003 9:17 pm
- Location: Southern California
- Contact:
The matter is, the code posted is not the code that was used to compile the EXE in the sample. The exe works perfectly, the code provided is faulty.PolyVector wrote:so neither RGB_16_565() or RGB_16_555() worked? That's strange, I read that those were the two main 16bit color formulas on a mircosoft site...
I never tried the procedures you just now posted, since nobody ever posted them before you

Anyways, I PM'd him even though he havent been on the forums since October 2004.
Until then, anybody have a way to change the colors of the four corners of a Sprite3D?