Commit Graph

951 Commits

Author SHA1 Message Date
helixhorned c9190e79ae Wrap some ud.camera* and g_camera{Distance,Clock} into CAMERA* macros.
In Lunatic, make it a struct type "camera_t" instead.

git-svn-id: https://svn.eduke32.com/eduke32@3405 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-19 18:28:32 +00:00
helixhorned 753278cd12 Simplify HUD scale and viewport size logic and clean up related code.
* Make the "classic status bar fullscreen viewport" mode accessible
  in classic too.
* Make range of status bar scale 36..100
* Update ud.statusbarmode when executing OSD command r_size (ud.screen_size).
  NOTE: ud.statusbarmode is considered internal. Don't use from CON!
* Make sure 1) loading any configuration and 2) menu bars work correctly.
  (The "classic status bar fullscreen viewport" mode will never be restored
   though because ud.statusbarmode isn't handled by the OSD var system).

git-svn-id: https://svn.eduke32.com/eduke32@3402 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-17 21:59:11 +00:00
helixhorned e9bd1b7582 Various cleanup of status bar drawing code, remove some old commented out code.
git-svn-id: https://svn.eduke32.com/eduke32@3400 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-17 21:59:01 +00:00
helixhorned a98ea13f1e game.c: replace a couple of sbarsc() inline code with calls to sbarsc().
git-svn-id: https://svn.eduke32.com/eduke32@3399 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-17 21:58:54 +00:00
helixhorned 39ce7aee62 Lunatic: codegen beyond milestone 1.
- weapon data
- changing ones... (locals for now)
- operators

git-svn-id: https://svn.eduke32.com/eduke32@3392 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-13 16:40:32 +00:00
helixhorned 28d05e3fdd Reimplement pixel doubling by taking the upper left pixel of each 2x2 block.
This obviously won't help performance as the scene has still to be drawn at
the original resolution, but it's better than the draw-to-tile hack.

git-svn-id: https://svn.eduke32.com/eduke32@3378 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-06 18:56:34 +00:00
helixhorned 50f5a2340f Lunatic: more commands, mostly of the define* variety.
git-svn-id: https://svn.eduke32.com/eduke32@3373 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-05 13:09:19 +00:00
helixhorned a24ab8d4fa Factor out some code into C_AllocQuote() and C_InitQuotes().
In Lunatic-only build, also always allocate the first 128 quotes.

git-svn-id: https://svn.eduke32.com/eduke32@3356 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:25 +00:00
helixhorned fd390efe2a Lunatic: compile out more code with LUNATIC_ONLY.
git-svn-id: https://svn.eduke32.com/eduke32@3354 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-01 15:24:18 +00:00
terminx 79e45c23d5 Add predefined REND_CLASSIC, REND_POLYMOST and REND_POLYMER constants and use them everywhere getrendermode() is called.
git-svn-id: https://svn.eduke32.com/eduke32@3346 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-30 20:34:34 +00:00
helixhorned 80f3e132b0 Replace "if (g_tile[..].execPtr)" -> "if (G_HaveActor(...))".
git-svn-id: https://svn.eduke32.com/eduke32@3344 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:28 +00:00
helixhorned 80ee967b8e Lunatic: beginning to glue things together. Introducing LUNATIC_ONLY.
git-svn-id: https://svn.eduke32.com/eduke32@3343 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:24 +00:00
hendricks266 b6ddc6149e Replace initialize_globals() with global initialization.
git-svn-id: https://svn.eduke32.com/eduke32@3337 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:58:38 +00:00
hendricks266 3933471e4b All kneel, king FLAC is here.
FLAC source from git commit 0920bc1ffb07f038b317e7e8056509fe0e4b680e, patched by me.

Windows libFLAC.a built using i686-MinGW-w64 and x86_64-MinGW-w64.

HUGE thanks to rhoenie for building the Mac fat library (ppc, i686, x86_86).

git-svn-id: https://svn.eduke32.com/eduke32@3335 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:57:24 +00:00
hendricks266 95dd57154e Clean up some file and directory structure.
* Renamed source/jaudiolib/third-party/mingw32 to source/jaudiolib/third-party/Windows.
* Moved source/jaudiolib/third-party/Windows/include to source/jaudiolib/third-party/common/include to use both on Windows and Apple.
* Deleted Apple/lib/include/{ogg,vorbis}/, see previous point.
* Deleted Apple/lib/libvorbisenc.a, 6MB saved.
* Moved Apple/lib/lib{ogg,vorbis,vorbisfile}.a to source/jaudiolib/third-party/Apple/lib, where they belong.
* Moved source files in Apple/ to source/, where they belong. (SDLMain.[mh] stay.)
* Deleted source/jaudiolib/third-party/{ogg,vorbis}.framework, not used any more.
* Renamed "StartupWinController*" to "startosx*".

git-svn-id: https://svn.eduke32.com/eduke32@3334 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 10:54:35 +00:00
helixhorned 9c328bf0a5 Encapsulate aplWeapon* array accesses in a PWEAPON(Player, Weapon, Wmember) macro.
In the normal game, these arrays are conceptually [MAX_WEAPONS][MAXPLAYERS],
allocated as CON per-player gamevars (e.g. WEAPONx_WORKSLIKE).
For Lunatic, they are replaced with
weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS].

