Commit Graph

3548 Commits

Author SHA1 Message Date
Bill Currie 7ed33f6345 Hide D_FlushCaches.
There'd been a way to do so all along :/ There might be some issues with
this, but those will be easy to fix :)
2012-04-11 14:58:55 +09:00
Bill Currie 7865f6afe1 Rename sw's R_Init to sw_R_Init.
For now, the only symbol I'll bother messing with in the sw renderer.
2012-04-11 14:58:54 +09:00
Bill Currie 1dd1aec48f Make libgl_handle static.
This will make life interesting for getting the final stages working, but
it helps for now.
2012-04-11 14:58:54 +09:00
Bill Currie 772af29cb3 Move the gl cvars into gl.
That gets rid of the gl_overbrite_f clash. They were put in r_cvar for
saving to the config file, but that was before seta existed.
2012-04-11 14:58:54 +09:00
Bill Currie 65bd29353c Make a start on putting the pieces together.
Still many undefined and multiply defined symbols, but there seems to be a
light in this darkness. I just hope it's not an oncoming train :)
2012-04-11 14:58:54 +09:00
Bill Currie d445b4ef88 Rename the glsl qfgl functions to qfegl.
Keep them separate from the gl renderer :)
2012-04-11 14:58:54 +09:00
Bill Currie 36504547a8 Rename the public symbols for gl, glsl and sw32.
Evil hack, but it does the job.
2012-04-11 14:58:54 +09:00
Bill Currie 8de5c9ae3f Do a final cleanup before doing the big rename. 2012-04-11 14:58:54 +09:00
Bill Currie f7007825e4 Run the vacuum cleaner over sw32's global variables.
This seems to be everything that can be made static.
2012-04-11 14:58:54 +09:00
Bill Currie db4a463727 Remove VISIBLE from the files that will go into the plugins. 2012-04-11 14:58:54 +09:00
Bill Currie eb536dc995 Remove D_BeginDirectRect and D_EndDirectRect from gl/glsl.
They were never really needed anyway (they're for the sw renderer).
2012-04-11 14:58:54 +09:00
Bill Currie e991c1fed3 Make a bit of progress cleaning up vid for plugins. 2012-04-11 14:58:54 +09:00
Bill Currie 80f5cc59e9 Plug a memory leak.
Allocating (and not freeing) rects every frame... ouch.
2012-04-11 14:58:54 +09:00
Bill Currie 96b80433d8 Make some progress in getting static plugins to link.
Still many redefined symbols (and I expect more to come), and many
undefined symbols too.
2012-04-11 14:58:54 +09:00
Bill Currie 5f5305d61d Map vr_data/funcs to vid_render_data/funcs. 2012-04-11 14:58:54 +09:00
Bill Currie ad61c7a30c Start working on creating the render plugins.
Things blow up quite nicely. :)
2012-04-11 14:58:53 +09:00
Bill Currie 8530959752 Link the model libs to the render plugins. 2012-04-11 14:58:53 +09:00
Bill Currie 8e91fb7bc1 Get the basics linking.
Still, nothing will work: no plugins are loaded and they're all broken
anyway.

glx, sgl, glslx etc are going away, just the basics will be built: fbdev
(probably go away eventually), sdl, x11 and hopefully someday win. That's
actually the only reason anything links.
2012-04-11 14:58:53 +09:00
Bill Currie a4c280f2b2 Take the first step towards render plugins.
No clients link. Even if they did, nothing would work.
2012-04-11 14:58:53 +09:00
Bill Currie 1cbabf72c9 Fix a buffer overflow.
gcc 4.7 found it :)
2012-04-11 14:56:49 +09:00
Bill Currie 39e1ccc506 Don't try to process skins in GL without a player model.
If the client receives a skin updated message from the server before having
loaded the player model (shouldn't happen, but some servers have very
strange programmers), no skin data is avaible for updating, so just bail
out.
2012-03-14 16:08:48 +09:00
Bill Currie 82679066cc Run a vacuum cleaner over the diffs between x11 and glx init.
X11 and GLX init are nowhere near as scary as I thought they were, once
they've been tidied up.
2012-02-18 21:33:54 +09:00
Bill Currie eff8ebd9ba Fix a snafu.
In all that, I forgot to test non-asm builds.
2012-02-18 14:54:20 +09:00
Bill Currie 72fb96245f Cleanup global symbols for the sw and sw32 renderers.
Names not mangled, but those symbols that could be made static have been.
Also, many dead variables have been removed.
2012-02-18 14:34:14 +09:00
Bill Currie ef37ed39a9 Clean up global symbols for the glsl renderer.
Where possible, symbols have been made static, prefixed with glsl_/GLSL_ or
moved into the code shared by all renderers. This will make doing plugins
easier but done now for link testing. The moving was done via the gl
commit.
2012-02-18 11:48:52 +09:00
Bill Currie 447ff2f2f5 Clean up global symbols for the gl renderer.
Where possible, symbols have been made static, prefixed with gl_/GL_ or
moved into the code shared by all renderers. This will make doing plugins
easier but done now for link testing.
2012-02-18 11:48:52 +09:00
Bill Currie 057da55385 Fix the incorrect linkage of libQFrenderer*
They're now currently not installed, but they were still building as shared
libs, and thus the installed bins were broken.
2012-02-18 11:46:46 +09:00
Bill Currie 78789a6833 Add support for blender's environment maps.
QF will now load a single image with (${skyname}_map.*) using blender's
layout. That is, 3x2 with the top row being back, right, front and the
bottom row being bottom, top, left.
2012-02-16 20:47:38 +09:00
Bill Currie bfdb2b20d5 Clearify skybox layout.
Turns out quake skynames have left and right backwards.
2012-02-16 20:42:49 +09:00
Bill Currie ce6ab908a5 Don't include the specific plugin headers in plugin.h.
This lets files that use plugins not depend on plugins they don't use.
2012-02-13 22:02:07 +09:00
Bill Currie 699ab70482 Fix audio again.
Bah, even though audio no longer needs models, it was still linking with
it :P
2012-02-13 16:44:30 +09:00
Bill Currie 2ab1367245 Update to reflect the new dependency status. 2012-02-13 16:25:22 +09:00
Bill Currie 3cb4cb59b5 Link QFgamecode directly into QFruamoko.
First step in the library "merge down".

