Raised This Month: $32 Target: $400
 8% 

Prototype of new module - (Customization Image)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 11-13-2017 , 15:46   Prototype of new module - (Customization Image)
Reply With Quote #1

Was experimenting with SVC_CUSTOMIZATION, I found it feasible to download&precahe ingame (while playing). Have not tried WAD but it would have to work just like with SPR

So thought about creating a module to create/modify images BMP/WAD/SPR

This is the prototype of basic functions that I thought so far, do you have any suggestions?

PHP Code:

// Bitmap
native Bitmap:BMP_Load(const filename[])

// with the amount of colors as we do?, RGB or Indexed ?
// r g b = -1 transparent ?
native Bitmap:BMP_Create(widthheightrgb,)

native BMP_Resize(Bitmap:bmpwidthheight)
native BMP_InsertText(Bitmap:bmp, const text[], fontsizergbxy)

native BMP_Save(Bitmpa:bmp, const filename[]) // All XXX_Save in one ?
native BMP_Free(Bitmap:&bmp// All XXX_Free in one ?


// Sprite
native Sprite:SPR_Load(const filename[])
native Sprite:SPR_Create()

native SPR_SetType(Sprite:sprtypetexture)
native SPR_GetInfo(Sprite:spr, &type, &texture, &frames)

native SPR_InserFrame(Sprite:sprBitmap:bmpindexxy)
native SPR_DeleteFrame(Sprite:sprindex)
native Bitmap:SPR_ExportFrame(Sprite:sprindex)


native SPR_Save(Sprite:spr, const filename[])
native SPR_Free(Sprite:&spr)


// Wad
native Wad:WAD_Load(const filename[])
native Wad:WAD_Create()

native WAD_CountImages(Wad:wad)
// WAD_ListImagesNames(...) ???

native WAD_InserImage(Wad:wad, const name[], Bitmap:bmp)
native WAD_DeleteImage(Wad:wad, const name[])
native Bitmap:WAD_ExportImage(Wad:wad, const name[])

native WAD_Save(Wad:wad, const filename[])
native WAD_Free(Wad:&wad)



// Send To Player (ingame download and precache)
native Customization_Send(playerowner, const filename[], index=0, {_,Sprite,Wad}:resource=_:0
__________________

Last edited by Destro-; 11-13-2017 at 16:34.
Destro- is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 11-13-2017 , 16:07   Re: Prototype of new module - (Customization Image)
Reply With Quote #2

Quote:
Originally Posted by Destro- View Post
Was experimenting with SVC_CUSTOMIZATION, I found it feasible to download&precahe SPR for use ingame.
Why not just use precache_generic?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 11-13-2017 , 16:36   Re: Prototype of new module - (Customization Image)
Reply With Quote #3

Quote:
Originally Posted by PRoSToTeM@ View Post
Why not just use precache_generic?
my mistake, bad wording xd

Quote:
Was experimenting with SVC_CUSTOMIZATION, I found it feasible to download&precahe ingame (while playing).
__________________
Destro- is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-13-2017 , 16:47   Re: Prototype of new module - (Customization Image)
Reply With Quote #4

I was looking at SVC_CUSTOMIZATION before but could never really make anything out of it. I know CS uses it for sprays but that's about it. Couldn't really understand how it works even while looking at HLSDK and ReGameDLL_CS.

Did you test it? Does it really work? What happens to newly joined played after you send out the customization to already connected ones?

Last edited by klippy; 11-13-2017 at 16:47.
klippy is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 11-13-2017 , 17:08   Re: Prototype of new module - (Customization Image)
Reply With Quote #5

To send the customization it is better to do it for each player (MSG_ONE), and you yourself control who and when to send it.


SVC_CUSTOMIZATION is similate to SVC_RESOURCELIST but it works when you're already playing.
Code:
Server: send SVC_CUSTOMIZATION to player and hook SV_BeginFileDownload_f()
Client: send cmd "dlfile %filename%"
Server: hook SV_BeginFileDownload_f() and call Netchan_CreateFileFragments()
__________________

Last edited by Destro-; 11-13-2017 at 17:10.
Destro- is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 11-16-2017 , 13:31   Re: Prototype of new module - (Customization Image)
Reply With Quote #6

You can just call Netchan_CreateFileFragments. But in-game download can't use fastdl.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode