Commits

Author Commit Message Labels Comments Date
Bryan Kadzban
Backport the logic parts of https://bitbucket.org/ecsirke/frontier/commits/e4b1143fbd5a1e935fb89e40064fcd879b0e4749 -- but not the parts that change the glOrtho projection matrix for the map, or reformat code. Set a default resolution that works on my ancient LCD.
Bryan Kadzban
Backport the logic parts of https://bitbucket.org/ecsirke/frontier/commits/a17df28f5badb66812ca582ed90cf7734e72d2f2 -- I don't see the effects, but either way it seems to work, so good enough.
Bryan Kadzban
Backport https://bitbucket.org/ecsirke/frontier/commits/3aca467d8149031c92c4203e881937ebef2adb4b (but only the part that changed code, not the part that changed formatting), to render the map position with crosshairs instead of a box.
Andras Eisenberger
Added new fog texture
Bryan Kadzban
Backport the essence of https://bitbucket.org/ecsirke/frontier rev eff451c5eaf7, distilled down to one character. (The problem that caused grass glitching was that the shader never handled uv.y being equal to 0.5. Now it does, arbitrarily using the second branch.)
Comments 1
Bryan Kadzban
Backport https://bitbucket.org/ecsirke/frontier rev a02d605436b1, to fix purple trees by using the framebuffer extension to render to the tree texture directly. Skip out on the formatting and header-file changes (similar to the previous commit), to focus the diff on just the behavior changes. Include the changes to glFunctions to abort if extensions are missing and log to the console if everything works.
Bryan Kadzban
Cherrypick parts of https://bitbucket.org/ecsirke/frontier rev 4c46a39924bf, to make future cherrypicks slightly easier. Most of that change is not relevant (yes, it's cleaner the way 4c46a39924bf changed it to, but this matches closer to Shamus's code, so I sorta prefer it this way, plus that commit had a bunch of logical changes all bunched together).
Bryan Kadzban
Backout change cf2e053da099 -- should not be necessary now that the "Set()-never-being-called" overload/override bug is fixed, with 854f5d171eb0.
Bryan Kadzban
Fix signed / unsigned overload / override problem causing trees and grass to not be rendered. First broken in commits eb9dde5c8c665fefb32689d53ee6ff2ec79664f5 and 2cb9a26d7353d08cedfcfe42b4c9646fb11c5e53. ...And now I see the giant purple tree problem. Time to pull in the fix for that from other trees I think.
Bryan Kadzban
Fix a rounding bug: when CalculateNormalsSeamless() is comparing GLvectors for equality, it needs to allow some difference between the matching components of the vectors. Otherwise if anything is ever rounded, the equality comparisons will return false instead of true. Also fix glRgba and glVector2, whose operator== overloads had the same issue. Use an epsilon of several decimal places (enough to represent in a float, and catch rounding issues, but not enough to cause significant issues for resolution).
Bryan Kadzban
Ignore all save files
Bryan Kadzban
Remove extraneous CgCompile() call from Render.cpp: it's already being compiled in CgInit(), called from Main.cpp:init(), and having two calls dumps out the results to the console twice.
Bryan Kadzban
Occasionally frontier SIGFPEs from trying to calculate 0 % 0. Not entirely sure why (it looks like Build is being called on CGrass that hasn't had Set() called on it yet), but it's easy enough to work around: just ignore the Build call.
Bryan Kadzban
Fix a warning from cgc: swizzle out only the .xyz elements of the float4 input normal when setting the float3 N value.
Bryan Kadzban
Fix a *major* bug in the vertex shader setup: cgGLSetStateMatrixParameter()'s last argument is a transformation to make to the *matrix selected in the second argument*, meaning CG_GL_MODELVIEW_MATRIX is totally invalid. Instead, use CG_GL_MATRIX_IDENTITY (the valid values, according to the Cg docs, are IDENTITY, TRANSPOSE, INVERSE, and INVERSE_TRANSPOSE; some of the examples indicate that INVERSE_TRANSPOSE is useful for normal vectors or something, which is why this exists). These should really be different enums; then the C++ typechecking would have caught this. But I can't change the Cg/cgGL.h header, so just…
Bryan Kadzban
Undo commit e90a21f926a9 for CGrid.cpp: should not have been changed (was tinkering)
Bryan Kadzban
Fix up CGrid.h: last time I should have checked it in, not CGrid.cpp (now I have to undo that...)
Bryan Kadzban
Fix a major bug in GridData-derived classes: None of them actually called the parent class constructor on the current object. They all simply created a temporary of type GridData, and threw it away. (That's what "<classname>()" does, when not assigned to anything.) Also set the Update() method abstract on the GridData class, to stop creations of GridData objects. (Not sure if this is happening elsewhere, but I don't think there are any other class hierarchies in this code, so probably not.)
Bryan Kadzban
Oops, nope, one uint32_t -> int32_t required still. These, together, fix the "world never becomes ready and starts rendering" bug.
Bryan Kadzban
Last bits of uint32_t -> int32_t conversion
Bryan Kadzban
Fix up help string for "particle" command: use the "particle" help string, not the "game" help string.
Bryan Kadzban
Fix up buffer breakage: the buffer allocated with "new char[<size>]" *must* be freed by delete[], not delete. Also use "char" instead of "unsigned char" for it, everywhere, since those are two different types (char defaults to signed on some compilers, including mine, but apparently not ms's). Unclear so far why the data that gets put into the buffer (in the case of a texture not found) can be unsigned, but it appears to work. (Biggest fix is delete[] instead of delete.)
Bryan Kadzban
Clean up CFigure::Update a bit: instead of having a separate pointer to the iterator's current Bone class, just use the iterator's operator-> overload.
Bryan Kadzban
Get rid of "using namespace std", and prefix everything with std:: instead. (Prevents problems with e.g. "max" colliding with stuff in the root namespace.)
Bryan Kadzban
Fix another array overrun bug: clamp to [0, WORLD_GRID - 2] in WorldColorGet as well.
Bryan Kadzban
Clean up crazy pointer arithmetic. Instead of advertising the individual size of each GridData item, store pointers to them in the vectors instead. Then, since vectors are not guaranteed to never move their contents, meaning storing a pointer to item 0 is a bad idea, store a pointer to the vector instead (in the GridManager). Make helper methods for clearing vectors (need to delete all pointers held in the vector first) and init…
Bryan Kadzban
Arg, it seems that SdlTick() has to return a signed value, not an unsigned, so after all that "long" -> "uint32_t" nonsense, now I have to go back and change them all to "int32_t". Wheee.
Bryan Kadzban
Allow the user to build 32-bit, by overriding CXX="g++ -m32": use $(CXX) for the linker instead of hardcoding g++.
Bryan Kadzban
Arg, this crash was way more obvious than I thought. :-/ When the code is going to call WorldRegionGet on origin.x+1, it had *better* clamp origin.x to less than the size of the world map *minus two*, not minus one. Otherwise when origin.x clamps down to 255, the code will try to get at array element 256, which doesn't exist. This crashes.
Bryan Kadzban
Grasping at straws to fix this segfault: try making all "long" types "uint32_t" instead, since "long" is a totally different size in different compilers. (Windows did the dumb thing of using LLP64 for 64-bit -- and 32-bit windows is totally different as well -- while most SysV-style ABIs are LP64.)
  1. Prev
  2. Next