git-svn-id: https://svn.eduke32.com/eduke32@3328 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:18:16 +00:00
helixhorned 4f2639f4d7 Clean up spawning / actor initialization code.
git-svn-id: https://svn.eduke32.com/eduke32@3322 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-28 17:17:53 +00:00
helixhorned 0dd78fb029 Cleanup of console/on-screen-display (OSD) functionality.
- Rewrite the "clear background" routine in a no-brainer way instead of
  juggling around with rotatesprite(). Make it common to game+editor.
  Expose glRectd to glbuild.
- Don't stop OSD text line drawing when encountering a non-printable char.
  Instead, treat it as space.
- In OSD_SetTextMode(), don't use swaplong (which really swaps 32-bit ints)
  to swap pointers. Write an analogous "swapptr" instead.
- When changing from/to OSD, don't inject a pause key. This *might* have been
  the cause of the reported pausing problems.
- clean up the code...
(Yes, this commit throws together too much stuff. I suck sometimes. :P)

git-svn-id: https://svn.eduke32.com/eduke32@3321 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-25 16:13:50 +00:00
helixhorned 41bfa1b841 Lunatic: print -> OSD_Printf, error reporting.
git-svn-id: https://svn.eduke32.com/eduke32@3319 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-25 16:13:41 +00:00
helixhorned 4ea9f799b1 Lunatic: more complete gameactor(), misc. translator tweaks.
git-svn-id: https://svn.eduke32.com/eduke32@3315 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 19:24:16 +00:00
helixhorned 48c47af5dc Pack actor_t's bposx/bposy/bposz members into a vec3_t named "bpos".
git-svn-id: https://svn.eduke32.com/eduke32@3314 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-23 14:00:08 +00:00
helixhorned 922aa3ca8b Classic-like visibility/fog for OpenGL modes, r_usenewshading 2 (new default).
Implemented using GL_LINEAR fog. The only source of difference (besides the
obvious indexed vs. true color) should now be the distance constant, which
still had to be determined experimentally.  Polymer implements this mode in
its fog fragment program part.

Parallaxed skies are always drawn with full visibility, I'm not sure if there
are any maps that expect otherwise.

Also, accidentally committed: factor out initialization code from
polymost_printext256() into gen_font_glyph_tex(), small game.c changes.

git-svn-id: https://svn.eduke32.com/eduke32@3301 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-16 19:18:10 +00:00
helixhorned 92dabb3694 Rename global visibility to g_visibility, remove useless casts & old fog code.
git-svn-id: https://svn.eduke32.com/eduke32@3287 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:28:05 +00:00
helixhorned 65e5ebcdbc Add command line option "-rotatesprite-no-widescreen".
This global option will set bit 1024 and clear bits 256 and 512 for all
rotatesprite calls, fixing complex HUD drawing code relying on precise
alignment of individual elements (widescreen rotatesprite is entirely
unsuitable for this purpose).