QFgamecode is now a convenience library. The only things that mention it
directly now are ruamoko and qfcc.
2012-02-13 15:05:31 +09:00
Bill Currie 9a91aff93c Move the ambient level check out of the sound renderer.
Instead, the client gets the current leaf and passes ambient_sound_level
from the leaf to S_Update.
2012-02-13 13:44:29 +09:00
Bill Currie d8a37bc791 Correct the usage of gzFile.
Thanks to spirit for pointing that QF wasn't compiling with zlib 1.2.6
(archlinux, not yet in debian).

I was using gzFile as "gzFile *gzfile", but gzFile is already a pointer. In
older versions of zlib (including the 1.2.3 that's in debian), gzFile is
declared as a void *, and it seems that gcc is happy with assigning void **
to void *. However, in recent zlib, gzFile is now struct gzFile_s *, which
gcc is most definitely unhappy about assigning to struct gzFile **.

I just hope that either I had misread the type back when I wrote quakeio,
or that nobody is using such an ancient zlib.
2012-02-13 09:00:31 +09:00
Bill Currie 02d24189ef Use QF_NEED for plugins.
At the moment, the selection of the default sound driver etc is broken.
2012-02-12 11:37:25 +09:00
Bill Currie 4707706f5d Use QF_NEED for the renderer and model libraries.
This breaks RPM building, but I can fix that later.
2012-02-10 13:29:45 +09:00
Bill Currie 7a8f91edda Move bi_gib.c from ruamoko to gib.
This makes gib depend on gamecode, but removes the dependency on gib from
ruamoko. Unfortunately, carne now needs to be linked against gamecode even
though it never uses it.
2012-02-09 10:00:54 +09:00
Bill Currie da4fb6178c Correct the client console plugin's dependencies. 2012-02-09 09:51:50 +09:00
Bill Currie e34f0178b6 Build GLSL clients for SDL.
Just about to do a release, and I realized windows users wouldn't have any
way of checking out the new renderer. I'll add wglsl when I get a chance to
do some testing.
2012-02-08 22:05:58 +09:00
Bill Currie fe3f0fa7ce Remove snax' object module.
We don't use it for anything. If we ever want it again, we can just pull
it from history.
2012-02-08 15:21:57 +09:00
Bill Currie b59ffd4cf1 Fix win32 (mingw) builds. 2012-02-07 20:18:23 +09:00
Bill Currie 0a277376ed Fix static builds. 2012-02-07 20:17:32 +09:00
Bill Currie 8ecf74753c Refer to local libs without a path.
I'm sure I've been here before... Anyway, using $(top_builddir)/... to
refer to a local lib confuses make and breaks parallel builds.
2012-02-07 18:45:55 +09:00
Bill Currie 9fbff2f4d5 Do an audit of the Makefile.am files.
o All instances of LIBADD/LDADD have a corresponding DEPENDENCIES
    specificatiion.
  o libraries now use a lib_ldflags macro to keep things consistent
  o duplication of source/lib names has been minimized (particularly in
    the libraries; more work needs to be done for the executables)
  o automake spec blocks have been organized (again, more work needs to be
    done for the executables)
2012-02-07 16:04:19 +09:00
Bill Currie b5019c8e33 Nuke the engine dicrectory from gamecode.
Not the contents, of course :) Anyway, finally, that totally useless
directory is gone.
2012-02-06 23:44:52 +09:00
Bill Currie a694eed968 Add Draw_Picf to allow smooth placement on low-res consoles. 2012-02-06 19:32:30 +09:00
Bill Currie 14c0e22494 Tweak Draw_MakePic to be a little more usable. 2012-02-06 15:50:32 +09:00
Bill Currie c98ffa4eda Create a message buffer API for Ruamoko
The api hides all the gory details of message buffer setup and usage
(particularly the differences between writing and reading). Most
importantly, the api provides a safe way to read and write binary data
(always little endian).
2012-02-06 15:50:32 +09:00
Bill Currie 042f310ed7 Add MSG_WriteBytes to match MSG_ReadBytes. 2012-02-06 15:04:01 +09:00
Bill Currie 42b87ee80c Fix the memory leak in rua Draw_CachePic. 2012-02-06 12:49:57 +09:00
Bill Currie be9f05ea14 Catch progs zone errors and give a stack dump. 2012-02-06 12:48:22 +09:00
Bill Currie cef004fc15 Fix a type mismatch on android. 2012-02-05 14:28:23 +09:00
Bill Currie 4bd6bca6f2 Fix a prototype/definition mismatch. 2012-02-05 14:27:48 +09:00
Bill Currie 8c3db9a10d Fix regex.c for android.
Android's headers declare bcmp etc in strings.h, but don't the functions
don't exist in the libs.
2012-02-05 14:26:23 +09:00
Bill Currie 201532ea7e Fix missing library references when linking. 2012-02-05 14:25:22 +09:00
Bill Currie 3bd75cefd8 Autoconfiscate log2f.
Android doesn't supply log2f for us (though it does have all the other
float calls ruamoko wants).
2012-02-05 14:23:33 +09:00
Bill Currie 6f10f0cea6 Fix the x86 sw renderer (intel asm).
I'd forgotten about assembly code versions when I was doing my testing
when I redid skins. Thanks to Sander for pointing it out.
2012-02-02 17:32:27 +09:00
Sander van Dijk 49453b690f glsl_main.c: initialize t[] to silence compiler warning. 2012-02-02 16:55:33 +09:00
Sander van Dijk 82adc67a67 glsl_bsp.c: __builtin_expect() to avoid compiler warnings. 2012-02-02 16:55:25 +09:00
Bill Currie f800e79a38 Make the init process more dependency based.
Most subsystems that depend on other subsystems now call the init functions
themselves. This makes for much cleaner client initialization (more work
needs to be done for the server).
2012-02-01 21:52:47 +09:00
Bill Currie b9bb7d95bb Remove calls to Sbar_Changed from the libraries.
If this breaks things, we'll have to sort something out, but again, no libs
reaching into the exe.
2012-02-01 20:06:14 +09:00
Bill Currie 5efc78b920 Move the call to R_Particles_Init_Cvars into R_Init_Cvars. 2012-02-01 20:05:11 +09:00
Bill Currie 4b390909f2 Move r_gravity to it's rightful home.
r_part.c makes much more sense.
2012-02-01 20:03:16 +09:00
Bill Currie fa0ff96533 Clean up the mess with host_basepal and vid_colormap.
Libs should not be reaching into the exe :P
2012-02-01 19:52:13 +09:00
Bill Currie d76e4608ab Rewrite the ruamoko draw api internals.
Update for using resources, and add wrappers for Draw_MakePic and
Draw_DestroyPic/Draw_UncachePic.
2012-02-01 18:19:54 +09:00
Bill Currie bc2aca53c3 Add functions to create/destroy qpics.
The creation uses raw 8-bit data (and the system palette). Destroying a
qpic loaded via other means will probably produce nasal demons.
2012-02-01 17:46:15 +09:00
Bill Currie 2b6adaa2d4 Do some more const correctness. 2012-02-01 17:44:55 +09:00
Bill Currie 7e406c20e5 Allow uncaching of qpics.
qpics loaded via Draw_CachePic can now be uncached via Draw_UncachePic.
2012-02-01 16:55:35 +09:00
Bill Currie a849cf7698 Fix a stale include problem.
Thanks to iku for pointing it out.
2012-02-01 14:13:00 +09:00
Bill Currie a131a7ab9d Fix the gl test... again :/
Actually, it probably doesn't make any difference, but making it look
right is still important.
2012-02-01 13:01:24 +09:00
Bill Currie 706f09b247 Put the transparent surfaces on the water chain.
I'd actually done this the first time, but then got confused and forgot the
waterchain works with multiple textures. This is actually the right place
as all transparent surfaces need to be sorted irrespective to their
textures. Really, waterchain needs to be renamed.
2012-01-31 18:08:06 +09:00
Bill Currie b286a35281 Sort transparent surfaces back to front.
This allows overlapping transparent surfaces to look like they are
overlapping each other rather than only the nearest one showing.
2012-01-31 16:17:09 +09:00
Bill Currie 1052bd2624 Fix the segfault on leaving e1m2.
Problem and solution found by Deek, reason by me.
2012-01-31 09:51:44 +09:00
Bill Currie c3d2365bd8 Fix a missed default_color init.
Wish I'd caught this earlier :/
2012-01-30 21:02:13 +09:00
Bill Currie c01255a387 Fix a case&paste error.
Doesn't fix the color problem for water surfaces on my eeepc, though :(
2012-01-30 20:31:58 +09:00
Bill Currie 8f0ce733ff Sanitize color handling a little. 2012-01-30 20:31:37 +09:00
Bill Currie 4b948de225 Ensure the lightmap gets rebuilt when the dlights disappear.
I didn't realize what that line was for when I copied the code from GL :/
2012-01-30 18:41:27 +09:00
Bill Currie e4f63fba6c Fix some integer shift overflows.
Thanks to Ozkan Sezer for pointing them out.
2012-01-30 09:13:06 +09:00
Bill Currie f8dfee6de7 Merge branch 'master' into glsl 2012-01-29 22:36:35 +09:00
Bill Currie 497718cc40 Plug the memory/texture/vbo leaks.
QF still leaks about 3MB/run on demo1, but even 100 runs didn't show any
render issues.
2012-01-29 22:32:35 +09:00
Bill Currie b03e937b67 Implement brush entity alpha.
http://www.celephais.net/board/view_thread.php?id=60157& has a good map for
testing (you see an example straight away if you look up). (+set max_edicts
2048)
2012-01-29 16:56:50 +09:00
Bill Currie 8f869c001b Fix the missing world on map reload.
If the map got reloaded but the current leaf didn't change the world (and
most entities) didn't get drawn. Forcing a vis update by first setting
r_viewleaf to null and marking surfaces does the trick :)
2012-01-29 16:09:35 +09:00
Bill Currie 462a9047c6 Fix the missing fog on particles and sprites.
Bah, definitely need a metter method of parameter interrogation.
2012-01-29 10:35:23 +09:00
Bill Currie 731236ee07 Implement global fog.
Sprites and particles don't seem to be getting fogged correctly, but bsp
and alias models are working.
2012-01-29 10:27:28 +09:00
Bill Currie 4734c5b64a Implement water alpha. 2012-01-28 21:20:34 +09:00
Bill Currie 7e078c7f9c Revamp cshifts and implement in glsl.
The renderer should now be free of any direct access to client code. Even
3d rendering is now done via a function pointer.

