Inside the directory of every Weaver project there's the file conf/conf.h. That file is just a C header file and editing it you can change a lot of configurations of your game. This page lists all the different macros that can be defined to different values (or not be defined) and how it changes your game's behaviour.
This macro enables and disables debug messages in your game and also determines if your game is finished or still is in a development version.
In a finished game, which is ready to be distributed, you should always set this macro to 0. You also needs to set this value to 0 if you wish to install the game with a make install command (don't forget to recompile it). When this macro is set to 0, a game run faster and without wasting memory in information for debug messages.
If you set the macro to 1, the game will print messages warns you about non-fatal errors found during execution. If you set the macro to 2, warnings about strange conditions also will be print (but not always these warnings represent errors or things tht should be fixed). Values greater than 2 are reserved to Weaver engine development and should never be used in games.
Of course, fatal errors always halts the game execution and makes some error message appear in the screen, even when this macro is set to 0.
If this macro is not present, it's treated as if it's value is 0.
This thread defines if the project should support multiple threads or not. If this macro is defined, all the functions marked as thread-safe in Weaver Reference Guide becames thread-safe. If the macro is defined, all the functions that read game assets also try do do it's job asynchronously in a separated thread.
If the macro isn't defined, then Weaver doesn't care about the possibility of multiple threads running the code and doesn't create mutexes and semaphores. All the functions became not thread-safe.
As the web environment doesn't support threads, this macro is alway treated as not defined if you compile the game as a web page.
This macros defines the language which we are using in aa project. There's two options: C (W_C) or C++ (W_CPP).
With the help of this macro, Weaver knows wich compiler should be used and also how the headers should be defined.
If this macro isn't present, W_C is assumed, but a warning will be print during compilation.
This macro defines the target for the compilation. If the game should be transformed in a Linux executable (W_ELF) or in a web page in the form of optimized javascript (W_WEB).
If this macro isn't defined, W_ELF is assumed, but a warning will be print during compilation.
This macro prevents plugins from self-enabling themselves. They still are loaded in your game, and so still are able to run initialization code. They just can't be automatically enabled. Only you can enable them with W.enable_plugin.
This macro won't protect a user if a malicious plugin is put in the directory W_PLUGIN_PATH. Only trustable plugins should be put in that directory and the directory itself should be secure.
The maximal memory that should be used by Weaver's internal operations. Probably it's value should be much smaller than W_MAX_MEMORY.
Usually you should care about this value only if your game crashed with some message about not having enough internal memory. Sometimes if you need to read a very big shader, you need to increase the default value of this macro.
If this macro is not defined, it's value is assumed to be 1/10,000 of W_MAX_MEMORY, but not less than 16 KB.
This macro sets the maximum memory that your game should use for game elements. The value is in bytes.
In fact, Weaver will probably choose a value bigger than what you define in this macro, as the memory manager expects that the limit is a multiple of the page size in your computer.
Any memory allocation using Weaver functions will fail if you already are using all the reserved memory for your game. Even if the computer still have plenty of free memory in RAM.
If this value is not defined, Weaver prints a warning during compilation and tries to use 1, reserving the minimum ammount of memory possible.
Weaver can schedule the execution of functions without arguments and return values with functions like W.run_futurelly and W.run_periodically. These functions put functions in the scheduler.
This macro sets the maximum number of functions that Weaver can store in it's scheduler for each main loop.
This macro defines the maximum size of the main loop stack. Each time you call the function Wsubloop without calling Wexit_loop, you use one position in the stack.
The correct value for this macro depends of your game structure and design. Please, check Weaver Main Loops to understand better this macro.
If this macro is not defined, 1 is assumed and a warning is print during compilation.
This macro defines the additional memory that should be reserved if your game is being compiled using Emscripten. It's perfect value depends of the ammount of memory needed outside the Weaver memory manager. If your code and it's libraries use a lot of mallocs, it will need more memory for the web.
You should care about changing this macro only if your game shows problems running out of memory in the web browser, where a error message will warn about not being able to enlarge memory arrays. If this happens, increase the value of this macro or try to use less mallocs.
This macro must be present if you are compiling your game to a web browser and it's value should be at least 1MB.
If this macro is defined, it's used as a seed to initialize the pseudo-random number generator. If it's not defined, a value read from /dev/urandom or from the current time in milisseconds is used.
This is your window color. When you have no objects in the screen, just your empty window, it has this color. If you want to define this macro, define it as three floating point numbers between 0 and 1 and separated by a comma. For example:
#define W_DEFAULT_COLOR 1.0, 0.0, 0.0 // Red
If this macro isn't defined, it's value is assumed to be 0.0, 0.0, 0.0 (black).
This is the height in pixels that your game window should have when is created. If this macro is defined to 0 or is not present, Weaver will create the window with the biggest height possible. In a web browser this means create a canvas as big as the window.
If both this macro and W_WIDTH aren't defined or are defined as 0, then Weaver will create it's window in fullscreen.
Some window managers will ignore the size specification. But if you ask your window to be fullscreen, usually even the more problematic window managers will obey.
This is the width in pixels that your game window should have when is created. If this macro is defined to 0 or is not defined, Weaver will create the window with the biggest width possible. In a web browser this means create a canvas as large as the window.
If both this macro and W_HEIGHT aren't defined or are defined as 0, then Weaver will create it's window in fullscreen.
Some window managers will ignore the size specification. But if you ask your window to be fullscreen, usually even the more problematic window managers will obey.
This is where the game data shall be installed when someone uses the command make install in the game top directory.
If you don't define this macro, it's value is assumed to be /usr/share/games/W_PROG, where W_PROG is your project name.
This is the directory where your game executable shall be installed if someone uses the command make install at your game top directory.
If this macro is not defined, it's assumed to be "/usr/games/".
This is where your game should look for plugins. You can definee this macro as a string with different paths separated by a ":". For example: "/usr/share/games/my_game/plugin:~/.mygame/".
If this macro is not set, it's assumed to be the "compiled_plugins" directory in your game top directory if you are still building the game (the macro W_DEBUG_LEVEL is not set to 0), or is set to a directory called "plugins" at W_INSTAL_DATA otherwise.
You should set this macro if you don't want to use MP3 and don't have the library MPG123 installed.
This macro is the maximum number of music that is played at same time in your game. The default value is 1. You should set a greater value if you are composing an ambient sound with various sound files, each with its own volume or if you want some audio like a character monologue to play at same time than a theme music.