www.tombraiderforums.com

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Software Development

Reply
 
Thread Tools
Old 08-09-13, 20:01   #301
TeslaRus
Student
 
TeslaRus's Avatar
 
Join Date: Jan 2013
Posts: 195
Default animations

Heh... For correct statechange working (no rounding errors such as frame / frame_rate) I add in animation loding frames interpolation to 1/30 sec (like in original engine). Some animations statechanges became correct (no freezes).
Character controller is a big hadache... I return previous conception of climbability checking function. Lwmtes adds new correct SDL2 key constants for LUA config + joystick support (SDL2 api makes some surprises) + new initialization checks + some GUI / console fixes, restyles.
TeslaRus is offline   Reply With Quote
Old 09-09-13, 06:12   #302
Ado Croft
Historian
 
Join Date: Apr 2013
Posts: 265
Default

Great job, of course!
Tested, everything works great except of textures. There are some troubles with texture atlas.


Last edited by Ado Croft; 09-09-13 at 06:13.
Ado Croft is offline   Reply With Quote
Old 09-09-13, 06:42   #303
Lwmte
Explorer
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 951
Default

Oh no, it's not related to texture atlas, it is related to depth of z-buffer. Most likely, you don't have z_depth parameter in your config.cfg, or it is set to 32. You must set it either to 16 or 24, i. e. render section of config.cfg must look like this:

Code:
render =
{
    mipmap_mode = 3;
    mipmaps = 3;
    lod_bias = 0;
    anisotropy = 8;
    antialias = 1;
    antialias_samples = 8;
    z_depth = 24;
    texture_border = 8;
}
Note that now you can natively use antialiasing, without forcing it through drivers!
Also, "bpp" parameter in screen config section is obsolete, so you can safely remove it.

However, by default z_depth must be set to 16, not 32 (in Render_InitGlobals function), so maybe current build contains no such fix, it must be in the next binary update. Source code already fixes that.

Last edited by Lwmte; 09-09-13 at 06:46.
Lwmte is offline   Reply With Quote
Old 09-09-13, 08:08   #304
TeslaRus
Student
 
TeslaRus's Avatar
 
Join Date: Jan 2013
Posts: 195
Default code fixes

Quote:
However, by default z_depth must be set to 16, not 32 (in Render_InitGlobals function), so maybe current build contains no such fix, it must be in the next binary update. Source code already fixes that.
This bug was in script.cpp module in parse render function:
Code:
//WAS:
if(sc->bpp != 16 || sc->bpp != 24 || sc->bpp != 32)
{
    sc->bpp = 32;
}
//THIS TIME:
if(sc->bpp != 16 || sc->bpp != 24 || sc->bpp != 32)
{
    sc->bpp = 16;
}
This time code in SF are fixed =)
BUT! must be (heh... this dummy logick error from my side):
Code:
if(sc->bpp != 16 && sc->bpp != 24 && sc->bpp != 32)
{
    sc->bpp = 16;
}

Last edited by TeslaRus; 09-09-13 at 08:10. Reason: add info
TeslaRus is offline   Reply With Quote
Old 09-09-13, 09:16   #305
Lwmte
Explorer
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 951
Default

bpp setting has no effect on z depth anyway, since now it's in "render" settings section, not in "screen" section. I believe that we can safely remove all this code.

I've merged this fix with latest SF revision.
Lwmte is offline   Reply With Quote
Old 10-09-13, 13:40   #306
Ado Croft
Historian
 
Join Date: Apr 2013
Posts: 265
Default

I have discovered something which is connected with a texture bug. When I deleted a command called "antialias_samples = 8" from the config file then it will work with a correct texture set or simply change the value from 8 to 4

Last edited by Ado Croft; 10-09-13 at 13:45.
Ado Croft is offline   Reply With Quote
Old 22-09-13, 14:21   #307
Cochrane
Gold Contributor
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,093
Default

So, I've not been active for a while now, and that was mostly because all that merging was getting too annoying. But now that things seem to have settled a bit, I think I'll give it another try.

My branch of the new code can be found at: https://sourceforge.net/u/zcochrane/.../default/tree/

This time, I'll do the bare minimum to get it working on Mac OS X, meaning I'll keep using SDL. The more my code differs from the one in the main repository, the more work for everyone. I'll also try to explain my changes better and in much more detail, so you all can decide more easily whether you want to integrate them or want me to change something.

As of right now, the changes are:

New folder mac/
Contains all files that are only relevant for Mac OS X. Includes:
- OpenTomb-Info.plist - required information file for Mac OS X.
- OpenTomb.xcodeproj (a folder) - contains the Xcode settings for the project.
- SDL2.framework (another folder) - The Mac version of SDL2.
- main.c: A simple function that calls SDL_main(), because apparently that doesn't get called automatically instead of main (at least in the Mac version of the framework).

Code changes
bullet/LinearMath/btVector3.cpp: include <string.h> because memset requires it. Add a static_cast for every -1 that gets stored in an unsigned char because Clang is more strict about this than GCC. This doesn't change how it actually works, it just makes it more explicit. It will not change how the Windows version works.

bullet/BulletSoftBody/btSoftBodyHelpers.cpp: Added a bunch of casts again because Clang is more strict. This doesn't change how it actually works, it just makes it more explicit. It will not change how the Windows version works.

ftgl/FTVectoriser.cpp: Changed the typedef for GLUTesselatorFunction for Mac OS X, because it was wrong. That change will have no effect on the Windows version.

controls.cpp: Added a "return 0;" at the end because Clang thinks that the function may end without a return. If you look closely, you'll see that Clang's error message is wrong: There is no path on which the function does not end in a return. Sadly, Clang doesn't do enough analysis to know that here. These changes have no effect on the Windows version.

gui.cpp: In Gui_DrawCrosshair(), added more casts and made all the constants explicit floats. Again, Clang is more strict about the casts it will do automatically, so one has to be more explicit. As usual, this will not change the Windows version.

bordered_texture_atlas.cpp and bordered_texture_atlas.h: Changed the outPage parameter to be a uint32_t pointer instead of size_t, because the one thing that is passed there is always a uint32_t, and on 64-bit systems uint32_t and size_t are not the same thing. This will have no effect on 32-bit systems.

Other changes
.hgignore - Set up so that it ignores the user-specific data in the Xcode project file (e.g. window sizes), and other Mac-specific data (kept in .DS_Store), because this isn't relevant for anyone else.


All this has not yet been tested (I didn't make a config file yet), so there is no binary right now. I'll talk more about what I want to do with the config file later; but my main criterion is that will remain 100% compatible with the Windows version this time.
__________________
GŁter auf die Bahn!

Last edited by Cochrane; 22-09-13 at 19:19.
Cochrane is offline   Reply With Quote
Old 23-09-13, 07:07   #308
Lwmte
Explorer
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 951
Default

Hi!

Good to see you back. I wasn't active for past two weeks too, cause I had some troubles at work, but everything should be sorted out soon. Last thing I tried to do is to adapt parser (resource.cpp) to read animcommands, but I'm still learning how it allocates memory to divide animcommands block for each animation independently. Haven't heard anything from TeslaRus for a while - I think everyone's busy since education has begun!

By the way, if you have a gamepad with force feedback that is supported on Mac, I'll be glad if you will test it. I had some troubles with it working on DirectInput gamepads, it's interesting how it works on your side (currently, you should get a test rumble at start-up, plus when Lara hits a wall in a jump).
Lwmte is offline   Reply With Quote
Old 23-09-13, 16:17   #309
Cochrane
Gold Contributor
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,093
Default

Quote:
Originally Posted by Lwmte View Post
Good to see you back. I wasn't active for past two weeks too, cause I had some troubles at work, but everything should be sorted out soon. Last thing I tried to do is to adapt parser (resource.cpp) to read animcommands, but I'm still learning how it allocates memory to divide animcommands block for each animation independently. Haven't heard anything from TeslaRus for a while - I think everyone's busy since education has begun!
Good luck! (And by the way, if you discover how some tricky code works, don't hesitate to leave comments there so the next one reading it will know it, too. This project doesn't have the easiest code to understand right now.)

Quote:
Originally Posted by Lwmte View Post
By the way, if you have a gamepad with force feedback that is supported on Mac, I'll be glad if you will test it. I had some troubles with it working on DirectInput gamepads, it's interesting how it works on your side (currently, you should get a test rumble at start-up, plus when Lara hits a wall in a jump).
To be honest, I'm not sure whether there are any force feedback compatible gamepads for Macs. Apple added Force Feedback support to Mac OS X about thirteen years ago, for a small number of hand-picked joysticks, and I think it's stayed that way ever since.
__________________
GŁter auf die Bahn!
Cochrane is offline   Reply With Quote
Old 13-10-13, 09:15   #310
Lwmte
Explorer
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 951
Default

Hi! Sorry for the delay, I want to say that new OpenTomb update is available as source code. Currently TeslaRus have little time to work on it, but hopefully it won't last forever!

This last update contains basic support for wade (shallow water). I haven't tried it myself yet (moving to other place now, currently have no internet connection there, but it should be resolved soon).

Last edited by Lwmte; 13-10-13 at 09:17.
Lwmte is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 19:23.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.