User Tools

Site Tools


development:csdk:2.0:genmacros

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
development:csdk:2.0:genmacros [2024/11/20 21:11] – created clydedevelopment:csdk:2.0:genmacros [2024/11/20 21:18] (current) clyde
Line 1: Line 1:
 ====== Generated Asset Macros ====== ====== Generated Asset Macros ======
  
-The GameTank SDK uses generated header files for providing references to imported game assets. Every subfolder of the ''assets'' folder in the project root will have a corresponding header file created under ''src/gen/assets'' after running ''make'' or ''make import''.+The GameTank SDK uses generated header files for providing references to imported game assets. 
 + 
 +===== Asset Bank Headers ===== 
 + 
 +Every subfolder of the ''assets'' folder in the project root will have a corresponding header file created under ''src/gen/assets'' after running ''make'' or ''make import''.
  
 These header files will contain a handful of macros for each file in that assets subfolder. These macros are generated from the filename and parent folder name as follows: These header files will contain a handful of macros for each file in that assets subfolder. These macros are generated from the filename and parent folder name as follows:
Line 23: Line 27:
 ''_size'' if present gives the size of the original unconverted file (so it's mainly useful when the file is a binary copied straight into the ROM, such as .bin or .sfx) ''_size'' if present gives the size of the original unconverted file (so it's mainly useful when the file is a binary copied straight into the ROM, such as .bin or .sfx)
  
 +==== Example ====
 +<code>
 +play_song(ASSET__audio__gameloop_mid, REPEAT_LOOP);
 +</code>
 +Here, ''play_song'' actually takes three arguments and ''%%ASSET__audio__gameloop_mid%%'' provides the first two. The macro resolves to ''%%ASSET__audio__gameloop_mid_ptr, ASSET__audio__gameloop_mid_bank%%'' and saves you a lot of typing.
  
 ===== Extension Tables ===== ===== Extension Tables =====
development/csdk/2.0/genmacros.1732137107.txt.gz · Last modified: 2024/11/20 21:11 by clyde