The cshift code is done as a 2d screen function.
2012-01-28 20:45:14 +09:00
Bill Currie 315db554b5 Add some instrumentation to check render speeds. 2012-01-28 14:10:47 +09:00
Bill Currie 2595251162 Do not update every visible lightmap every frame.
This takes nq from ~25fps to 65-72 fps on Unforgiven's start map.
2012-01-27 21:48:25 +09:00
Bill Currie d18aa2fe3e Do not try to unregister ports with a lost jackd.
libjack seems to get stuck when unregistering ports with a broken
connection.
2012-01-27 19:58:03 +09:00
Bill Currie 8ac9ff0134 Link libQFmodels* agains libQFimage.
This is the correct fix for server linking wrt LoadPCX. Sort of. Really, it
would be better to disconnect the dependencies.
2012-01-27 19:55:30 +09:00
Bill Currie 03c7441265 Fix server linking wrt skin stuff. 2012-01-27 17:37:52 +09:00
Bill Currie ca2c861671 Fix team colors in GL NQ. 2012-01-26 13:53:52 +09:00
Bill Currie 5dcaeae97b Fix custom skins in GL for QW. 2012-01-26 12:50:37 +09:00
Bill Currie df87cffe15 Start working on the new GL skin code. 2012-01-24 23:06:07 +09:00
Bill Currie 695b38e5e5 Fix a segfault when merging rects. 2012-01-24 19:56:59 +09:00
Bill Currie d8d21b00f4 Fix some issues found found by valgrind.
Buffer underflow and though strcpy has always been safe there, change to
memmove. Had the added benefit of helping me create more test cases for
better coverage.
2012-01-24 19:54:21 +09:00
Bill Currie 6104db50e1 Fix a gl matrix stack overflow.
I'd missed a couple of places for glPopMatrix (worse, one was push!).
2012-01-24 12:10:37 +09:00
Bill Currie 1ef24e0404 Fix a gl matrix stack overflow.
I'd missed a couple of places for glPopMatrix (worse, one was push!).
2012-01-24 12:08:12 +09:00
Bill Currie 6df8867d69 Implement custom skins for glsl. 2012-01-24 10:27:05 +09:00
Bill Currie d6683711f4 Clean up some redundant defines. 2012-01-24 09:37:46 +09:00
Bill Currie 19dc579a5a Fix custom player skins for the sw renderers. 2012-01-23 23:38:32 +09:00
Bill Currie 3dbb5724db Rename Skin_SetColormap_ to Skin_SetupSkin. 2012-01-23 21:40:12 +09:00
Bill Currie 08990ebb5a Make top/bottom color work for GLSL.
Works quite nicely (love those colormaps).
2012-01-23 19:24:12 +09:00
Bill Currie 9a4b065eaf Fix top/bottom colors for the SW renderers. 2012-01-23 17:33:19 +09:00
Bill Currie e3f76de898 Avoid a division by zero.
Doing a cache profile on an unused cache wasn't nice.
2012-01-23 16:46:52 +09:00
Bill Currie 7bfddd7ffe Gut most of the old skin code.
Custom skins are smashed on most targets. Player colors don't work, etc.
However, this will let me do a much cleaner implementation.
2012-01-23 16:16:30 +09:00
Bill Currie 61c127abc0 Make a start on skin support.
I had this lying around for a while since it was more important to get
other things working first.
2012-01-22 15:49:01 +09:00
Bill Currie 76cb60461d Tweak the size of point particles.
This looks fairly reasonable, but should probably be tweaked further to
base the point size on resolution.
2012-01-21 22:05:24 +09:00
Bill Currie 5080a6f37e Enable the point size shader variable.
This is a rather "evil" hack because GLES doesn't seem to need
GL_VERTEX_PROGRAM_POINT_SIZE, but GL does, and all my work is currently
done in GL rather than GLES. Point particles now work, but the sizes are
all wrong.
2012-01-21 21:54:36 +09:00
Bill Currie 68d956583d Draw ALL of the particles, not just 2/3 of them.
Using quads requires 4 elements, but triangles require 6. I'd gotten the
element array setup right, but I'd forgotten to tweak vacount when drawing
the particles.
2012-01-21 20:16:18 +09:00
Bill Currie 8345f07db2 Implement QF style particles.
Actually looks pretty good against the sw style world.
2012-01-21 19:51:18 +09:00
Bill Currie 4955caafe5 Make the dynamic textures more readily available.
I want to get QF style particles going in glsl (since id style is currently
stuck at one pixel), but I don't want multiple copies of the texture code.
2012-01-21 19:13:01 +09:00
Bill Currie 358bbc4439 Disable the sky spin effect.
It's cool, but not appropriate as a default. All that's needed is a way to
set (and optionally update) sky_velocity (map vars? qc?).
2012-01-21 17:18:29 +09:00
Bill Currie 62c5070d8b Use the correct type for particle colors.
Sending byte data as floats doesn't work too well :P Fixes the colors of
the particles, but not the size :(.
2012-01-21 16:17:54 +09:00
Bill Currie 2cb2f230fd Print out the point size range.
I'm not sure if there's a bug in mesa, or if I'm doing something wrong, but
GL_POINTS doesn't seem to be working properly. I get the points, but
writing to gl_PointSize doesn't make a difference despite the size range
being 1-255.
2012-01-21 15:48:21 +09:00
Sander van Dijk 197481bdbb in_sdl.c: default to "have_focus" to "1". 2012-01-21 09:27:35 +09:00
Sander van Dijk 25ffe6bc3e cd_sdl.c: fix typo. 2012-01-21 09:27:30 +09:00
Sander van Dijk 8e6c3f7bf8 Make gl_rsurf.c compile without warnings with "gcc (GCC) 4.4.5 20101112 (Red Hat 4.4.5-2)". 2012-01-20 20:51:29 +09:00
Bill Currie 5e1a80e016 Implement particles as points.
Unfortunately, the maximum point size on Intel hardwar seems to be 1, so I
can't tell if the colors are right.

This is largely just a hacked version of GL's particle code.
2012-01-19 10:39:03 +09:00
Bill Currie 63893b6a2f Zap some magic numbers. 2012-01-19 10:36:10 +09:00
Sander van Dijk d8432e78bb Fix a wrongly negated condition in snd_win.c:SNDDMA_UnblockSound(). 2012-01-18 21:39:17 +09:00
Bill Currie 470500f79d Fix an oopsie between pahdr and paliashdr.
I understand the reasons, but ooh, the sw renderer is ugly in places.
2012-01-17 21:00:19 +09:00
Bill Currie 42bb10a3d7 Clear out the lightmap scrap at each level change.
This allows the demo loop to run more than 4 times (12 demos). Once the
rest of the resource management is done, demos should run indefinitely.
2012-01-17 19:31:50 +09:00
Bill Currie fc43e5a307 Allow clearing of a scrap.
This "frees" all rectangles and subpics allocated from a scrap. subpics
are owned by the scrap from which they are allocated.
2012-01-17 19:31:50 +09:00
Bill Currie 3669e3aa2e Make alias model caching optional.
For now, only the glsl loader disables caching, but it stores the frame
vertices in GL memory, so its hunk usage is relatively lower (and will be
lower still when I get skins sorted out).
2012-01-17 19:31:50 +09:00
Bill Currie fb428f8067 Rename mod_flood.c to floodfill.c 2012-01-17 19:31:50 +09:00
Bill Currie 05bf637466 SDL sound patches from SVD.
Thanks to "Sander van Dijk" <a.h.vandijk@gmail.com>, we now have much
better SDL sound support.

Here's the promised cleaned up version of the "double buffer" approach
patch for "snd_sdl.c". I've taken some more time to re-read and test
it this time, and it seems to behave well. All memory that is used by
both the main thread and the SDL audio thread is prefixed with "shm_",
and locking is used to ensure that only one thread accesses it at the
same time.
2012-01-17 19:14:42 +09:00
Bill Currie 0abb8a7554 Merge the particle physics. 2012-01-15 20:14:36 +09:00
Bill Currie ece78f7605 Clean out some useless functions.
D_Start/EndParticles in the sw renderers will likely never have any
content, so no point in calling or even having them.
2012-01-15 09:34:10 +09:00
Bill Currie e7b01bb6b6 Put the transparent color back to 0,0,0,0 rgba.
Blended sprites were a tad ugly without that.
2012-01-14 22:20:23 +09:00
Bill Currie c884ef5f80 Convert the colormap to a 2D palette.
This skips one level of indirection in the alias model and brush shaders.
Hopefully, this will improve performance on my eeepc.
2012-01-14 21:42:42 +09:00
Bill Currie 928dd92276 Use 0.0 instead of 0.5 for t for palette lookups.
I realized it's pretty silly using colormap + palette when I can just
combine the two into one and have a 2D palette. This is in preparation for
that.
2012-01-14 20:51:43 +09:00
Bill Currie 2425498479 Enable the view model. 2012-01-14 20:07:43 +09:00
Bill Currie de022ae72d Rewrite GL_LoadQuakeMipTex to generate mips itself.
Relying on GL to generate mips for 8 bit textures doesn't produce nice
results. These aren't the greatest, either, but they're better.
2012-01-14 19:02:06 +09:00
Bill Currie 7739ba3ea9 Move the 2D set out of the 3D code.
It really belongs exclusively in the screen setup code.
2012-01-13 19:51:45 +09:00
Bill Currie f5f8b65c81 Fix the wonky viewsize border.
2D mode wasn't getting set after rendering the world. oops.
2012-01-13 19:47:16 +09:00
Bill Currie eb2e688c9e Clean up some whitespace. 2012-01-13 19:46:52 +09:00
Bill Currie 617107f9c1 Perform some black magic.
}:>
2012-01-12 21:23:39 +09:00
Bill Currie cbd13ac54e Implement QuatExp and fix up QuatBlend's param names. 2012-01-12 21:22:06 +09:00
Bill Currie ba1b819173 Merge skyid and skybox begin/end. 2012-01-12 17:34:29 +09:00
Bill Currie 6e2d625d36 Load the skybox faces into the correct cubemap slots.
Quake and GL are rotated relative to each other, so care must be taken
when loading and rendering.
2012-01-12 15:13:19 +09:00
Bill Currie f1eea0176c Fix the too near far-clip plane.
I don't know if I miss-copied that, or if there's a bug in FTE's code.
2012-01-12 13:41:06 +09:00
Bill Currie a66fcb8448 Implement skyboxes.
The texture assignments are incorrect, but it's otherwise working.
2012-01-12 11:05:34 +09:00
Bill Currie 8bcef272e6 Render the id skys :)
Wow... smooth.
2012-01-11 21:26:12 +09:00
Bill Currie 7ba7130f42 Load the sky texture as two separate textures.
The sky texture is normally 256x128, with each 128 wide side being the two
layers of the sky.
2012-01-11 21:09:57 +09:00
Bill Currie b43d03a98b Let the render specific texture loader decide on sky texture loading.
This is necessary to allow the glsl texture loader to process the sky
textures.
2012-01-11 21:08:04 +09:00
Bill Currie f6f2e4f406 Create and load the id sky shader. 2012-01-11 16:02:20 +09:00
Bill Currie 89ae6eca8b Even better?
It's difficult getting the same result because GL st are 0-1 but sw quake's
st are 0-inf % 64.
2012-01-11 07:51:15 +09:00
Bill Currie 5dbf913d41 Get the turbulence more correct.
This looks right, and should be easier to tweak.
2012-01-11 06:38:27 +09:00
Bill Currie d2dae4cc58 Produce a saner turbulence.
I'm not quite sure it's right. Need to watch sw's turb a bit more.
2012-01-10 21:11:21 +09:00
Bill Currie 3508972d66 Draw water surfaces... with some really funky turbulence.
It seems I misunderstood the sw turbulence code.
2012-01-10 20:50:47 +09:00
Bill Currie e38d72f50b Get brush entity rendering working.
Unfortunately, the intel driver on my eeepc doesn't like the mipmas for
plat_top2 or +2floorsw. If I either don't load their mipmaps, or skip
drawing them, things seem to work nicely.
2012-01-10 13:06:02 +09:00
Bill Currie 3326aceed8 Rewrite the texture chain index list building.
It turns out my complicated plan was just that: complicated. Although there
are currently some bugs, the method I used to build the VBO in the first
place will work equally well for building the index lists.
2012-01-09 21:16:08 +09:00
Bill Currie 754dda92ff Get the lightmap texture properly. 2012-01-09 21:13:40 +09:00
Bill Currie ef311b60d6 Remove a now dead function. 2012-01-09 18:55:30 +09:00
Bill Currie 2b45cd693f Fix the black overbright dlights.
t was unsigned and underflowing. This fixes the problem but keeps the
bitshift unsigned clean.
2012-01-09 18:05:41 +09:00
Bill Currie 310ba49f17 Make the dynamic lightmaps... dynamic. 2012-01-09 16:46:20 +09:00
Bill Currie 0005c97865 Temporary weaks so things look halfway decent.
GL mipmaps and paletted textures don't mix, and lightmaps work quite well
with linear sampling.
2012-01-09 16:26:28 +09:00
Bill Currie 12fd6bd390 Fix the segfault on map change.
I had forgotten to call R_ClearTextures when I'd rearranged the code.
2012-01-09 10:16:54 +09:00
Bill Currie cd91fe7c8d Set the pixel unpack alignment to 1.
4 hours chasing that one down. ouch.
2012-01-09 02:18:39 +09:00
Bill Currie 8779755e9c Dump allocated rects for glsl_scraps BLAH. 2012-01-09 01:31:29 +09:00
Bill Currie f658e6c32e Initialize d_lightstylevalue.
"Let there be light!", but chaos still reigns (broken lightmap updates).
2012-01-09 01:30:26 +09:00
Bill Currie 1229d24ef6 Get world rendering mostly working.
Just some problems with lightmaps. There also seem to be some issues with
seams (t-junctions?) and far clip, but they're quite separate.