git-svn-id: https://svn.eduke32.com/eduke32@3284 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 19:27:55 +00:00
hendricks266 70aecb2e75 Fix declaration-after-statement warning in game.c after r3270.
git-svn-id: https://svn.eduke32.com/eduke32@3277 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:35:06 +00:00
terminx fbdbca2952 Networking patch from Jasper Foreman
git-svn-id: https://svn.eduke32.com/eduke32@3270 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-12 02:53:13 +00:00
terminx 5c59f785a1 Recognize the .pk4 file extension when loading grps and zips for shits and giggles (.pk3 was already recognized).
git-svn-id: https://svn.eduke32.com/eduke32@3269 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-12 02:53:10 +00:00
helixhorned 9d2260c3c8 Replace outer apScriptGameEvent[...] checks with G_HaveEvent().
git-svn-id: https://svn.eduke32.com/eduke32@3266 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-10 18:17:57 +00:00
helixhorned 99f56fd295 Don't call setaspect_new() at end of rotatesprite.
This fixes 2nd and following rotatesprite calls drawing differently from
the first in a context with custom set-up aspect, as reported by Lezing here:
http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__143090

Also, back up and restore the aspect state across EVENT_DISPLAYREST.

git-svn-id: https://svn.eduke32.com/eduke32@3265 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-10 18:17:53 +00:00
helixhorned fc048658dc Experimental NETCODE Makefile variable, enabled by default.
Disabling netcode compilation can be interesting on memory-constrained
systems, or those that have no means of accessing the network anyway.
Note: I'm OK with maintaining this myself, i.e. it's fine if netcode dev
breaks compilation with NETCODE=0.

git-svn-id: https://svn.eduke32.com/eduke32@3260 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:44 +00:00
helixhorned 1588a80442 Lunatic: drowning in code.
git-svn-id: https://svn.eduke32.com/eduke32@3259 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:39 +00:00
helixhorned 599d9232f1 Initialize BADGUY sprite flags for hardcoded enemies.
... instead of switch/case-ing them in A_CheckEnemyTile().
Because this requires bumping BYTEVERSION, we also get rid of the
excess trailing bytes in the save game's "rest" data. (See r3052.)

git-svn-id: https://svn.eduke32.com/eduke32@3257 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-09 13:24:32 +00:00
helixhorned b062d5f572 Lunatic: knee-deep in code.
- more codegen
- make more members const, some char unsigned
- fix some "geom" metamethods
- '^' operator

git-svn-id: https://svn.eduke32.com/eduke32@3253 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-03 18:24:25 +00:00
hendricks266 890aba88eb Fix warnings involving printf() requiring explicit casts on tracked types.
git-svn-id: https://svn.eduke32.com/eduke32@3238 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-26 08:26:04 +00:00
hendricks266 5e0ffb93b3 RENDERTYPE=SDL on Windows, part 2.
This introduces winbits.[ch] in the engine, containing layer-independent code migrated from winlayer, including nedmalloc, ebacktrace1, OS version detection, and high-resolution profiling timers.

sdlayer has been expanded to include the code from winbits under _WIN32.

All uses of RENDERTYPEWIN in the source have been examined and changed to _WIN32 (or removed) where the block in question is layer-independent.

git-svn-id: https://svn.eduke32.com/eduke32@3221 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 04:26:37 +00:00
hendricks266 be899ba3af For novelty, add support for RENDERTYPE=SDL under Windows.
This needs improvements to bring it up to par with winlayer, but it is functional. In particular, a good amount of code from winlayer could be used for both layers, including the profiling timers, the version printing code, and the hInstance and hModule sharing.

Known problems: the mouse cursor is not trapped, and the game starts before the startup window shows options.

