スポンサーサイト

上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。

GTA SA : Scm - Direct Drawing. asi

GTA SA : Scm - Direct Drawing. asi

Idea
This thing provides an ability to render into frame buffer with scm code. It works only with 1.0 US exe.
Using
Include next file: DirectRender to your code ({$I directrender}), then use scm-funtions to define which code must be executed at rendering process.

=============================================

{$CLEO}
{$I directrender}
0000:
while true
wait 0
/* You can use any of these names:
directRender, direct_render, directDrawing, direct_drawing, ExecuteCodeAtRendering, execute_code_at_rendering to call this function. */
0AB1: call @DirectRender 2 from @RenderCodeStart to @RenderCodeEnd
end

:RenderCodeStart
// code
:RenderCodeEnd

=============================================

Why?
Direct rendering is impossible while scripts are executed (processed).
Also
For future plans, I also did functions to execute code at game re-starting and at resetting game graphic device. They are @ExecuteCodeAtClosing (execute_code_at_closing) and @DeviceReset (ExecuteCodeAtResetting, execute_code_at_resetting, device_reset, ResetDevice, reset_device).
Examples

Text and texture
Drawing a fist icon texture and a text under it.

=============================================

{$CLEO}
{$I directrender}
0000:
while true
wait 0
0AB1: call @DirectRender 2 from @texture to @end_texture
0AB1: call @DirectRender 2 from @text to @end_text
end

:texture
0@ = 0xFFFFFFFF
0AA6: call_method 0x728520 struct 0xBAB1FC num_params 9 pop 0 _color 0@v _yx4 10.0 100.0 _yx3 10.0 10.0 _yx2 100.0 100.0 _yx1 100.0 10.0
:end_texture

:text
0AA5: call 0x719430 num_params 1 pop 1 0xFFFFFFFF // SetColor
0AA5: call 0x719380 num_params 2 pop 2 _yx 0.9 0.6 // SetScale
0AA5: call 0x719610 num_params 1 pop 1 _alignment 1 // SetAlignment
0AA5: call 0x719490 num_params 1 pop 1 _style 1 // SetStyle
0AA5: call 0x719590 num_params 1 pop 1 _size 1 // SetOutLine
0AA5: call 0x71A700 num_params 3 pop 3 _text "Hello, world!" _yx 105.0 8.0 // PrintString
:end_text

=============================================

Wireframe peds
Drawing a ped model 'over' already drawed models, but with "wireframe" mode enabled.

=============================================

{$CLEO}
{$I directrender}
0000:
while true
wait 0
0AB1: call @DirectRender 2 from @wireframe_peds to @end_wireframe_peds
end

:wireframe_peds
{$I forallpeds}
// Setup rendering states
0AA5: call 0x7FC2D0 num_params 2 pop 2 2 8
0AA5: call 0x7FE420 num_params 2 pop 2 1 6
// Rendering ped clump
0A96: 0@ = actor ped struct
0@ += 0x18
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
0AA5: call 0x749B20 num_params 1 pop 1 0@
// Setup rendering states
0AA5: call 0x7FC2D0 num_params 2 pop 2 3 8
0AA5: call 0x7FE420 num_params 2 pop 2 0 6
{$I for_end}
:end_wireframe_peds

=============================================

GTA SA : Scm - Direct Drawing. asi
author DK22Pac
Link
関連記事

Counter
Calendar
<11 | 2016/12 | 01>
Sun Mon Tue Wed Thu Fri Sat
- - - - 1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Search this blog

RSS Link
my friends list
Yohsuke GTA Mods


Diego4Fun Zone


KOHDYKTOP Mods


Doa Marie Mods



Archive RSS Login
上記広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書くことで広告を消せます。