There's also a problem with a segfault when loading a second map.
2012-01-08 22:09:51 +09:00
Bill Currie 7428a91526 Try, but fail, to render the world. 2012-01-08 20:39:36 +09:00
Bill Currie ea377b80c5 Remove some redundate statements. 2012-01-08 20:38:56 +09:00
Bill Currie f8d7bcf271 Rename R_RecursiveWorldNode to R_VisitWorldNodes in gl. 2012-01-08 18:16:33 +09:00
Bill Currie 6abaa5ea74 Build the display list for all loaded brush models.
The entire vertex set from every model is put into one list (not yet
uploaded). chains of elements arrays are build for non-instanced models
(instanced models will have their chains built each frame).
2012-01-08 17:45:44 +09:00
Bill Currie fa82c37bd0 Pre-invert subpic->size.
I forgot to do this earlier :/
2012-01-08 17:44:28 +09:00
Bill Currie 601cc6e3d1 Make a start on bsp rendering.
Still nothing being rendered: still in the process of building the display
lists, but I'm making good progress. Get this into git before something
goes wrong :)
2012-01-08 10:29:38 +09:00
Bill Currie ec7d01f9b2 Merge out R_TextureAnimation. 2012-01-08 10:21:08 +09:00
Bill Currie 655252a506 Fix some warnings. 2012-01-07 23:11:56 +09:00
Bill Currie aa27a3f49c Load bsp model textures as repeating mipmaps. 2012-01-07 18:05:54 +09:00
Bill Currie 204c1aba03 Don't use the miptex_t after converting to texture_t. 2012-01-07 17:08:07 +09:00
Bill Currie 29a0dc0b68 Actually build the lightmaps, and fix a silly bug in the scrap allocator.
Also, add a command for dumping scrap statistics.
2012-01-07 15:35:08 +09:00
Bill Currie 8a5658ed61 Implement the bulk of the lightmap code.
Now just to get surface rendering going and hook in the lights.
2012-01-07 14:53:23 +09:00
Bill Currie a988c192ab Fix OSS sound. YAY!!!
Much thanks to Spirit from quaddicted for his patient help in testing, and
Spike for his heckling ;)
2012-01-06 21:21:45 +09:00
Bill Currie 0993803006 Add texture sub-image management.
The planned uses are lightmaps and 2d icons.
2012-01-06 16:24:13 +09:00
Bill Currie c25327f4ed Add union and merge functions and tests. 2012-01-06 12:57:25 +09:00
Bill Currie 73f2c12815 Delete the intersection rect when finished. 2012-01-06 11:04:50 +09:00
Bill Currie 981760e19a Add tests for vrect. 2012-01-06 11:04:34 +09:00
Bill Currie 2ae044effd Split out vrect_t to its own file and add support functions.
The rest is cleanup after removing a wart from one of the field names.
2012-01-06 09:52:14 +09:00
Bill Currie 42266cddd5 Get models being lit by the world's lightmaps.
Even though the world isn't rendered yet.
2012-01-05 22:37:02 +09:00
Bill Currie 423e08ce21 Add demo to "movie" conversion.
It currently writes a series of png files (QF/qfmvNNNNNN.png), at a fixed
rate of 30fps, with no sound recording.
2012-01-05 19:19:37 +09:00
Bill Currie b13a2b6dbd Move screenshots to $fs_userpath/QF.
I got tired of screenshots getting scatter across the tree. ShotsPath in
the dirconf can override this.
2012-01-05 17:07:27 +09:00
Bill Currie 297a4e2756 Put the D_FlushCaches mess back.
It turns out that when it is called is highly timing sensitive :(
However, the rest of R_ClearState remains.
2012-01-05 15:50:20 +09:00
Bill Currie 03bcfb9483 Set the default hudtype.
Yay, Deek for finding another bug in qf :). He had an old dirconf that
didn't specify HudType and thus caused the status bar code to blow up. Set
the default to "id" if none is found.
2012-01-05 14:02:53 +09:00
Bill Currie 764cd91879 Set the default hudtype.
Yay, Deek for finding another bug in qf :). He had an old dirconf that
didn't specify HudType and thus caused the status bar code to blow up. Set
the default to "id" if none is found.
2012-01-05 14:00:57 +09:00
Bill Currie 6f18035c12 Fix up alias-16 support.
After getting in contact with serplord, I now know that the sw alias
loading was correct. Turns out the gl loaders was mostly correct, just a
mistaken subtract rather than add. And with that, I can implement alias-16
support in glsl. better yet, since all the work is done in the loader, the
renderer doesn't know anything about it :) However, I need to create some
16-bit models for testing.
2012-01-05 12:52:12 +09:00
Bill Currie c6bcd7aedb Normalize the vertex normals.
I was wondering why the lighting looked a little extreme in overkill.
2012-01-05 12:45:43 +09:00
Bill Currie bfc743fdcd Add my point shaders before I lose them. 2012-01-04 18:47:03 +09:00
Bill Currie 8fbc6221f7 Get sprite interpolation working.
It's not perfect (it can't be), but it looks a whole lot nicer than no
interpolation.
2012-01-04 18:31:35 +09:00
Bill Currie 6050901e0e Break out the entity blend calculations.
This allows alias and sprite model lerping to share the code.
2012-01-04 18:30:47 +09:00
Bill Currie 836209e5c6 Enable lerping of alias models.
Done in hardware }:>
2012-01-04 16:36:43 +09:00
Bill Currie f0e88bbe85 Rip out the duplicate lerp code and merge it.
While the vertex lerping needs to be duplicated in the current GL code,
there's no need for the setup code to be duplicated. Also, I want it for
GLSL.
2012-01-04 16:26:52 +09:00
Bill Currie 99381b8b8c Rework the alias vertex shader and rendering code for lerping.
Lerping isn't actually done yet (need to get both poses and blend), but
this still renders correctly with blend forced to 0.0.
2012-01-04 14:35:34 +09:00
Bill Currie add5440ad1 Upload the normals with the vertex data.
Not all hardware can access a texture sampler from the vertex shader, and I
don't want multiple paths this early in the game. Now, vertex normals are
uploaded as shorts. Should be 14 bytes per vertex (was 10, could have been
8 if I had put the normal index with the vertex rather than st).
2012-01-04 09:42:00 +09:00
Bill Currie fea7acd871 Enable vis calculation.
One nice thing about this project: I now KNOW that efrags works the way I
wanted it to: all those torches are now toggleable via r_novis :)
2012-01-03 23:20:01 +09:00
Bill Currie d0a0440056 Make R_SplitEntityOnNode easier to read. 2012-01-03 23:19:21 +09:00
Bill Currie 454047ab92 Make r_novis 0 take effect immediately. 2012-01-03 23:17:49 +09:00
Bill Currie 0797183201 Merge R_MarkLeaves from gl, sw, and sw32.
Other than novis, they're functionally identical. Now sw and sw32 have
novis as well.
2012-01-03 21:09:13 +09:00
Bill Currie 091b714e4c Implement dynamic lighting.
This uses the same calculations as the software renderer. However, as the
lightmap calculations are not done yet, if there is no dlight in the
vicinity, there will be no light. demo1 is pretty cool to watch :)
2012-01-03 20:36:07 +09:00
Bill Currie 209c4cda8b Scale the light level index correctly before colormap lookup.
With this, lighting seems to be working. I'm not certain the normals are
100% correct, but I can see something happening on rotating models.
2012-01-03 19:57:47 +09:00
Bill Currie e8f863c76f Remove the hedgehogs from the garden.
While the first frame was fine, any subsequent ones were not. I had
forgotten that hdr->poseverts held the edited vertex count rather than
hdr->mdl.numverts.
2012-01-03 18:11:39 +09:00
Bill Currie d7bc437e2c Fix the borked texture coordinates.
Silly me, doing byte based pointer math on a non-byte pointer :P
2012-01-03 18:10:35 +09:00
Bill Currie 185fded944 Re-enable the matrix optimizations.
Turns out my concatenations were correct.
2012-01-03 18:09:33 +09:00
Bill Currie 21c7b84379 Enable face culling and depth testing.
I spent way too long trying to figure out why triangle order wasn't making
any difference... :P
2012-01-03 18:08:01 +09:00
Bill Currie 1437cbec91 Make the face culling a little more sensible.
GL Quake was weird, culling front faces. Partly understandable, since
Quake's front order is clockwise and GL's default order is
counter-clockwise. However, since the order can be specified, that should
be done instead. Thus, specify the winding order as clockwise (for quake's
data), set culling for back-face removal, and then mess with the winding
direction in the mirror and fish-eye code.
2012-01-03 18:06:26 +09:00
Bill Currie 62e564c5cd Send ALL of the model's verts to GL.
Triangles have 3 vertices, not one :P
2012-01-03 11:47:40 +09:00
Bill Currie ba04cf73d0 Add my test tetrahedrons. 2012-01-03 09:34:17 +09:00
Bill Currie baab15279f Correct the alias vertex data types.
Vertex locations need to be unsigned byte rather than byte (GL is funy
with that). s and t need to be at least short, and since the normal index
is embedded in the st vector, it needs to be the same type. With this, my
test tetrahedrons seem to be working.
2012-01-03 09:34:17 +09:00
Bill Currie c378acab6b Actually load up the mvp and normal matrices.
Rather critical. I thought I'd done that :/
2012-01-03 09:34:17 +09:00
Jeff Teunissen 86edf54c40 Build and ignore cleanups
GLSL renderer build was checking for BUILD_GL instead of BUILD_GLSL in a
few places. Also, ignore the GLSL .fc and .vc files and the binaries.
2012-01-02 14:16:19 -05:00
Bill Currie 2a3151cecd Hook in alias model drawing.
Nothing is visible yet.
2012-01-02 20:28:40 +09:00
Bill Currie 72e3a8d507 Merge sw and sw32 alias frame selection.
I'm leaving GL for later because lerping complicates things. I'll sort it
out when I implement lerping in GLSL.
2012-01-02 17:47:22 +09:00
Bill Currie 1c480bf75e Merge the alias skin selection code.
We really don't need 4 copies of identical code when 1 will do :P
2012-01-02 15:57:43 +09:00
Bill Currie 540bccbc27 Load all the alias vertex data as bytes.
I had forgotten I wanted to do it this way.
2012-01-02 13:41:12 +09:00
Bill Currie a57835866a Build the vertex normals texture. 2012-01-02 13:40:48 +09:00
Bill Currie 6b4a10819a Add an RGB texture loader. 2012-01-02 13:15:19 +09:00
Bill Currie 7e5b3304fc Create the colormap texture. 2012-01-02 11:19:23 +09:00
Bill Currie fd67f3500b Load the alias model shaders. 2012-01-02 11:18:34 +09:00
Bill Currie df3d9fe4df Correct the fullbright start color extraction.
I don't know what despair and I were thinking, but we obviously didn't
understand the colormap code at the time.
2012-01-02 10:53:57 +09:00
Bill Currie 7be08534be Clearify the program dump info a little.
Calling programs shaders was a little confusing when I use shader to refer
to the sub-programs (vertex and fragment shaders). Also, print the program
number as well.
2012-01-02 10:22:03 +09:00
Bill Currie 2ad5aa7aed Unbind the array and element array buffers when done.
Not doing so wreaked havoc on my 2d rendering (what's he doing here, and
why's he messing with my redering? ;)
2012-01-02 10:08:56 +09:00
Bill Currie d1419c30db Make a start on alias model rendering.
The vertex and fragment shaders are written, and R_InitAlias is stubbed,
but that's it so far.
2012-01-01 23:58:12 +09:00
Bill Currie f3884c659c Finish alias skin loading and load vertex data into GL. 2012-01-01 23:55:27 +09:00
Bill Currie f18cd65526 Implement the "cache" in Draw_CachePic. 2011-12-31 20:36:24 +09:00
Bill Currie 3eae8426e6 Implement in-game screenshots. 2011-12-31 17:24:20 +09:00
Bill Currie d8dbfa9c24 Create WritePNGqfs so screenshots can be written as png. 2011-12-31 17:23:32 +09:00
Bill Currie 718595db45 Implement sprite rendering.
Sprite interpolation seems to work, even :) (maybe)
2011-12-31 14:39:33 +09:00
Bill Currie 091e16f9d2 Bring in GL's R_RecursiveWorldNode as R_VisiteWorldNodes.
No surface queuing is done, but entities get queued.
2011-12-31 14:33:20 +09:00
Bill Currie ea2ae1436c Fix some bugs in the new matrix functions/macros. 2011-12-31 13:20:31 +09:00
Bill Currie 55e53b796d Make a start on getting sprites rendering.
The plan is to do interpolated sprites based on a discussion I had with
LordHavoc about them: blending between the two sprite frames. He didn't
mention it, but it looks like blending between the sprite frames' verts is
necessary too.
2011-12-30 21:11:59 +09:00
Bill Currie 16f84cd496 Hopefully get the 3d view and projection transforms setup. 2011-12-30 21:10:24 +09:00
Bill Currie 20d93466c7 Frag some magic numbers.
More annoying than hipnotic's gremlins.
2011-12-30 21:07:35 +09:00
Bill Currie 35bf957d08 Add a 4x4 matrix type and some functions for it. 2011-12-30 20:11:53 +09:00
Bill Currie edb05fdfce Rename Vector3Scale and QuatCompScale.
They are now VectorCompMult and QuatCompMult.
2011-12-30 20:04:55 +09:00
Bill Currie bcdcd7b36d Implement sprint glsl loading.
That was... easy.
2011-12-30 09:36:57 +09:00
Bill Currie a87a60a6fd Flush the text buffer before drawing conback or menus.
Ok, now really done until I notice something else (I forgot this one
momentarily).
2011-12-29 18:23:09 +09:00
Bill Currie 047b7bcc32 Implement Draw_TileClear.
With this, 2d seems to be finished. YAY.
2011-12-29 18:15:15 +09:00
Bill Currie a1035aafe9 Implement Draw_TextBox. 2011-12-29 17:51:31 +09:00
Bill Currie 0e521a7779 Correctly detect going past the end of the pcx data.
palette is just that, the palette, and often won't point to the end of the
pcx data. Use the right end :).
2011-12-29 11:27:54 +09:00
Bill Currie 2b44a25c6b Flush console text after each screen function.
This on its own doesn't fix menus being overwritten with console text, but
it's an important step.
2011-12-29 11:26:14 +09:00
Bill Currie 9fec4d5be0 Implement Draw_Fill.
Almost there with 2d.
2011-12-29 11:25:27 +09:00
Bill Currie 9d0ed6b885 Fix the missing text.
Silly case and paste error cleared out my text vertex array prematurely.
2011-12-29 08:47:32 +09:00
Bill Currie bece72e746 Use a quick hack to get colored crosshairs working. 2011-12-28 21:45:20 +09:00
Bill Currie e69a583f1b Work around a bug in mesa.
Since I'm not specifying the api when creating my context, mesa is giving
me GL2. This is fair enough, but in GL2, vertex attribute 0 is the vertex
position. This too, is fair enough. The problem is, mesa is assigning 0 to
my vcolor attribute and thus I can't set it. The work around is simply to
swap the declaration order of vcolor and vertex (this really shouldn't work
eiter, I suspect).
2011-12-28 20:43:56 +09:00
Bill Currie 6a44978a0f Fix reading of GL_CURRENT_VERTEX_ATTRIB.
Turns out it returns a vec4. oops.
2011-12-28 20:41:26 +09:00
Bill Currie 8ee13ef8c2 Do some clipping in the draw routines.
After fixing Maraakate's crash, I thought it would be a good idea to put
the fixes into QF, too.
2011-12-28 19:20:18 +09:00
Bill Currie 4e7af5c3e0 Add a function to dump the info for all attribute arrays. 2011-12-28 14:27:59 +09:00