git-svn-id: https://svn.eduke32.com/eduke32@3219 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:13:29 +00:00
hendricks266 6c59071155 Stop all sounds after completion of LOGO.ANM.
git-svn-id: https://svn.eduke32.com/eduke32@3217 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:11:50 +00:00
hendricks266 f8b2b9088c Allow CAMERA1 to have cstat 32768.
git-svn-id: https://svn.eduke32.com/eduke32@3216 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-24 09:11:30 +00:00
helixhorned 1009e0f2ec Remove many redundant (int16_t) casts and one now incorrect one.
The redundant ones are in code like this: s->cstat = (int16_t)32768;
Because the value is eventually converted to the type of "s->cstat", any
casts to integral types having at least as many bits are no-ops, signedness
being irrelevant due to (probably any two's complement arch targeting
compiler's) bit-pattern preserving semantics of these conversions.

The now incorrect one is: if (lotag == (int16_t) 65535),
"int32_t lotag" being read from a wall or sprite struct directly earlier.
Now, with these members being unsigned, and (int16_t)65535 equalling -1,
the check always fails.  The correction fixes normal switches having such
a lotag ending the level immediately.

In short: integer casts before assignments are unnecessary, those in reads
highly relevant!

git-svn-id: https://svn.eduke32.com/eduke32@3211 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-18 19:01:34 +00:00
helixhorned 44904b12be Clean up picanm[] by making its elements values of struct type picanm_t.
The size of that struct is currently 4, and its layout almost the same as
what is read in with loadpics().  The number of tiles in an animation is
bumped to 256, so that the max. tile difference in DEF's animtilerange is
255. (There's no way to have such animations from ART.)

git-svn-id: https://svn.eduke32.com/eduke32@3202 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 19:46:28 +00:00
terminx 83ae3a407a Further minor MACT cleanups
git-svn-id: https://svn.eduke32.com/eduke32@3200 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:48:11 +00:00
terminx 11a5000630 Rename a few variables we've added to MACT over the years to be more consistent with the rest of its naming conventions
git-svn-id: https://svn.eduke32.com/eduke32@3195 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-17 16:47:47 +00:00
helixhorned 6547495cac Split r3159..r3161, part 14: The rest.
git-svn-id: https://svn.eduke32.com/eduke32@3180 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:47 +00:00
helixhorned 107fa9cc39 Split r3159..r3161, part 12: Add explicit casts, non-pointer types.
Notes:
 - Atomic Edition (Censored) -> Plutonium Pak in grpscan.c
 - "scale" in astub.c:drawtileinfo() is incorrect, I think.
 - in demo.c, the gethitickms() value should be returned to a double.

git-svn-id: https://svn.eduke32.com/eduke32@3178 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:41 +00:00
helixhorned 61d038f217 Split r3159..r3161, part 11: Add explicit casts, pointer types.
git-svn-id: https://svn.eduke32.com/eduke32@3177 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:36 +00:00
helixhorned 5ad385c043 Split r3159..r3161, part 10: add explicit casts to *alloc return values.
NOTE: changes such as these are best viewed with something like
git diff (...) --color-words='[a-zA-Z0-9_]+|[^[:space:]]'

git-svn-id: https://svn.eduke32.com/eduke32@3176 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:29 +00:00
helixhorned 2cb3734f85 Split r3159..r3161, part 8: make some members of base types unsigned.
NOTE: This will need very thorough review.

git-svn-id: https://svn.eduke32.com/eduke32@3174 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:18 +00:00
helixhorned 6d5d415ea5 Split r3159..r3161, part 6: code conditional on __cplusplus.
Note the type change of vplce[] in engine.c: int32_t -> uint32_t.

git-svn-id: https://svn.eduke32.com/eduke32@3172 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:11 +00:00
helixhorned 274726be9b Split r3159..r3161, part 5: "nowarn" wrapping of printing functions.
git-svn-id: https://svn.eduke32.com/eduke32@3170 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:28:04 +00:00
helixhorned 1cd11d06ef Revert "Fix the warnings when building with C++, add MSVC C++ build support."
This reverts r3159..r3161.

Conflicts:
	eduke32/build/include/compat.h
(Handled so that r3163's changes are kept applied.)

git-svn-id: https://svn.eduke32.com/eduke32@3165 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-15 14:27:45 +00:00