Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chopper #15

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
05e69c8
load chopper gfx
tehKaiN Jul 5, 2018
a992dfe
Basic chopper steering
tehKaiN Jul 5, 2018
52ae39a
Alphabetic order on map select
tehKaiN Jul 9, 2018
7304610
Fixed console text handling according to new ACE fns
tehKaiN Jul 10, 2018
337120d
jsonCreate() uses fileGetSize() now
tehKaiN Jul 18, 2018
bce09b5
config.h isn't needed anymore
tehKaiN Jul 23, 2018
2aa0671
same arg name in header as in .c file
tehKaiN Jul 23, 2018
d688d89
added printing code size
tehKaiN Jul 23, 2018
34252fe
Removed camera stutter
tehKaiN Aug 12, 2018
79d0f0a
removed config.h dependency
tehKaiN Aug 12, 2018
6db7ad0
fixes to vehicle gfx
tehKaiN Aug 12, 2018
32c44cd
better chopper steering
tehKaiN Aug 12, 2018
1dd5ce3
Initial frame skipping and fps display
tehKaiN Jul 23, 2018
6519299
refactor, capped FPS display at 99
tehKaiN Aug 12, 2018
09fd0c7
further refactor, steer request read count is no longer volatile
tehKaiN Aug 12, 2018
723b310
prevent memory trashing at 0fps
tehKaiN Aug 12, 2018
3cef281
Moved FPS display to bottom left of HUD, triggered by F1
tehKaiN Aug 12, 2018
5ece588
Added FPS keystroke to readme, fixed linter warnings
tehKaiN Aug 12, 2018
a40fb71
Reformatted score table a bit
tehKaiN Aug 12, 2018
bff2f9d
Merge pull request #12 from tehKaiN/frame-skip
tehKaiN Aug 12, 2018
2ff81e8
fixed warning
tehKaiN Aug 12, 2018
23a022e
Fixed team scores not appearing after toggling FPS
tehKaiN Aug 12, 2018
ab8feae
minor cleanup
tehKaiN Aug 27, 2018
8103f9b
removed executable
tehKaiN Sep 3, 2018
2978f1c
works with latest ace and cmake
tehKaiN Nov 26, 2022
a75e464
re-enabled bot
tehKaiN Dec 3, 2022
7e974f9
get rid of division by rounding control point life to power of two
tehKaiN Dec 3, 2022
d45dfca
don't busy wait for specific vpos, check if crossed instead
tehKaiN Dec 3, 2022
fcad685
disable X scroll on HUD vport
tehKaiN Dec 3, 2022
6be96de
speedup turret processing
tehKaiN Dec 3, 2022
8598146
use fast magnitude calculation for distance check
tehKaiN Dec 3, 2022
1ef50f2
optimized getAngleBetweenPoints() by precalcing atan2
tehKaiN Dec 3, 2022
9887aa0
defer collision box calculation until there's at least one other vehi…
tehKaiN Dec 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ debug/*
.vscode/*
precalc/*
*.code-workspace

of
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "deps/ace"]
path = deps/ace
url = https://github.com/AmigaPorts/ACE
82 changes: 82 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
cmake_minimum_required(VERSION 3.14.0)
project(openFire LANGUAGES C)

if(NOT AMIGA)
message(SEND_ERROR "This project only compiles for Amiga")
endif()

# ACE
add_subdirectory(deps/ace ace)

set(CMAKE_C_STANDARD 11)
file(GLOB_RECURSE SOURCES src/*.c src/*.h)

if(ELF2HUNK)
set(GAME_EXECUTABLE openFire.elf)
set(GAME_OUTPUT_EXECUTABLE openFire.exe)
add_executable(${GAME_EXECUTABLE} ${SOURCES})
target_link_libraries(${GAME_EXECUTABLE} -Wl,-Map=openFire.map)

if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug") AND NOT (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
set(ELF2HUNK_ARGS ${ELF2HUNK_ARGS} -s)
endif()

add_custom_command(
TARGET ${GAME_EXECUTABLE} POST_BUILD
COMMAND ${ELF2HUNK} ${GAME_EXECUTABLE} ${GAME_OUTPUT_EXECUTABLE} ${ELF2HUNK_ARGS}
)
add_custom_command(
TARGET ${GAME_EXECUTABLE} POST_BUILD
COMMAND ${OBJDUMP} --disassemble -S ${GAME_EXECUTABLE} > openFire.s
)
else()
SET(GAME_EXECUTABLE openFire)
SET(GAME_OUTPUT_EXECUTABLE openFire)
add_executable(${GAME_EXECUTABLE} ${SOURCES})
endif()

# Version stuff
string(TIMESTAMP YEAR "%y")
string(TIMESTAMP DAY "%d")
string(TIMESTAMP MONTH "%m")
MATH(EXPR VER_MAJOR "0 + ${YEAR}")
MATH(EXPR VER_MINOR "0 + ${MONTH}")
MATH(EXPR VER_FIX "0 + ${DAY}")
set(VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_FIX}")
target_compile_definitions(${GAME_EXECUTABLE} PRIVATE GAME_VERSION="${VERSION}")

target_include_directories(${GAME_EXECUTABLE} PRIVATE ${PROJECT_SOURCE_DIR}/src)
target_compile_options(${GAME_EXECUTABLE} PUBLIC -Wall)
target_link_libraries(${GAME_EXECUTABLE} ace)
if(GAME_DEBUG)
target_compile_definitions(${GAME_EXECUTABLE} PRIVATE GAME_DEBUG)
target_compile_definitions(ace PUBLIC ACE_DEBUG_UAE)
endif()

set(RES_DIR ${CMAKE_CURRENT_LIST_DIR}/res)
set(DATA_DIR ${CMAKE_CURRENT_BINARY_DIR}/data)
set(GEN_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated)
file(MAKE_DIRECTORY ${DATA_DIR} ${GEN_DIR})

file(COPY "data" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

# Generating ZIP
set(GAME_PACKAGE_NAME "${CMAKE_PROJECT_NAME} ${VER_MAJOR}_${VER_MINOR}_${VER_FIX}")
add_custom_target(generateZip COMMAND
${CMAKE_COMMAND} -E tar "cf" "${GAME_PACKAGE_NAME}.zip" --format=zip
"${CMAKE_CURRENT_BINARY_DIR}/${GAME_OUTPUT_EXECUTABLE}" "${DATA_DIR}"
COMMENT "Generating ZIP file ${GAME_PACKAGE_NAME}.zip"
)

# Generating ADF
set(ADF_DIR "${CMAKE_CURRENT_BINARY_DIR}/adf")
add_custom_target(generateAdf
COMMAND ${CMAKE_COMMAND} -E make_directory "${ADF_DIR}/s"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/${GAME_OUTPUT_EXECUTABLE}" "${ADF_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${DATA_DIR}" "${ADF_DIR}/data"
# COMMAND ${CMAKE_COMMAND} -E echo "c:add21k" > "${ADF_DIR}/s/startup-sequence"
COMMAND ${CMAKE_COMMAND} -E echo "${GAME_OUTPUT_EXECUTABLE}" > "${ADF_DIR}/s/startup-sequence"
COMMAND exe2adf -l ${CMAKE_PROJECT_NAME} -a "${GAME_PACKAGE_NAME}.adf" -d ${ADF_DIR}
COMMAND ${CMAKE_COMMAND} -E rm -rf "${ADF_DIR}"
COMMENT "Generating ADF file ${GAME_PACKAGE_NAME}.adf"
)
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ As the game is still under development, game performance will vary.
* Mouse and keyboard

## How to play

After starting game, you may choose your team and vehicle. The goal of the game is to conquer more bases than enemy team and maintain this state until enemy team runs out of respawn points.

## Controls

* Movement: <kbd>W</kbd>, <kbd>S</kbd>, <kbd>A</kbd>, <kbd>D</kbd>
* Fire, hiding in bunker: <kbd>LMB</kbd>
* Show FPS: <kbd>F1</kbd>
* Exit: <kbd>ESC</kbd>

## Authors

This game has been made as entry for [RetroKomp](http://retrokomp.org) Gamedev Compo 2017. Original authors are:
This game has been made as entry for
[RetroKomp](http://retrokomp.org) Gamedev Compo 2017. Original authors are:

* KaiN - code
* Selur - gfx
Expand Down
Binary file modified data/hud/selecting.bm
Binary file not shown.
Binary file added data/vehicles/chopper/aux_blue.bm
Binary file not shown.
Binary file added data/vehicles/chopper/aux_mask.bm
Binary file not shown.
Binary file added data/vehicles/chopper/aux_red.bm
Binary file not shown.
Binary file added data/vehicles/chopper/main_blue.bm
Binary file not shown.
Binary file added data/vehicles/chopper/main_mask.bm
Binary file not shown.
Binary file added data/vehicles/chopper/main_red.bm
Binary file not shown.
1 change: 1 addition & 0 deletions deps/ace
Submodule ace added at 04f4e7
3 changes: 2 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ifeq ($(OF_CC), vc)
AS_FLAGS = +kick13 -c
OBJDUMP =
else ifeq ($(OF_CC), m68k-amigaos-gcc)
CC_FLAGS = -std=gnu11 $(INCLUDES) -DAMIGA -noixemul -Wall -Wextra -fomit-frame-pointer -O3 -fbbb=abcfilmprsz
CC_FLAGS = -std=gnu11 $(INCLUDES) -DAMIGA -noixemul -Wall -Wextra -fomit-frame-pointer -O3
AS_FLAGS = -quiet -x -m68010 -Faout
OBJDUMP = m68k-amigaos-objdump -S -d $@ > [email protected]
endif
Expand Down Expand Up @@ -80,6 +80,7 @@ of: $(OF_OBJS) $(ACE_OBJS_CP)
$(NEWLINE)
@echo Linking...
@$(OF_CC) $(CC_FLAGS) -lamiga -o $@ $^
@m68k-amigaos-size $@

ace: $(ACE_OBJS)
$(MAKE) -C $(ACE_DIR) all ACE_CC=$(OF_CC) TARGET=$(TARGET)
Expand Down
Binary file removed of
Binary file not shown.
3 changes: 1 addition & 2 deletions src/adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ ULONG adler32file(const char *szPath) {
goto fail;
}
UBYTE ubBfr;
while(!fileIsEof(pFile)) {
fileRead(pFile, &ubBfr, 1);
while(fileRead(pFile, &ubBfr, 1)) {
a += ubBfr;
if(a >= ADLER32_MODULO) {
a -= ADLER32_MODULO;
Expand Down
5 changes: 0 additions & 5 deletions src/config.c

This file was deleted.

10 changes: 0 additions & 10 deletions src/config.h

This file was deleted.

10 changes: 4 additions & 6 deletions src/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,17 @@ void cursorUpdate(void) {

void cursorCreate(tView *pView, FUBYTE fubSpriteIdx, char *szPath, UWORD uwRawCopPos) {
mouseSetBounds(MOUSE_PORT_1, 0, 0, 320, 255);
s_pCrosshair = bitmapCreateFromFile(szPath);
s_pCrosshair = bitmapCreateFromFile(szPath, 0);
UWORD *pSpriteBfr = (UWORD*)((void*)s_pCrosshair->Planes[0]);
cursorUpdate();
ULONG ulSprAddr = (ULONG)((UBYTE*)pSpriteBfr);
if(pView->pCopList->ubMode == COPPER_MODE_RAW) {
tCopCmd *pCrossList = &pView->pCopList->pBackBfr->pList[uwRawCopPos];
copSetMove(&pCrossList[0].sMove, &g_pSprFetch[fubSpriteIdx].uwHi, ulSprAddr >> 16);
copSetMove(&pCrossList[1].sMove, &g_pSprFetch[fubSpriteIdx].uwLo, ulSprAddr & 0xFFFF);
CopyMemQuick(
&pView->pCopList->pBackBfr->pList[uwRawCopPos],
&pView->pCopList->pFrontBfr->pList[uwRawCopPos],
2*sizeof(tCopCmd)
);
for(UBYTE i = 0; i < 2; ++i) {
pView->pCopList->pFrontBfr->pList[uwRawCopPos + i].ulCode = pView->pCopList->pBackBfr->pList[uwRawCopPos + i].ulCode;
}
}
else {
tCopBlock *pBlock = copBlockCreate(pView->pCopList, 2, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/gamestates/game/ai/bot.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static tAiNode *botFindNewTarget(tBot *pBot, tAiNode *pDestToEvade) {
static tTurret *botTargetNearbyTurret(tBot *pBot, UBYTE ubEnemyTeam) {
UWORD uwBotTileX = pBot->pPlayer->sVehicle.uwX >> MAP_TILE_SIZE;
UWORD uwBotTileY = pBot->pPlayer->sVehicle.uwY >> MAP_TILE_SIZE;
UBYTE ubOctant = ((pBot->pPlayer->sVehicle.ubTurretAngle+8) & ANGLE_LAST) >> 4;
UBYTE ubOctant = ((pBot->pPlayer->sVehicle.ubAuxAngle + 8) & ANGLE_LAST) / 16;

tBCoordYX *pTargetingOrder = s_pTargetingOrders[ubOctant];
for(UBYTE i = 0; i != BOT_TARGETING_FLAT_SIZE; ++i) {
Expand Down
42 changes: 25 additions & 17 deletions src/gamestates/game/bob_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <ace/managers/memory.h>
#include <ace/managers/system.h>
#include <ace/utils/custom.h>
#include <gamestates/game/game.h>

// Undraw stack must be accessible during adding new bobs, so the most safe
// approach is to have two lists - undraw list gets populated after draw
Expand Down Expand Up @@ -67,9 +68,11 @@ void bobNewManagerDestroy(void) {
}

void bobNewPush(tBobNew *pBob) {
tBobQueue *pQueue = &s_pQueues[s_ubBufferCurr];
pQueue->pBobs[s_ubBobsPushed] = pBob;
++s_ubBobsPushed;
if(steerRequestIsLast()) {
tBobQueue *pQueue = &s_pQueues[s_ubBufferCurr];
pQueue->pBobs[s_ubBobsPushed] = pBob;
++s_ubBobsPushed;
}
if(blitIsIdle()) {
bobNewProcessNext();
}
Expand All @@ -89,12 +92,12 @@ void bobNewInit(
pBob->_wModuloUndrawSave = bitmapGetByteWidth(s_pQueues[0].pDst) - uwBlitWords*2;
pBob->uwOffsetY = 0;

pBob->sPos.sUwCoord.uwX = uwX;
pBob->sPos.sUwCoord.uwY = uwY;
pBob->pOldPositions[0].sUwCoord.uwX = uwX;
pBob->pOldPositions[0].sUwCoord.uwY = uwY;
pBob->pOldPositions[1].sUwCoord.uwX = uwX;
pBob->pOldPositions[1].sUwCoord.uwY = uwY;
pBob->sPos.uwX = uwX;
pBob->sPos.uwY = uwY;
pBob->pOldPositions[0].uwX = uwX;
pBob->pOldPositions[0].uwY = uwY;
pBob->pOldPositions[1].uwX = uwX;
pBob->pOldPositions[1].uwY = uwY;
}

void bobNewSetBitMapOffset(tBobNew *pBob, UWORD uwOffsetY) {
Expand All @@ -121,8 +124,8 @@ UBYTE bobNewProcessNext(void) {
++s_ubBobsSaved;
if(pBob->isUndrawRequired) {
ULONG ulSrcOffs = (
pQueue->pDst->BytesPerRow * pBob->sPos.sUwCoord.uwY +
pBob->sPos.sUwCoord.uwX/8
pQueue->pDst->BytesPerRow * pBob->sPos.uwY +
pBob->sPos.uwX/8
);
ULONG ulA = (ULONG)(pQueue->pDst->Planes[0]) + ulSrcOffs;
g_pCustom->bltamod = pBob->_wModuloUndrawSave;
Expand All @@ -145,13 +148,13 @@ UBYTE bobNewProcessNext(void) {

if(!blitCheck(
pBob->pBitmap, 0, pBob->uwOffsetY / pBob->pBitmap->BytesPerRow,
pQueue->pDst, pPos->sUwCoord.uwX, pPos->sUwCoord.uwY,
pQueue->pDst, pPos->uwX, pPos->uwY,
pBob->uwWidth, pBob->uwHeight, __LINE__, __FILE__
)) {
return 1;
}

UBYTE ubDstOffs = pPos->sUwCoord.uwX & 0xF;
UBYTE ubDstOffs = pPos->uwX & 0xF;
UWORD uwBlitWidth = (pBob->uwWidth +ubDstOffs+15) & 0xFFF0;
UWORD uwBlitWords = uwBlitWidth >> 4;
UWORD uwBlitSize = ((pBob->uwHeight * s_ubBpp) << 6) | uwBlitWords;
Expand All @@ -169,7 +172,7 @@ UBYTE bobNewProcessNext(void) {
}
ULONG ulSrcOffs = pBob->uwOffsetY;
ULONG ulDstOffs = (
pQueue->pDst->BytesPerRow * pPos->sUwCoord.uwY + (pPos->sUwCoord.uwX>>3)
pQueue->pDst->BytesPerRow * pPos->uwY + (pPos->uwX>>3)
);

WORD wDstModulo = bitmapGetByteWidth(pQueue->pDst) - (uwBlitWords<<1);
Expand Down Expand Up @@ -201,6 +204,9 @@ UBYTE bobNewProcessNext(void) {
}

void bobNewBegin(void) {
if(!steerRequestIsFirst()) {
return;
}
tBobQueue *pQueue = &s_pQueues[s_ubBufferCurr];

// Prepare for undraw
Expand All @@ -222,8 +228,8 @@ void bobNewBegin(void) {
if(pBob->isUndrawRequired) {
// Undraw next
ULONG ulDstOffs = (
pQueue->pDst->BytesPerRow * pBob->pOldPositions[s_ubBufferCurr].sUwCoord.uwY +
pBob->pOldPositions[s_ubBufferCurr].sUwCoord.uwX/8
pQueue->pDst->BytesPerRow * pBob->pOldPositions[s_ubBufferCurr].uwY +
pBob->pOldPositions[s_ubBufferCurr].uwX/8
);
ULONG ulCD = (ULONG)(pQueue->pDst->Planes[0]) + ulDstOffs;
g_pCustom->bltdmod = pBob->_wModuloUndrawSave;
Expand Down Expand Up @@ -253,7 +259,9 @@ void bobNewBegin(void) {
}

void bobNewPushingDone(void) {
s_isPushingDone = 1;
if(steerRequestIsLast()) {
s_isPushingDone = 1;
}
}

void bobNewEnd(void) {
Expand Down
7 changes: 5 additions & 2 deletions src/gamestates/game/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void consoleWrite(const char *szMsg, UBYTE ubColor) {
s_sLog.pLog[s_sLog.uwTailIdx].ubColor = ubColor;
#ifdef GAME_DEBUG
if(strlen(szMsg) > CHAT_MAX) {
logWrite("ERR: Text too long (%d): '%s'\n", strlen(szMsg), szMsg);
logWrite("ERR: Text too long (%ld): '%s'\n", strlen(szMsg), szMsg);
return;
}
#endif
Expand All @@ -63,9 +63,12 @@ void consoleUpdate(void) {
return;
}

if(fontFillTextBitMap(
if(fontTextFitsInTextBitmap(
s_pConsoleFont, s_pChatLineBfr, s_sLog.pLog[s_uwToDraw].szMessage
)) {
fontFillTextBitMap(
s_pConsoleFont, s_pChatLineBfr, s_sLog.pLog[s_uwToDraw].szMessage
);
// Move remaining messages up
blitCopyAligned(
g_pHudBfr->pBack, 112, 9,
Expand Down
10 changes: 5 additions & 5 deletions src/gamestates/game/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "gamestates/game/game.h"
#include "gamestates/game/console.h"

#define CONTROL_POINT_LIFE 250 /* 15s */
#define CONTROL_POINT_LIFE 256 /* 15s */
#define CONTROL_POINT_LIFE_RED 0
#define CONTROL_POINT_LIFE_NEUTRAL (CONTROL_POINT_LIFE)
#define CONTROL_POINT_LIFE_BLUE (CONTROL_POINT_LIFE*2)
Expand Down Expand Up @@ -61,10 +61,10 @@ static UBYTE ** controlPolygonMaskCreate(

*pX1 = 0xFF; *pY1 = 0xFF; *pX2 = 0; *pY2 = 0;
for(FUBYTE i = 1; i < fubPolyPtCnt; ++i) {
FUBYTE x1 = pPolyPts[i-1].sUbCoord.ubX;
FUBYTE y1 = pPolyPts[i-1].sUbCoord.ubY;
FUBYTE x2 = pPolyPts[i].sUbCoord.ubX;
FUBYTE y2 = pPolyPts[i].sUbCoord.ubY;
FUBYTE x1 = pPolyPts[i-1].ubX;
FUBYTE y1 = pPolyPts[i-1].ubY;
FUBYTE x2 = pPolyPts[i].ubX;
FUBYTE y2 = pPolyPts[i].ubY;

FUBYTE fubStartX = MIN(x1, x2);
FUBYTE fubEndX = MAX(x1, x2);
Expand Down
2 changes: 1 addition & 1 deletion src/gamestates/game/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void dataForcePlayerState(tPlayer *pPlayer, tVehicleState *pState) {
pPlayer->sVehicle.uwX = fix16_to_int(pState->fX);
pPlayer->sVehicle.uwY = fix16_to_int(pState->fY);
pPlayer->sVehicle.ubBodyAngle = pState->ubBodyAngle;
pPlayer->sVehicle.ubTurretAngle = pState->ubTurretAngle;
pPlayer->sVehicle.ubAuxAngle = pState->ubAuxAngle;
// TODO: destination angle
// TODO: delta x,y
if(pPlayer->ubCurrentVehicleType != pState->ubVehicleType) {
Expand Down
2 changes: 1 addition & 1 deletion src/gamestates/game/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef struct _tVehicleState {
fix16_t fX; ///< Vehicle X-position relative to center of gfx.
fix16_t fY; ///< Ditto, vehicle Y.
UBYTE ubBodyAngle; ///< Measured clockwise, +90deg is to bottom.
UBYTE ubTurretAngle; ///< NOT relative to body angle, measured as above.
UBYTE ubAuxAngle; ///< NOT relative to body angle, measured as above.
// Aligned with ubDestAngle
UBYTE ubVehicleType; ///< Could be combined with ubVehicleState per nibble
UBYTE ubPlayerState; ///< DEAD, SURFACING, etc.
Expand Down
8 changes: 4 additions & 4 deletions src/gamestates/game/explosions.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ void explosionsAdd(UWORD uwX, UWORD uwY) {
for(UWORD i = EXPLOSIONS_MAX; i--;) {
if(s_pExplosions[i].uwDuration >= EXPLOSION_DURATION) {
// Free slot found - setup explosion
s_pExplosions[i].sBob.sPos.sUwCoord.uwX = uwX - EXPLOSION_SIZE/2;
s_pExplosions[i].sBob.sPos.sUwCoord.uwY = uwY - EXPLOSION_SIZE/2;
s_pExplosions[i].sBob.sPos.uwX = uwX - EXPLOSION_SIZE/2;
s_pExplosions[i].sBob.sPos.uwY = uwY - EXPLOSION_SIZE/2;
s_pExplosions[i].uwDuration = 0;
return;
}
Expand All @@ -30,8 +30,8 @@ void explosionsAdd(UWORD uwX, UWORD uwY) {

void explosionsCreate(void) {
logBlockBegin("explosionsCreate()");
s_pBitmap = bitmapCreateFromFile("data/explosion.bm");
s_pMask = bitmapCreateFromFile("data/explosion_mask.bm");
s_pBitmap = bitmapCreateFromFile("data/explosion.bm", 0);
s_pMask = bitmapCreateFromFile("data/explosion_mask.bm", 0);

for(UBYTE i = EXPLOSIONS_MAX; i--;) {
bobNewInit(&s_pExplosions[i].sBob, 32, 32, 1, s_pBitmap, s_pMask, 0, 0);
Expand Down
Loading