1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 15:38:30 +02:00
Commit Graph

20 Commits

Author SHA1 Message Date
Misa
7689241d3a Add macro removeblock_iter()
When we switch blocks to not use 'active', we'll need this macro to
remove blocks while iterating through the vector, one at a time,
forwards.
2020-04-03 23:28:47 -04:00
Misa
7edbebac92 Move entityclass::setblockcolour() to blockclass::setblockcolour()
This moves the function setblockcolour(), so I can directly call it on a
particular block without having to have it be inside obj.blocks.
2020-04-03 23:28:47 -04:00
Misa
0fb37352ce Make entityclass::updateentities() no longer a bool
It always returns true anyway, so why bother? And it doesn't look like
any code uses its return value, anyway.
2020-04-03 23:28:47 -04:00
Misa
46c17052c6 Remove unused function entityclass::gettype()
Not sure why this function is here. It makes sense if you know that the
game will only do certain moving platform things if you already have a
moving platform in the room, however apparently this function has
absolutely nothing to do with it.
2020-04-03 23:28:47 -04:00
Misa
744c685614 Remove entityclass::cleanup()
This function's sole purpose was to make sure obj.nentity was in sync,
and that obj.nentity-1 pointed to the last 'active' entity in
obj.entities. But now that obj.nentity is removed and we use
obj.entities.size() instead, it is no longer necessary.
2020-04-03 23:28:47 -04:00
Misa
b1b1474b7b Refactor entities and linecrosskludge to not use the 'active' system
This removes the variables obj.nentity and obj.nlinecrosskludge, as well
as removing the 'active' attribute from the entity class object. Now
every entity you access is guaranteed to be real and you don't have to
check the 'active' variable.

The biggest part of this is changing createentity() to modify a
newly-created entity object and push it back instead of already
modifying an indice in obj.entities.

As well, removing an entity now uses the new obj.removeentity() function
and removeentity_iter() macro.
2020-04-03 23:28:47 -04:00
Misa
a67ab8e3a7 Add macro removeentity_iter()
Also when we switch everything to not use 'active', we'll need this
macro to remove entities while iterating forwards through the vector one
at a time.
2020-04-03 23:28:47 -04:00
Misa
1156582ceb Add entityclass::removeentity()
Ok, once we switch everything over to not use the 'active' system, it's
easier to read removeentity(t) than it is to read
entities.erase(entities.begin() + t).
2020-04-03 23:28:47 -04:00
Misa
ae84de2c7e Move entityclass::settreadmillcolour() to entclass::settreadmillcolour()
This moves settreadmillcolour() onto the entity object, so I can invoke
it independent of an indice in obj.entities.
2020-04-03 23:28:47 -04:00
Misa
f5a84d7972 Move entityclass::setenemyroom() to entclass::setenemyroom()
This moves the setenemyroom() function onto the entity object itself, so
I can more easily change all 'entities[k].' to 'entity.' in
entityclass::createentity() later.

Additionally, I've had to move the rn() macro from Entity.h to Ent.h, or
else entclass::setenemyroom() won't know what it is.
2020-04-03 23:28:47 -04:00
Misa
d4cffed176 Move entityclass::setenemy() to entclass::setenemy()
This moves the setenemy() function onto the entity object itself,
instead of having to give the indice of the entity in obj.entities. This
makes the code more object-oriented so later I can simply change all
'entities[k]' to 'entity.' in entityclass::createentity().
2020-04-03 23:28:47 -04:00
Misa
079544c0b1 Fix mixed indentation in Entity.cpp and Entity.h
That guy who indents with 2-wide tabs to match 4-wide spaces strikes
again...
2020-04-03 10:40:50 -04:00
Misa
12d5433efc Remove trailing whitespace from all files
Surprisingly, there's not a lot of it. There is, however, a lot of mixed
indentation in this project.
2020-04-03 10:40:50 -04:00
Misa
4f318e1ee1 Remove unused function entityclass::checkdirectional()
This function is never used anywhere in the game.
2020-04-03 10:40:50 -04:00
Misa
7abf40881a Remove unused argument of entityclass::getcompanion()
The argument provided to entityclass::getcompanion() does absolutely
nothing. Remove it, and update all callers.
2020-04-03 10:40:50 -04:00
Misa
cac1a9e3ab Remove global args from entityclass
This commit removes all global args from functions on the entityclass
object, and updates the callers of those functions in other files
accordingly (most significantly, the game level files Finalclass.cpp,
Labclass.cpp, Otherlevel.cpp, Spacestation2.cpp, WarpClass.cpp, due to
them using createentity()), as well as renaming all instances of 'dwgfx'
in Entity.cpp to 'graphics'.
2020-04-03 10:40:50 -04:00
Info Teddy
867e8ff0fe Make obj accessible from everywhere
Looks like in my original pull request I forgot to do this. Oh well.
2020-01-31 15:53:29 -08:00
Fredrik Ljungdahl
4ea4a1e615 Move skipblocks default setting to obj.init() 2020-01-24 20:28:15 -05:00
Fredrik Ljungdahl
9296547feb Fix tower quicksave bug (only appeared in some builds)
I ran the game through Valgrind to catch various issues.
One thing caught my attention -- map.resumedelay. This is
used by The Tower/etc to add a delay before the game is
resumed (probably for camera controls delaying it) for
spawning the player. This variable was uninitialized. Notably,
if I explicitly set it to 592851 or similar, it reproduces the
bug, even if I cannot reproduce it with my typical compilation
flags. So fixing this by initializing it to 0, alongside some
other Valgrind warnings, should fix the problem entirely.
2020-01-24 20:28:15 -05:00
Ethan Lee
f7c0321b71 Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00