Build 4904
SVN-
Generale
Questionable CON changes and optimizations. <3
-
Generale
Place the current loading percentage into RETURN for EVENT_DISPLAYLOADINGSCREEN.
Nickname SVN e nomi Git sono unificati per persona.
Questionable CON changes and optimizations. <3
Place the current loading percentage into RETURN for EVENT_DISPLAYLOADINGSCREEN.
Faster/better optimized access to game structures from C-CON.
Clean up/refactor a few gamevar related functions based on building as C++/C99 and some interesting articles I read about how GCC and Clang optimize switches. Worth a few FPS here.
always return non-negative values from 'clipmove' and related.
Previously, the C function clipmove() returned negative values when hit a wall (32768+wallnum) or sprite (49152+spritenum) because internally, these values were encoded into a *signed* 16-bit integer. This made no difference to C code using it, since it always proceeded by bit checks, but was inconsistent with documentation on CON 'clipmove' on the wiki. The following commands are affected too, since they use the value returned by clipmove(): 'clipmovenoslide', 'movesprite'. Also, the value of actor[].movflag ('htmovflag' from CON). Also, fix 'clipmove*' in LunaCON and add lunatic/test/checknearwall.con as an example of how to implement a being-close-to-a-wall checker as requested in http://forums.duke4.net/topic/7869-determining-closeness-to-a-wall/
sounds.c: don't crash S_PlayMusic() if passed null pointer for 'fn'.
This may happen if no title/end music is defined from CON. Thanks to Zaxtor for the bug report.
fix 'writearraytofile' for 64-bit platforms.
allow passing more than one flag to the 'spriteflags' directive.
These will be bitwise-OR'd.
In C-CON build, prevent leak of gamevar/gamearray labels on savegame loading.
Also, rewrite the loops in Gv_Free() and Gv_Clear() in the plain fashion so that they are correct even if the number of gamearrays exceeds the number of gamevars.
cache1d.c: Revert changes in r4665 unrelated to unrolling, fixing oob write.
Specifically, we must make sure that dasizeof <= LZWSIZE (or so) in c1d_{read,write}_compressed() (what the assertion in the last commit was about, and is now redundant). This fixes saving of e.g. large gamearrays with the C-CON build. Bump BYTEVERSION. An alternative for setting dasizeof to 1 would be to factor it and keep dividing as long as it's > LZWSIZE.
sync MAXJOYAXES, add lunatic/test/sprite_addtv.con. DONT_BUILD.
expose more members, properly handle setting ud.screen_size.
BUILD_LUNATIC.
fix tilesizx[]/tilesizy[] access. Can also 'copy' from them.
M32Script cleanup. Fixes at least one non-minor and one minor bug.
implement 'qstrncat' command.
gamevars.c: don't leak memory in Gv_NewArray(). DONT_BUILD.
Remove the structure fields in grpscan.c that blocked my code for allowing NAM, NAPALM, and WWII GI to fall back to GAME.CON.
Fix EVENT_ANIMATESPRITES.
fix 'readgamearray' and 'resizearray' on Windows.
We must not use Xrealloc(), since gamearrays are now allocated with Xaligned_alloc(). NOTE: I did not check all potential problematic cases, only those to get LNGA3 up and running.
fix 'readgamearray' on 64-bit platforms.
Also prettify P_DisplaySpit().
player[].loogcnt, userdef[].color, minor fixes.
fix tilesizx[] and tilesizy[] system gamearrays.
fix possible crash when a CON error is raised due to access of invalid sprite.
For example, in CON_ERRPRINTF("invalid target sprite (%d) %d %d\n", iActor, vm.g_i, TrackerCast(vm.g_sp->picnum)); vm.g_i can be -1 and vm.g_sp can be NULL then. (Not anymore.) DONT_BUILD.
Get rid of EnvMusicFilename[] and use MapInfo[].musicfn for that.
The additional space was there all the time, so it's not understandable why another array was necessary. CON: for 'music', error if volume number is outside [0 .. MAXVOLUMES+1], and in LunaCON, additionally warn if it's MAXVOLUMES+1 (0 is preferred for that).
Allow DEFining music for which there is no CON music; Add 'music' OSD command.
The OSD command is invoked like "music E5L3" (case insensitively).
implement 'qsubstr' command. Add source/lunatic/test/qsubstr.con.
In C-CON's qsubstr, error if <start> is not in [0 .. MAXQUOTELEN-1] or <length> is negative.
Fix crash using INTERNAL DEFAULTS after CON error when CON modules were given.
ignore internal flag in gamevar redef check; allow "Pals" member.
properly initialize values of session (NODEFAULT) gamevars.
A couple of Lunatic updates. DONT_BUILD.
- LunaCON: support for setting userdef[].m_volume_number, getting .last_level - bump con_lang.MAXEVENTS - fix compilation of astub.c
Allow EVENT_SOUND to return -1 to cancel a sound without printing a warning to the console and log.
NOTE: Other negative values are reserved!
By request, implement EVENT_ACTIVATECHEAT.
add read-only variable 'Numsprites', r/w userdef member .mouseaiming.
scan label names according to stricter LunaCON rules instead of char blacklist.
These ones: http://lunatic.eduke32.com/lunacon.html#_ambiguous_lexical_elements Seriously, defining a token kind by excluding certain characters (instead of allowing a given set) is really, really broken.
allow '.' as non-first identifer character.
Keep displaying difficulty menu for as long as the *voice* plays.
Previously, the check was for the hard-coded sound number. This made it impossible to change difficulty selection sounds via EVENT_SOUND.
add getactor[]/sprite[] member 'movflags'.
This is exactly the same as the actor[].movflags member in the Lunatic build: http://lunatic.eduke32.com/lunatic.html#actor
in rotatespritea and screentext, if alpha < 0, make -alpha denote blend.
For convenience, orientation gets bit 1 (translucency) set automatically. Again, test/screentext.con is updated to show off this functionality (the code there assumes that additive blending tables are loaded at blend numbers 101 -- 132). BUILD_LUNATIC.
fix 'screentext' command.
In ext. PALETTE.DAT, store log2 of last alpha table index. Handle alpha in classic.
The extended PALETTE.DAT format can now carry a trailing byte, called 'lognumalphatables'. If it is present, the engine assumes that alpha blending tables are loaded at blend indices 1 to 1<<lognumalphatables and handles rotatesprite's alpha and spriteext[].alpha accordingly. The ability to save this new byte is added to engine.lua:savePaletteDat() and the corresponding convenience functions in shadexfog.lua. Examples test/screentext.con and test/sprite_access.con are updated for demonstration purposes.
Rename sector[].filler member to '.fogpal'. From CON, keep the '.alignto' alias.
The overall situation is thus as follows: - in C and from Lua, that member is called 'fogpal' - In CON (both C-CON and LunaCON), it's 'fogpal' with 'alignto' being an alias; 'filler' wasn't available before, either. - In m32script, it's 'fogpal' or 'alignto' ('filler' is not available any more)