Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (86,184 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

Sign in to follow this  
Wesser

[PLUG|OS] Script Dependent Drawings

Recommended Posts

Wesser

 

Script Dependent Drawings v1.15 Bug Fix

GTA San Andreas modification

Open source (Copyleft)

1. MODIFICATION OVERVIEW

  • This GTA San Andreas modification has been planned mainly to answer the frequently asked question about solving the
on-screen white squares bug. This "glitch" occurs because some scripts may share the same slots for the texture storage. Now, any script will load his own texture dictionary which will be allocated over the memory in an indipendent way as opposed to those of the others. The code has been optimized and designed to be as fast as the original one or even faster, in some circumstances, for each script processing.2. INSTALLATION
  • Unzip the content of the
rel folder under the game directory by overwriting the files that match with those existing:

 

 

  • sddwg.asi;
  • stream.ini (not really needed, see below).
3. STREAM INI CONFIGURATION
  • You are able to manipulate the amount of sprites that will be allocated at the game loading stage, by adding and/or modifying the following line to the
stream.ini file:

 

sprites  128

 

This value affects both rectangle and texture sprites but separately.

4. COMPATIBILITY
  • Below are listed all
game executable and CLEO library versions whereon the operation of this modification is fully certified:

 

 

  • Game executables:
    • gta_sa.exe v1.0 US (HOODLUM, 14.383.616b);
    • gta_sa.exe v1.0 EU (HOODLUM, 14.386.176b).
  • CLEO libraries:
    • cleo.asi v3.0.950 (Seemann);
    • cleo4.asi v4.1.1.30f (Alien).

I would discourage the use of such library on any other game executable or CLEO version, otherwise unexpected crashes or glitches may occur.

5. DISCLAIMER
  • Use this library at your own risk and be aware I won't be responsible for any damage provoked on your pc.
6. KNOWN BUGS
  • In case there is any, they are unknown yet. Feel free to report them.
7. CHANGELOG HISTORY
  • 04/25/2013 (v1.15 Bug Fix):
    • Fixed a bug when rendering an amount of sprites higher than 127.
  • 04/23/2013 (v1.1 Bug Fix):
    • Fixed a bug with USE_TEXT_COMMANDS (03F0) flag, not thread dependent yet;
    • Fixed an issue when building the full path of a TXD file.
  • 04/20/2013 (v1.0):
    • The following commands have been altered:
      • (004E) TERMINATE_THIS_SCRIPT;
      • (038D) DRAW_SPRITE;
      • (038E) DRAW_RECT;
      • (038F) LOAD_SPRITE;
      • (0390) LOAD_TEXTURE_DICTIONARY;
      • (0391) REMOVE_TEXTURE_DICTIONARY;
      • (03E3) SET_SPRITES_DRAW_BEFORE_FADE;
      • (0459) TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME;
      • (074B) DRAW_SPRITE_WITH_FIXED_ROTATION;
      • (08A0) UNKNOWN_08A0;
      • (0937) DRAW_WINDOW;
      • (0A93) TERMINATE_THIS_CUSTOM_SCRIPT;
      • (0ABA) TERMINATE_ALL_CUSTOM_SCRIPTS_WITH_THIS_NAME.
    • Texture dictionaries are linked to those threads that load them;
    • Rectangle and texture sprites are arranged separately;
    • Rectangle sprites are stored globally by any script;
    • Texture sprites are allocated every time a texture dictionary is loaded in a thread and cannot be accessed by any other;
    • The linear filtering has been enabled on top drawings to fix a possible R* graphic fault, to prevent some of them from being pixelated. Perhaps, this is the reason of SET_SPRITES_TO_BE_DRAWN_ANTIALIASED definition in the early SCM modding times, as the wrongly-named command actually puts a specific sprite on top.
8. TO-DO LIST
  • Make USE_TEXT_COMMANDS flag thread dependent;
  • Make sure that LOAD_TEXTURE_DICTIONARY opens a texture from a given path;
  • Restore DRAW_WINDOW_TEXT (0938) command (definition needs confirmation);
  • Add the ability to load multiple texture dictionaries in a thread without necessarily removing by REMOVE_TEXTURE_DICTIONARY and reloading the previous again;
  • Hook text draw routines to manage their amount.
9. CREDITS
  • Contributers of gta_sa.idb, whose package is available publicly here;
  • ThirteenAG, for reporting most of the bugs.
Enjoy. Regards, Cajetan Lacazette (alias) aka Wesser. Edited by Wesser

Share this post


Link to post
Share on other sites
Frank.s

Impressive, very useful to the SA modding scene. Great work. cookie.gif

Share this post


Link to post
Share on other sites
damiann69

I haven't occur this bug (yet ;] ), or maybe don't remember... In google nothing too smile.gif Could somebody upload some screen? Anyways, thanks for it. GTA SA modding scene is awesome.

Share this post


Link to post
Share on other sites
aStiffSausage

Never really thought of something as helpful as this. Makes coding so much simpler when there's no need to check in every script if you have to reload the textures or not, and no more conflicting textures! (Black Market mod conflicting with Rain Drops mod for example, was quite hilarious to see leafs, lines of cocaine etc. scrolling through screen when raining. smile.gif )

 

EDIT:

@damiann69

 

For easy example, use a speedometer and Wesser's Windscreen HUD at the same time. When you leave the car, the speedometer releases the textures, but as scm-engine had some bugs, also the Windscreen HUD lost its textures, causing only white squares to be drawn on screen. This mod makes each txd-function to be separated, so such things won't happen anymore.

Edited by oksa8

Share this post


Link to post
Share on other sites
ThirteenAG

Very nice, but i'm experiencing a crash after entering a car(1.0us/cleo3/a lot of plugins and mods):

 

GTA:SA Crashed, Debug Info Follows:GTA Info:Error: UnknownAssembly Info:Exception At Address: 0x007F3825Exception Code: 0xc0000005 (EXCEPTION_ACCESS_VIOLATION)Registers:EAX: 0x4CF5D7D8	EBX: 0x00000001ECX: 0x03349388	EDX: 0x00727270ESI: 0x4CF5D7D8	EDI: 0x00000000EBP: 0x0023F854	ESP: 0x0023F838Last Opcode: 038F in thread 'speed' (0x355CC74)

 

 

speed source: http://pastebin.com/E4czkDn4

Share this post


Link to post
Share on other sites
direstraits

I have the same problem as ThirteenAG, I think it's the speedometer.

Share this post


Link to post
Share on other sites
Silent

Hope that this time mod's compatible with compact EXE? tounge.gif

Share this post


Link to post
Share on other sites
fastman92

Good work, it's another plugin that's very useful.

Share this post


Link to post
Share on other sites
LINK/2012

Really useful plugin

 

Share this post


Link to post
Share on other sites
Apu889

finally, someone did it. what i fear, will not happen again. thanks Wesser, you're the man cool.gif

Share this post


Link to post
Share on other sites
Wesser

Thank you for all of your feedback, guys. I uploaded a fixed version in the hope that all bugs are gone. icon14.gif

 

 

Hope that this time mod's compatible with compact EXE? tounge.gif

It should. I'm too lazy to test by myself. tounge.gif

Edited by Wesser

Share this post


Link to post
Share on other sites
ThirteenAG

Looks like it's working fine now, but i still have a crash without 'sprites 128' line in stream.ini. I assumed 'not really needed' means what it means...

 

user posted image

Share this post


Link to post
Share on other sites
Silent
Thank you for all of your feedback, guys. I updated a fixed version in the hope that all bugs are gone. icon14.gif

 

 

Hope that this time mod's compatible with compact EXE? tounge.gif

It should. I'm to lazy to test by myself. tounge.gif

It will be, as long as you're not usng any hoodlum addresses or so (like you did in Full Nitro Control) icon14.gif

Share this post


Link to post
Share on other sites
Wesser

 

... i still have a crash without 'sprites 128' line in stream.ini. I assumed 'not really needed' means what it means...

Well, I meant that you don't have to necessarily overwrite the stream.ini file, because you can add that line even manually. tounge2.gif

 

 

It will be, as long as you're not usng any hoodlum addresses or so (like you did in Full Nitro Control)  icon14.gif

I think you mean HOODLUM specific addresses. Then, I don't know.

Share this post


Link to post
Share on other sites
ThirteenAG

I'm pretty sure i had a cursor before installing this plugin smile.gif

user posted image

 

src

Share this post


Link to post
Share on other sites
Wesser

Thank you for reporting another bug. icon14.gif

 

Modification updated.

Share this post


Link to post
Share on other sites
direstraits

I found a bug, the weapon icon desapears when I'm using the jetpack.

Share this post


Link to post
Share on other sites
acid96

Is there any way to get it working with SAMP, since SAMP loads own stream.ini

 

 

 

Edited by acid96

Share this post


Link to post
Share on other sites
fastman92

The problem described below isn't caused by Script Dependent Drawings.

 

 

{$CLEO}0390: load_txd_dictionary 'SPEEDO'038F: load_texture "Bck" as 1 // Load dictionary with 0390 firstwhile truewait 003F0: enable_text_draw 1074B: draw_texture 1 position 320.0 224.0 scale 100.0 100.0 angle 180.0 color_RGBA 255 255 255 255end
Did anyone notice a texture drawn with 074B opcode, with angle and drawn flipped horizontally as shown on picture?

 

554b85277501830.jpg

 

When scale becomes -100.0 100.0

it's good

Edited by fastman92

Share this post


Link to post
Share on other sites
Wesser

I found a bug, the weapon icon desapears when I'm using the jetpack.

I don't get this bug on a clean game with such modification installed. I'm sorry, I cannot do anything.

 

Is there any way to get it working with SAMP, since SAMP loads own stream.ini

Somebody suggested to load settings from another file aswell. I'll see what I can do.

 

The problem described below isn't caused by Script Dependent Drawings...

I noticed this issue during my tests too and I ended up by keeping everything as it is. The main source is full of 074B commands drawing flipped textures. R* was probably aware about it, seems like it is intentional. Dunno why.

Edited by Wesser

Share this post


Link to post
Share on other sites
LINK/2012

Any news on unconflicting this with modloader?

Share this post


Link to post
Share on other sites
RRT94

Crashes when starting with CLEO 4.3.21.

Share this post


Link to post
Share on other sites
Reyks

Crashes when starting with CLEO 4.3.21.

That's beacuse this mod was already implemented into CLEO4 some time ago:

-- 4.3.7 --* Text and texture/sprite draws are now script-dependant (doesn't affect main.scm scripts)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.