Preprocessor directives in GMS2 - GMWolf

Discussion in 'Tutorials' started by GMWolf, Jul 11, 2018.

  1. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    2,860
    GM Version: GameMaker:Studio 2.1.4
    Target Platform: ALL
    Download: N/A
    Links: Youtube video
    Summary:
    After a long hiatus, I'm back with a tutorial describing how to make use of the processor to achieve preprocessor-directive-like constructs.
    This allows you to have different sections of code be included, or not, based on macros, or configuration. We also explore how it can be used to improve some function call performance, using debug message logging as an example.

    Tutorial:

    I hope you find this interesting, if not useful, and I hope to see you guys when i decide to make my next video (evidently 6 months from now :rolleyes:)
     
    Sanj likes this.
  2. JealousOfCrows

    JealousOfCrows Member

    Joined:
    Jun 22, 2016
    Posts:
    52
    I'm curious about this, so just by using macros and/or var keywording variables being used multiple times in a script you take advantage of preprocessing?
     
  3. GMWolf

    GMWolf aka fel666

    Joined:
    Jun 21, 2016
    Posts:
    2,860
    It's about if statements being optimized away if the condition can be determined at run time.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice