Fix TCC
This commit is contained in:
parent
09031d209d
commit
5522f03daf
6 changed files with 57 additions and 29 deletions
58
TODO.txt
58
TODO.txt
|
@ -2,21 +2,12 @@ fuck issue trackers :D
|
|||
|
||||
=========== GENERAL ==============
|
||||
|
||||
- LCR_SETTING_TEXTURE_SUBSAMPLE = 0 should turn off texturing completely
|
||||
- frontends:
|
||||
- auto test frontend, with no I/O, that will just internally run a series of
|
||||
inputs and check if the output is as expected
|
||||
- X11
|
||||
- ncurses? yes or no?
|
||||
- try Pokitto
|
||||
- Nibble, should hopefully be powerful enough.
|
||||
- ESPboy?
|
||||
- linux framebuffer?
|
||||
- make some kinda repo for world record runs? how will they submit it?
|
||||
- final tests:
|
||||
- run the test frontend through all the shit (valgrind, different compilers
|
||||
etc.) KINDA DID
|
||||
- check every single setting individually DID 1x
|
||||
- very long replay DID 1x
|
||||
- absence of music file
|
||||
- absence of music file DID
|
||||
- different resolutions KINDA DID 1x
|
||||
- different settings (332, POTATO, ...)
|
||||
- crazy shit with physics KINDA DID
|
||||
|
@ -39,6 +30,9 @@ fuck issue trackers :D
|
|||
|
||||
=========== BUGS =================
|
||||
|
||||
- camera bugs in TCC build, also the auto test fails on checking rendered
|
||||
pixels -- this may be TCC not supporting C99 fully? but dig up what's going
|
||||
on
|
||||
- camera follow speed depends on FPS, it's slower with low FPS, but this is no
|
||||
big deal, it's only noticable with extremely high/low FPS -- fix or not?
|
||||
- replay loading BUG! somehow map2 replay was saves with hash 05ef0ab1 instead
|
||||
|
@ -48,16 +42,22 @@ fuck issue trackers :D
|
|||
|
||||
- mods:
|
||||
- bouncy car body with inertia, not affecting physics ofc, just eye candy
|
||||
- TAS mod? ideas:
|
||||
- step by single frames, the mod will literally keep all inputs in RAM, will
|
||||
be able to rewind back (quickly replay the inputs)
|
||||
- advanced replay analyzer, showing e.g.: distance travelled, speed over time,
|
||||
crashes, input stats (number of presses, quickest tap, ...)
|
||||
- TAS mod(s)? ideas:
|
||||
- Just make it so that restarting takes player only N physics ticks back
|
||||
(N can be a setting). Then the player can just drive and attempt sections
|
||||
one by one, possibly in slow motion (using the existing setting).
|
||||
Implement by literally storing exact inputs in RAM, then upon restart
|
||||
quickly replaying everything up to current frame minus N.
|
||||
- kinda bruteforce solver?
|
||||
- export maps as 3D models in OBJ format (just print to console?)
|
||||
- mod allowing to view two replays at once (one normal replay, one ghost),
|
||||
would be cool for run comparison
|
||||
- mod allowing to view two replays at once (one normal replay, one ghost?),
|
||||
would be cool for run comparisons
|
||||
- some extra graphic consoomer goodies? like:
|
||||
- leave light trail behind the car (particles?)
|
||||
- postproc effects? render to a buffer in renderer, then draw it again
|
||||
- something like a motion blur by kinda "frameless" rendering?
|
||||
- analog controller support, would just tap arrows in frequency according to
|
||||
analog the analog value; create a new frontend function to implement,
|
||||
something like LCR_getAnalogInput(type) or smt
|
||||
|
@ -68,14 +68,34 @@ fuck issue trackers :D
|
|||
them swing, maybe even add delay to inputs
|
||||
- weather mods? like lightning (invert colors quickly), rain, snow, sand, ...
|
||||
- "AI" driver?
|
||||
- could work like this:
|
||||
- make a function that estimated "how well we are doing", i.e. how close
|
||||
we are to finishing, taking into account number of taken CPs, distance
|
||||
to closest CP, current speed etc.
|
||||
- approx algorithm: maintain N "currently best drivers", in each iteration
|
||||
let each of them drive N times randomly, i.e. we get N * N new drivers,
|
||||
then pick N best of them (by the function) and repeat; if not making
|
||||
any progress for some time we can recursively get back or something
|
||||
- 2D renderer? like isometric or top-down or something, could enable the game
|
||||
literally on very weak devices? top down might be nice, the car could be
|
||||
drawn out of circles, getting bigger closer to camera, camera could rotate
|
||||
along with car etc.
|
||||
- kinda fancy OpenGL renderer?
|
||||
- literal network multiplayer? could even be easy bcz no collisions
|
||||
- map restarts should be synchronized to make the players start
|
||||
simultaneously, this can be done by having a global shared timer ticking and
|
||||
releasing all cars waiting for start every 3 seconds let's say
|
||||
- "user friendly" map editor?
|
||||
- procedural map generator?
|
||||
- frontends:
|
||||
- auto test frontend, with no I/O, that will just internally run a series of
|
||||
inputs and check if the output is as expected
|
||||
- X11
|
||||
- ncurses? yes or no?
|
||||
- try Pokitto
|
||||
- Nibble, should hopefully be powerful enough.
|
||||
- ESPboy?
|
||||
- linux framebuffer?
|
||||
|
||||
=========== HANDLED ==============
|
||||
|
||||
|
@ -84,6 +104,10 @@ fuck issue trackers :D
|
|||
settings on PC and see if the maps load or what. IT'S BCS BUILDING THE MAP
|
||||
TEMPORARILY REQUIRES MORE BLOCKS
|
||||
- maybe address the jerky rotations? or not?
|
||||
- make some kinda repo for world record runs? how will they submit it?
|
||||
- LCR_SETTING_TEXTURE_SUBSAMPLE = 0 should turn off texturing completely
|
||||
NO, 0 is normal texturing, 1 skips one pixel etc., very high value will
|
||||
actually turn it off
|
||||
- stop playing engine sound when replay finishes
|
||||
- add (digital) controller support to SDL and CSFML? NOT NOW, doesn't wanna
|
||||
detect it or something (or either PC)
|
||||
|
|
|
@ -115,7 +115,7 @@ int main(int argc, char *argv[])
|
|||
musicFile = fopen("assets/music","rb");
|
||||
|
||||
if (!musicFile)
|
||||
fputs("could not open music file",stderr);
|
||||
fputs("could not open music file\n",stderr);
|
||||
|
||||
puts("initializing game");
|
||||
LCR_gameInit(argc,(const char **) argv);
|
||||
|
|
|
@ -176,7 +176,7 @@ int main(int argc, char *argv[])
|
|||
musicFile = fopen("assets/music","rb");
|
||||
|
||||
if (!musicFile)
|
||||
fputs("could not open music file",stderr);
|
||||
fputs("could not open music file\n",stderr);
|
||||
#endif
|
||||
|
||||
puts("initializing game");
|
||||
|
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
|||
#endif
|
||||
|
||||
if (SDL_OpenAudio(&audioSpec,NULL) < 0)
|
||||
fputs("could not initialize audio",stderr);
|
||||
fputs("could not initialize audio\n",stderr);
|
||||
|
||||
SDL_PauseAudio(0);
|
||||
|
||||
|
@ -215,7 +215,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (!window)
|
||||
{
|
||||
fputs("ERROR: couldn't create window",stderr);
|
||||
fputs("ERROR: couldn't create window\n",stderr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (!renderer)
|
||||
{
|
||||
fputs("ERROR: couldn't create renderer",stderr);
|
||||
fputs("ERROR: couldn't create renderer\n",stderr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (!texture)
|
||||
{
|
||||
fputs("ERROR: couldn't create texture",stderr);
|
||||
fputs("ERROR: couldn't create texture\n",stderr);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
2
game.h
2
game.h
|
@ -922,7 +922,7 @@ int LCR_gameLoadReplay(unsigned int replayIndex)
|
|||
LCR_LOG2("map name hash matches");
|
||||
|
||||
if (LCR_gameLoadMap(mapIndex) && mapHash == LCR_currentMap.hash)
|
||||
return LCR_replayValidate() ? mapIndex : -3;
|
||||
return LCR_replayValidate() ? (int) mapIndex : -3;
|
||||
else
|
||||
{
|
||||
LCR_LOG2("bad map");
|
||||
|
|
6
make.sh
6
make.sh
|
@ -10,6 +10,7 @@ clear
|
|||
echo "making Licar"
|
||||
|
||||
OPTIM="-O3"
|
||||
|
||||
C_FLAGS="-std=c99 -Wall -Wextra -pedantic $OPTIM -Wno-unused-parameter -Wno-missing-field-initializers -o licar"
|
||||
COMPILER="g++"
|
||||
PLATFORM="sdl"
|
||||
|
@ -22,8 +23,7 @@ if [ $# -gt 0 ]; then
|
|||
|
||||
if [ $COMPILER = "tcc" ]; then # you'll probably want to modify this
|
||||
C_FLAGS="${C_FLAGS} -L/usr/lib/x86_64-linux-gnu/pulseaudio/
|
||||
-I/home/tastyfish/git/tcc/tcc-0.9.27/include
|
||||
-I/usr/lib/gcc/x86_64-linux-gnu/8/include/"
|
||||
-I/usr/lib/x86_64-linux-gnu/tcc/include -DSDL_DISABLE_IMMINTRIN_H"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -67,4 +67,4 @@ fi
|
|||
echo ${COMMAND}
|
||||
eval ${COMMAND}
|
||||
|
||||
echo "done"
|
||||
return $?
|
||||
|
|
8
racing.h
8
racing.h
|
@ -984,10 +984,16 @@ void _LCR_racingUpdateCarPosRot(void)
|
|||
{
|
||||
TPE_Vec3 tmpVec = LCR_racing.carPositions[0];
|
||||
|
||||
TPE_Unit tccFix = tmpVec.x; /* Fix for TCC: for whatever reason the following
|
||||
line nukes the x coord in tmpVec under TCC, so
|
||||
here we back it up and then restore it. */
|
||||
|
||||
LCR_racing.carPositions[0] = _LCR_TPE_vec3DividePlain(
|
||||
TPE_vec3TimesPlain(_LCR_racingGetWheelCenterPoint(),LCR_GAME_UNIT),
|
||||
LCR_PHYSICS_UNIT);
|
||||
|
||||
tmpVec.x = tccFix;
|
||||
|
||||
LCR_racing.carPositions[0] = // smooth the position
|
||||
TPE_vec3KeepWithinBox(LCR_racing.carPositions[1],LCR_racing.carPositions[0],
|
||||
TPE_vec3(
|
||||
|
@ -1136,12 +1142,10 @@ void LCR_racingGetCarTransform(LCR_GameUnit position[3],
|
|||
LCR_racing.carRotations[1].y,interpolationParam);
|
||||
rotation[2] = _LCR_racingInterpolateRot(LCR_racing.carRotations[0].z,
|
||||
LCR_racing.carRotations[1].z,interpolationParam);
|
||||
|
||||
#else
|
||||
position[0] = LCR_racing.carPositions[0].x;
|
||||
position[1] = LCR_racing.carPositions[0].y;
|
||||
position[2] = LCR_racing.carPositions[0].z;
|
||||
|
||||
rotation[0] = LCR_racing.carRotations[0].x;
|
||||
rotation[1] = LCR_racing.carRotations[0].y;
|
||||
rotation[2] = LCR_racing.carRotations[0].z;
|
||||
|
|
Loading…
Reference in a new issue