Various graphics fixes.
This commit is contained in:
parent
6d8cb00e3e
commit
934b2a6d67
|
@ -223,6 +223,8 @@ static void draw(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
drawBackground(battle.background);
|
drawBackground(battle.background);
|
||||||
|
|
||||||
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
blitScaled(battle.planetTexture, battle.planet.x, battle.planet.y, battle.planetWidth, battle.planetHeight, 0);
|
blitScaled(battle.planetTexture, battle.planet.x, battle.planet.y, battle.planetWidth, battle.planetHeight, 0);
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,7 @@ extern void awardTrophy(char *id);
|
||||||
extern void initCredits(void);
|
extern void initCredits(void);
|
||||||
extern void showOKCancelDialog(void (*okCallback)(void), void (*cancelCallback)(void), const char *format, ...);
|
extern void showOKCancelDialog(void (*okCallback)(void), void (*cancelCallback)(void), const char *format, ...);
|
||||||
extern char *getTranslatedString(char *string);
|
extern char *getTranslatedString(char *string);
|
||||||
|
extern void setAtlasColor(int r, int g, int b, int a);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
|
|
|
@ -139,8 +139,10 @@ void drawEffects(void)
|
||||||
{
|
{
|
||||||
SDL_SetRenderDrawColor(app.renderer, e->r, e->g, e->b, e->a);
|
SDL_SetRenderDrawColor(app.renderer, e->r, e->g, e->b, e->a);
|
||||||
|
|
||||||
SDL_SetTextureBlendMode(e->texture->texture, SDL_BLENDMODE_ADD);
|
if (e->texture != NULL)
|
||||||
SDL_SetTextureAlphaMod(e->texture->texture, e->a);
|
{
|
||||||
|
SDL_SetTextureBlendMode(e->texture->texture, SDL_BLENDMODE_ADD);
|
||||||
|
}
|
||||||
|
|
||||||
switch (e->type)
|
switch (e->type)
|
||||||
{
|
{
|
||||||
|
@ -153,23 +155,25 @@ void drawEffects(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFFECT_TEXTURE:
|
case EFFECT_TEXTURE:
|
||||||
SDL_SetTextureColorMod(e->texture->texture, e->r, e->g, e->b);
|
setAtlasColor(e->r, e->g, e->b, e->a);
|
||||||
blitScaled(e->texture, e->x - battle.camera.x, e->y - battle.camera.y, e->size, e->size, 0);
|
blitScaled(e->texture, e->x - battle.camera.x, e->y - battle.camera.y, e->size, e->size, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFFECT_HALO:
|
case EFFECT_HALO:
|
||||||
SDL_SetTextureColorMod(e->texture->texture, e->r, e->g, e->b);
|
setAtlasColor(e->r, e->g, e->b, e->a);
|
||||||
blitScaled(e->texture, e->x - battle.camera.x - (e->size / 2), e->y - battle.camera.y - (e->size / 2), e->size, e->size, 0);
|
blitScaled(e->texture, e->x - battle.camera.x - (e->size / 2), e->y - battle.camera.y - (e->size / 2), e->size, e->size, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFFECT_ECM:
|
case EFFECT_ECM:
|
||||||
SDL_SetTextureColorMod(e->texture->texture, e->r, e->g, e->b);
|
setAtlasColor(e->r, e->g, e->b, e->a);
|
||||||
blitScaled(e->texture, SCREEN_WIDTH / 2 - (e->size / 2), SCREEN_HEIGHT / 2 - (e->size / 2), e->size, e->size, 0);
|
blitScaled(e->texture, SCREEN_WIDTH / 2 - (e->size / 2), SCREEN_HEIGHT / 2 - (e->size / 2), e->size, e->size, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_SetTextureAlphaMod(e->texture->texture, 255);
|
if (e->texture != NULL)
|
||||||
SDL_SetTextureBlendMode(e->texture->texture, SDL_BLENDMODE_BLEND);
|
{
|
||||||
|
SDL_SetTextureBlendMode(e->texture->texture, SDL_BLENDMODE_BLEND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_NONE);
|
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_NONE);
|
||||||
|
|
|
@ -27,6 +27,7 @@ extern AtlasImage *getAtlasImage(char *name);
|
||||||
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
|
extern int collision(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2);
|
||||||
extern void *resize(void *array, int oldSize, int newSize);
|
extern void *resize(void *array, int oldSize, int newSize);
|
||||||
extern int isOnBattleScreen(int x, int y, int w, int h);
|
extern int isOnBattleScreen(int x, int y, int w, int h);
|
||||||
|
extern void setAtlasColor(int r, int g, int b, int a);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
|
|
|
@ -420,21 +420,21 @@ void drawEntities(void)
|
||||||
|
|
||||||
static void drawEntity(Entity *e)
|
static void drawEntity(Entity *e)
|
||||||
{
|
{
|
||||||
SDL_SetTextureColorMod(e->texture->texture, 255, 255, 255);
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
if (e->armourHit > 0)
|
if (e->armourHit > 0)
|
||||||
{
|
{
|
||||||
SDL_SetTextureColorMod(e->texture->texture, 255, 255 - e->armourHit, 255 - e->armourHit);
|
setAtlasColor(255, 255 - e->armourHit, 255 - e->armourHit, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e->systemHit > 0)
|
if (e->systemHit > 0)
|
||||||
{
|
{
|
||||||
SDL_SetTextureColorMod(e->texture->texture, 255 - e->systemHit, 255, 255);
|
setAtlasColor(255 - e->systemHit, 255, 255, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e->flags & EF_DISABLED)
|
if (e->flags & EF_DISABLED)
|
||||||
{
|
{
|
||||||
SDL_SetTextureColorMod(e->texture->texture, disabledGlow, disabledGlow, 255);
|
setAtlasColor(disabledGlow, disabledGlow, 255, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
blitRotated(e->texture, e->x - battle.camera.x, e->y - battle.camera.y, e->angle);
|
blitRotated(e->texture, e->x - battle.camera.x, e->y - battle.camera.y, e->angle);
|
||||||
|
@ -443,8 +443,6 @@ static void drawEntity(Entity *e)
|
||||||
{
|
{
|
||||||
drawShieldHitEffect(e);
|
drawShieldHitEffect(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_SetTextureColorMod(e->texture->texture, 255, 255, 255);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void drawHealthBar(Entity *e)
|
static void drawHealthBar(Entity *e)
|
||||||
|
|
|
@ -39,6 +39,7 @@ extern int isOnBattleScreen(int x, int y, int w, int h);
|
||||||
extern long lookup(char *name);
|
extern long lookup(char *name);
|
||||||
extern void awardTrophy(char *id);
|
extern void awardTrophy(char *id);
|
||||||
extern void resetFighter(Entity *e);
|
extern void resetFighter(Entity *e);
|
||||||
|
extern void setAtlasColor(int r, int g, int b, int a);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
|
|
|
@ -928,12 +928,11 @@ static void addFighterStat(char *key)
|
||||||
|
|
||||||
t = malloc(sizeof(Tuple));
|
t = malloc(sizeof(Tuple));
|
||||||
memset(t, 0, sizeof(Tuple));
|
memset(t, 0, sizeof(Tuple));
|
||||||
|
tail->next = t;
|
||||||
|
|
||||||
STRNCPY(t->key, key, MAX_NAME_LENGTH);
|
STRNCPY(t->key, key, MAX_NAME_LENGTH);
|
||||||
t->value = 0;
|
t->value = 0;
|
||||||
|
|
||||||
tail->next = t;
|
|
||||||
|
|
||||||
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Added '%s' to fighter stats", key);
|
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Added '%s' to fighter stats", key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1079,6 +1078,12 @@ void destroyFighterDefs(void)
|
||||||
{
|
{
|
||||||
e = defHead.next;
|
e = defHead.next;
|
||||||
defHead.next = e->next;
|
defHead.next = e->next;
|
||||||
|
|
||||||
|
if (e->description)
|
||||||
|
{
|
||||||
|
free(e->description);
|
||||||
|
}
|
||||||
|
|
||||||
free(e);
|
free(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,6 +223,8 @@ static void drawHealthBars(void)
|
||||||
g = 200;
|
g = 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
blit(armour, 6, 9, 0);
|
blit(armour, 6, 9, 0);
|
||||||
drawHealthShieldBar(player->health, player->maxHealth, 30, 10, r, g, b, 1);
|
drawHealthShieldBar(player->health, player->maxHealth, 30, 10, r, g, b, 1);
|
||||||
|
|
||||||
|
@ -273,6 +275,8 @@ static void drawHealthShieldBar(int current, int max, int x, int y, int r, int g
|
||||||
|
|
||||||
static void drawAbilityBars(void)
|
static void drawAbilityBars(void)
|
||||||
{
|
{
|
||||||
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
blit(boost, 6, 49, 0);
|
blit(boost, 6, 49, 0);
|
||||||
drawBoostECMBar(battle.boostTimer, BOOST_RECHARGE_TIME, 30, 50, 128, 128, 255);
|
drawBoostECMBar(battle.boostTimer, BOOST_RECHARGE_TIME, 30, 50, 128, 128, 255);
|
||||||
|
|
||||||
|
@ -320,6 +324,8 @@ static void drawWeaponInfo(void)
|
||||||
{
|
{
|
||||||
int i, y;
|
int i, y;
|
||||||
|
|
||||||
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
if (!player->combinedGuns)
|
if (!player->combinedGuns)
|
||||||
{
|
{
|
||||||
if (battle.numPlayerGuns)
|
if (battle.numPlayerGuns)
|
||||||
|
@ -367,19 +373,19 @@ static void drawPlayerTargeter(void)
|
||||||
{
|
{
|
||||||
if (player->target)
|
if (player->target)
|
||||||
{
|
{
|
||||||
SDL_SetTextureColorMod(targetCircle->texture, 255, 0, 0);
|
setAtlasColor(255, 0, 0, 255);
|
||||||
}
|
}
|
||||||
else if (battle.missionTarget)
|
else if (battle.missionTarget)
|
||||||
{
|
{
|
||||||
SDL_SetTextureColorMod(targetCircle->texture, 0, 255, 0);
|
setAtlasColor(0, 255, 0, 255);
|
||||||
}
|
}
|
||||||
else if (battle.messageSpeaker)
|
else if (battle.messageSpeaker)
|
||||||
{
|
{
|
||||||
SDL_SetTextureColorMod(targetCircle->texture, 255, 255, 255);
|
setAtlasColor(255, 255, 255, 255);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SDL_SetTextureColorMod(targetCircle->texture, 255, 255, 0);
|
setAtlasColor(255, 255, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
blit(targetCircle, player->x - battle.camera.x, player->y - battle.camera.y, 1);
|
blit(targetCircle, player->x - battle.camera.x, player->y - battle.camera.y, 1);
|
||||||
|
@ -394,7 +400,7 @@ static void drawPlayerTargeter(void)
|
||||||
x += sin(TO_RAIDANS(angle)) * 45;
|
x += sin(TO_RAIDANS(angle)) * 45;
|
||||||
y += -cos(TO_RAIDANS(angle)) * 45;
|
y += -cos(TO_RAIDANS(angle)) * 45;
|
||||||
|
|
||||||
SDL_SetTextureColorMod(targetPointer->texture, 255, 0, 0);
|
setAtlasColor(255, 0, 0, 255);
|
||||||
|
|
||||||
blitRotated(targetPointer, x - battle.camera.x, y - battle.camera.y, angle);
|
blitRotated(targetPointer, x - battle.camera.x, y - battle.camera.y, angle);
|
||||||
}
|
}
|
||||||
|
@ -408,7 +414,7 @@ static void drawPlayerTargeter(void)
|
||||||
x += sin(TO_RAIDANS(angle)) * 45;
|
x += sin(TO_RAIDANS(angle)) * 45;
|
||||||
y += -cos(TO_RAIDANS(angle)) * 45;
|
y += -cos(TO_RAIDANS(angle)) * 45;
|
||||||
|
|
||||||
SDL_SetTextureColorMod(targetPointer->texture, 0, 255, 0);
|
setAtlasColor(0, 255, 0, 255);
|
||||||
|
|
||||||
blitRotated(targetPointer, x - battle.camera.x, y - battle.camera.y, angle);
|
blitRotated(targetPointer, x - battle.camera.x, y - battle.camera.y, angle);
|
||||||
}
|
}
|
||||||
|
@ -422,7 +428,7 @@ static void drawPlayerTargeter(void)
|
||||||
x += sin(TO_RAIDANS(angle)) * 45;
|
x += sin(TO_RAIDANS(angle)) * 45;
|
||||||
y += -cos(TO_RAIDANS(angle)) * 45;
|
y += -cos(TO_RAIDANS(angle)) * 45;
|
||||||
|
|
||||||
SDL_SetTextureColorMod(targetPointer->texture, 255, 255, 0);
|
setAtlasColor(255, 255, 0, 255);
|
||||||
|
|
||||||
blitRotated(targetPointer, x - battle.camera.x, y - battle.camera.y, angle);
|
blitRotated(targetPointer, x - battle.camera.x, y - battle.camera.y, angle);
|
||||||
}
|
}
|
||||||
|
@ -436,7 +442,7 @@ static void drawPlayerTargeter(void)
|
||||||
x += sin(TO_RAIDANS(angle)) * 45;
|
x += sin(TO_RAIDANS(angle)) * 45;
|
||||||
y += -cos(TO_RAIDANS(angle)) * 45;
|
y += -cos(TO_RAIDANS(angle)) * 45;
|
||||||
|
|
||||||
SDL_SetTextureColorMod(targetPointer->texture, 255, 255, 255);
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
blitRotated(targetPointer, x - battle.camera.x, y - battle.camera.y, angle);
|
blitRotated(targetPointer, x - battle.camera.x, y - battle.camera.y, angle);
|
||||||
}
|
}
|
||||||
|
@ -445,12 +451,12 @@ static void drawPlayerTargeter(void)
|
||||||
static void drawNumFighters(void)
|
static void drawNumFighters(void)
|
||||||
{
|
{
|
||||||
/* Allies */
|
/* Allies */
|
||||||
SDL_SetTextureColorMod(smallFighter->texture, 150, 200, 255);
|
setAtlasColor(150, 200, 255, 255);
|
||||||
blit(smallFighter, 400, 15, 0);
|
blit(smallFighter, 400, 15, 0);
|
||||||
drawText(425, 11, 14, TA_LEFT, colors.white, battle.numAllies < 1000 ? "(%d)" : "(999+)", battle.numAllies);
|
drawText(425, 11, 14, TA_LEFT, colors.white, battle.numAllies < 1000 ? "(%d)" : "(999+)", battle.numAllies);
|
||||||
|
|
||||||
/* Enemies */
|
/* Enemies */
|
||||||
SDL_SetTextureColorMod(smallFighter->texture, 255, 100, 100);
|
setAtlasColor(255, 100, 100, 255);
|
||||||
blit(smallFighter, SCREEN_WIDTH - 410, 15, 0);
|
blit(smallFighter, SCREEN_WIDTH - 410, 15, 0);
|
||||||
drawText(SCREEN_WIDTH - 420, 11, 14, TA_RIGHT, colors.white, !battle.unlimitedEnemies ? "(%d)" : "(999+)", battle.numEnemies);
|
drawText(SCREEN_WIDTH - 420, 11, 14, TA_RIGHT, colors.white, !battle.unlimitedEnemies ? "(%d)" : "(999+)", battle.numEnemies);
|
||||||
}
|
}
|
||||||
|
@ -459,6 +465,8 @@ static void drawObjectives(void)
|
||||||
{
|
{
|
||||||
int timeRemaining;
|
int timeRemaining;
|
||||||
|
|
||||||
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
if (!game.currentMission->challengeData.isChallenge)
|
if (!game.currentMission->challengeData.isChallenge)
|
||||||
{
|
{
|
||||||
blit(objectives, (SCREEN_WIDTH / 2) - 50, 14, 0);
|
blit(objectives, (SCREEN_WIDTH / 2) - 50, 14, 0);
|
||||||
|
@ -608,7 +616,7 @@ static void drawPlayerSelect(void)
|
||||||
SDL_RenderFillRect(app.renderer, NULL);
|
SDL_RenderFillRect(app.renderer, NULL);
|
||||||
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_NONE);
|
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_NONE);
|
||||||
|
|
||||||
SDL_SetTextureColorMod(targetCircle->texture, 0, 200, 255);
|
setAtlasColor(0, 200, 255, 255);
|
||||||
|
|
||||||
blit(targetCircle, player->x - battle.camera.x, player->y - battle.camera.y, 1);
|
blit(targetCircle, player->x - battle.camera.x, player->y - battle.camera.y, 1);
|
||||||
|
|
||||||
|
@ -619,6 +627,8 @@ static void drawPlayerSelect(void)
|
||||||
drawText(SCREEN_WIDTH / 2, 540, 20, TA_CENTER, colors.white, "%s (%d%% / %d%%)", player->defName, getPercent(player->health, player->maxHealth), getPercent(player->shield, player->maxShield));
|
drawText(SCREEN_WIDTH / 2, 540, 20, TA_CENTER, colors.white, "%s (%d%% / %d%%)", player->defName, getPercent(player->health, player->maxHealth), getPercent(player->shield, player->maxShield));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
blit(arrowLeft, (SCREEN_WIDTH / 2) - 200, 520, 1);
|
blit(arrowLeft, (SCREEN_WIDTH / 2) - 200, 520, 1);
|
||||||
blit(arrowRight, (SCREEN_WIDTH / 2) + 200, 520, 1);
|
blit(arrowRight, (SCREEN_WIDTH / 2) + 200, 520, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ extern int playerHasGun(int type);
|
||||||
extern char *getTranslatedString(char *string);
|
extern char *getTranslatedString(char *string);
|
||||||
extern char *timeToString(long millis, int showHours);
|
extern char *timeToString(long millis, int showHours);
|
||||||
extern int jumpgateEnabled(void);
|
extern int jumpgateEnabled(void);
|
||||||
|
extern void setAtlasColor(int r, int g, int b, int a);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
|
|
|
@ -552,19 +552,21 @@ static void drawGalaxy(void)
|
||||||
switch (starSystem->type)
|
switch (starSystem->type)
|
||||||
{
|
{
|
||||||
case SS_NORMAL:
|
case SS_NORMAL:
|
||||||
SDL_SetTextureColorMod(arrowTexture->texture, 255, 0, 0);
|
setAtlasColor(255, 0, 0, 255);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SS_SOL:
|
case SS_SOL:
|
||||||
SDL_SetTextureColorMod(arrowTexture->texture, 0, 255, 0);
|
setAtlasColor(0, 255, 0, 255);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SS_PANDORAN:
|
case SS_PANDORAN:
|
||||||
SDL_SetTextureColorMod(arrowTexture->texture, 64, 128, 255);
|
setAtlasColor(64, 128, 255, 255);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
blitRotated(arrowTexture, ax, ay, aa);
|
blitRotated(arrowTexture, ax, ay, aa);
|
||||||
|
|
||||||
|
setAtlasColor(255, 255, 255, 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -696,7 +698,7 @@ static void drawStarSystemDetail(void)
|
||||||
drawText(525, 160, 18, TA_LEFT, colors.lightGrey, CRAFT_TEXT, game.currentMission->craft);
|
drawText(525, 160, 18, TA_LEFT, colors.lightGrey, CRAFT_TEXT, game.currentMission->craft);
|
||||||
drawText(525, 185, 18, TA_LEFT, colors.lightGrey, SQUADRON_TEXT, game.currentMission->squadron);
|
drawText(525, 185, 18, TA_LEFT, colors.lightGrey, SQUADRON_TEXT, game.currentMission->squadron);
|
||||||
|
|
||||||
app.textWidth = 500;
|
app.textWidth = 550;
|
||||||
|
|
||||||
drawText(525, 230, 22, TA_LEFT, colors.white, game.currentMission->description);
|
drawText(525, 230, 22, TA_LEFT, colors.white, game.currentMission->description);
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ extern void doFighterDatabase(void);
|
||||||
extern void initFighterDatabaseDisplay(void);
|
extern void initFighterDatabaseDisplay(void);
|
||||||
extern void drawFighterDatabase(void);
|
extern void drawFighterDatabase(void);
|
||||||
extern void autoSizeWidgetButtons(char *group, int recenter);
|
extern void autoSizeWidgetButtons(char *group, int recenter);
|
||||||
|
extern void setAtlasColor(int r, int g, int b, int a);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Colors colors;
|
extern Colors colors;
|
||||||
|
|
|
@ -182,7 +182,7 @@ static void draw(void)
|
||||||
|
|
||||||
drawStars();
|
drawStars();
|
||||||
|
|
||||||
SDL_SetTextureColorMod(earthTexture->texture, 255, 255, 255);
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
blit(earthTexture, earth.x, earth.y, 1);
|
blit(earthTexture, earth.x, earth.y, 1);
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ static void draw(void)
|
||||||
|
|
||||||
drawEffects();
|
drawEffects();
|
||||||
|
|
||||||
SDL_SetTextureColorMod(logo[0]->texture, 255, 255, 255);
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
blit(logo[0], (SCREEN_WIDTH / 2) - logo[0]->rect.w, 30, 0);
|
blit(logo[0], (SCREEN_WIDTH / 2) - logo[0]->rect.w, 30, 0);
|
||||||
blit(logo[1], (SCREEN_WIDTH / 2), 30, 0);
|
blit(logo[1], (SCREEN_WIDTH / 2), 30, 0);
|
||||||
|
@ -228,10 +228,10 @@ static void drawFighters(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
setAtlasColor(255, 255, 255, 255);
|
||||||
|
|
||||||
for (i = 0 ; i < NUM_FIGHTERS ; i++)
|
for (i = 0 ; i < NUM_FIGHTERS ; i++)
|
||||||
{
|
{
|
||||||
SDL_SetTextureColorMod(fighters[i].texture->texture, 255, 255, 255);
|
|
||||||
|
|
||||||
blit(fighters[i].texture, fighters[i].x, fighters[i].y, 1);
|
blit(fighters[i].texture, fighters[i].x, fighters[i].y, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ extern void drawFighterDatabase(void);
|
||||||
extern void initFighterDatabaseDisplay(void);
|
extern void initFighterDatabaseDisplay(void);
|
||||||
extern void doFighterDatabase(void);
|
extern void doFighterDatabase(void);
|
||||||
extern void autoSizeWidgetButtons(char *group, int recenter);
|
extern void autoSizeWidgetButtons(char *group, int recenter);
|
||||||
|
extern void setAtlasColor(int r, int g, int b, int a);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
|
|
|
@ -171,7 +171,7 @@ void drawTrophies(void)
|
||||||
blitRotated(sparkle, x + 32, y + 32, sparkleAngle);
|
blitRotated(sparkle, x + 32, y + 32, sparkleAngle);
|
||||||
blitRotated(sparkle, x + 32, y + 32, -sparkleAngle);
|
blitRotated(sparkle, x + 32, y + 32, -sparkleAngle);
|
||||||
|
|
||||||
SDL_SetTextureColorMod(trophyIcons[t->value]->texture, 255, 255, 255);
|
setAtlasColor(255, 255, 255, 255);
|
||||||
blitScaled(trophyIcons[t->value], x, y, 64, 64, 0);
|
blitScaled(trophyIcons[t->value], x, y, 64, 64, 0);
|
||||||
drawText(x + 85, y - 10, 20, TA_LEFT, colors.yellow, t->title);
|
drawText(x + 85, y - 10, 20, TA_LEFT, colors.yellow, t->title);
|
||||||
drawText(x + 85, y + 20, 18, TA_LEFT, colors.white, t->description);
|
drawText(x + 85, y + 20, 18, TA_LEFT, colors.white, t->description);
|
||||||
|
@ -512,19 +512,19 @@ static void setSparkleColor(Trophy *t)
|
||||||
switch (t->value)
|
switch (t->value)
|
||||||
{
|
{
|
||||||
case TROPHY_BRONZE:
|
case TROPHY_BRONZE:
|
||||||
SDL_SetTextureColorMod(sparkle->texture, 255, 128, 0);
|
setAtlasColor(255, 128, 0, 255);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TROPHY_SILVER:
|
case TROPHY_SILVER:
|
||||||
SDL_SetTextureColorMod(sparkle->texture, 192, 192, 192);
|
setAtlasColor(192, 192, 192, 255);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TROPHY_GOLD:
|
case TROPHY_GOLD:
|
||||||
SDL_SetTextureColorMod(sparkle->texture, 255, 255, 0);
|
setAtlasColor(255, 255, 0, 255);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TROPHY_PLATINUM:
|
case TROPHY_PLATINUM:
|
||||||
SDL_SetTextureColorMod(sparkle->texture, 0, 128, 255);
|
setAtlasColor(0, 128, 255, 255);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ extern char *timeToDate(long millis);
|
||||||
extern void calcTextDimensions(char *text, int size, int *w, int *h);
|
extern void calcTextDimensions(char *text, int size, int *w, int *h);
|
||||||
extern void awardPandoranCraftTrophy(void);
|
extern void awardPandoranCraftTrophy(void);
|
||||||
extern float mod(float n, float x);
|
extern float mod(float n, float x);
|
||||||
|
extern void setAtlasColor(int r, int g, int b, int a);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
|
|
54
src/main.c
54
src/main.c
|
@ -28,7 +28,6 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
long then, lastFrameTime, frames;
|
long then, lastFrameTime, frames;
|
||||||
float remainder;
|
float remainder;
|
||||||
SDL_Event event;
|
|
||||||
|
|
||||||
memset(&app, 0, sizeof(App));
|
memset(&app, 0, sizeof(App));
|
||||||
memset(&dev, 0, sizeof(Dev));
|
memset(&dev, 0, sizeof(Dev));
|
||||||
|
@ -65,51 +64,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
capFrameRate(&then, &remainder);
|
capFrameRate(&then, &remainder);
|
||||||
|
|
||||||
while (SDL_PollEvent(&event))
|
doInput();
|
||||||
{
|
|
||||||
switch (event.type)
|
|
||||||
{
|
|
||||||
case SDL_MOUSEMOTION:
|
|
||||||
doMouseMotion(&event.motion);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_MOUSEWHEEL:
|
|
||||||
doMouseWheel(&event.wheel);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
|
||||||
doMouseDown(&event.button);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_MOUSEBUTTONUP:
|
|
||||||
doMouseUp(&event.button);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_KEYDOWN:
|
|
||||||
doKeyDown(&event.key);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_KEYUP:
|
|
||||||
doKeyUp(&event.key);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_QUIT:
|
|
||||||
exit(0);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_WINDOWEVENT:
|
|
||||||
switch (event.window.event)
|
|
||||||
{
|
|
||||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
|
||||||
musicSetPlaying(1);
|
|
||||||
break;
|
|
||||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
|
||||||
musicSetPlaying(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (app.modalDialog.type != MD_NONE)
|
if (app.modalDialog.type != MD_NONE)
|
||||||
{
|
{
|
||||||
|
@ -209,7 +164,7 @@ static void handleLoggingArgs(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN);
|
||||||
|
|
||||||
for (i = 1 ; i < argc ; i++)
|
for (i = 1 ; i < argc ; i++)
|
||||||
{
|
{
|
||||||
|
@ -220,11 +175,6 @@ static void handleLoggingArgs(int argc, char *argv[])
|
||||||
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG);
|
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(argv[i], "-warn") == 0)
|
|
||||||
{
|
|
||||||
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strcmp(argv[i], "-info") == 0)
|
if (strcmp(argv[i], "-info") == 0)
|
||||||
{
|
{
|
||||||
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
||||||
|
|
|
@ -54,7 +54,7 @@ extern void saveGame(void);
|
||||||
extern void initCredits(void);
|
extern void initCredits(void);
|
||||||
extern void doTrophyAlerts(void);
|
extern void doTrophyAlerts(void);
|
||||||
extern void drawTrophyAlert(void);
|
extern void drawTrophyAlert(void);
|
||||||
extern void musicSetPlaying(int playing);
|
extern void doInput(void);
|
||||||
|
|
||||||
App app;
|
App app;
|
||||||
Colors colors;
|
Colors colors;
|
||||||
|
|
|
@ -34,6 +34,12 @@ void initAtlas(void)
|
||||||
loadAtlasData();
|
loadAtlasData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setAtlasColor(int r, int g, int b, int a)
|
||||||
|
{
|
||||||
|
SDL_SetTextureColorMod(atlasTexture, r, g, b);
|
||||||
|
SDL_SetTextureAlphaMod(atlasTexture, a);
|
||||||
|
}
|
||||||
|
|
||||||
AtlasImage *getAtlasImage(char *filename)
|
AtlasImage *getAtlasImage(char *filename)
|
||||||
{
|
{
|
||||||
AtlasImage *a;
|
AtlasImage *a;
|
||||||
|
|
|
@ -188,10 +188,16 @@ void scrollBackground(float x, float y)
|
||||||
void drawBackground(SDL_Texture *texture)
|
void drawBackground(SDL_Texture *texture)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
SDL_Rect dstRect;
|
||||||
|
|
||||||
for (i = 0 ; i < 4 ; i++)
|
for (i = 0 ; i < 4 ; i++)
|
||||||
{
|
{
|
||||||
/*blitScaled(texture, backgroundPoint[i].x, backgroundPoint[i].y, SCREEN_WIDTH, SCREEN_HEIGHT, 0);*/
|
dstRect.x = backgroundPoint[i].x;
|
||||||
|
dstRect.y = backgroundPoint[i].y;
|
||||||
|
dstRect.w = SCREEN_WIDTH;
|
||||||
|
dstRect.h = SCREEN_HEIGHT;
|
||||||
|
|
||||||
|
SDL_RenderCopy(app.renderer, texture, NULL, &dstRect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,57 @@ void drawMouse(void)
|
||||||
blit(mousePointer, app.mouse.x, app.mouse.y, 1);
|
blit(mousePointer, app.mouse.x, app.mouse.y, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void doInput(void)
|
||||||
|
{
|
||||||
|
SDL_Event event;
|
||||||
|
|
||||||
|
while (SDL_PollEvent(&event))
|
||||||
|
{
|
||||||
|
switch (event.type)
|
||||||
|
{
|
||||||
|
case SDL_MOUSEMOTION:
|
||||||
|
doMouseMotion(&event.motion);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_MOUSEWHEEL:
|
||||||
|
doMouseWheel(&event.wheel);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
|
doMouseDown(&event.button);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_MOUSEBUTTONUP:
|
||||||
|
doMouseUp(&event.button);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_KEYDOWN:
|
||||||
|
doKeyDown(&event.key);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_KEYUP:
|
||||||
|
doKeyUp(&event.key);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_QUIT:
|
||||||
|
exit(0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_WINDOWEVENT:
|
||||||
|
switch (event.window.event)
|
||||||
|
{
|
||||||
|
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||||
|
musicSetPlaying(1);
|
||||||
|
break;
|
||||||
|
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||||
|
musicSetPlaying(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void clearInput(void)
|
void clearInput(void)
|
||||||
{
|
{
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
|
|
|
@ -22,5 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
extern AtlasImage *getAtlasImage(char *filename);
|
extern AtlasImage *getAtlasImage(char *filename);
|
||||||
extern void blit(AtlasImage *atlasImage, int x, int y, int centered);
|
extern void blit(AtlasImage *atlasImage, int x, int y, int centered);
|
||||||
|
extern void musicSetPlaying(int playing);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
|
|
|
@ -154,6 +154,8 @@ static void loadFighterStats(cJSON *fighterStatsJSON)
|
||||||
Tuple *t, *tail;
|
Tuple *t, *tail;
|
||||||
cJSON *fighterStatJSON;
|
cJSON *fighterStatJSON;
|
||||||
|
|
||||||
|
destroyFighterStats();
|
||||||
|
|
||||||
tail = &game.fighterStatHead;
|
tail = &game.fighterStatHead;
|
||||||
|
|
||||||
if (fighterStatsJSON)
|
if (fighterStatsJSON)
|
||||||
|
|
|
@ -30,5 +30,6 @@ extern char *getSaveFilePath(char *filename);
|
||||||
extern char *getLookupName(char *prefix, long num);
|
extern char *getLookupName(char *prefix, long num);
|
||||||
extern StarSystem *getStarSystem(char *name);
|
extern StarSystem *getStarSystem(char *name);
|
||||||
extern Trophy *getTrophy(char *id);
|
extern Trophy *getTrophy(char *id);
|
||||||
|
extern void destroyFighterStats(void);
|
||||||
|
|
||||||
extern Game game;
|
extern Game game;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2015-2016 Parallel Realities
|
Copyright (C) 2015-2018 Parallel Realities
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
|
@ -24,6 +24,51 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
$UPDATE_FILES = false;
|
$UPDATE_FILES = false;
|
||||||
|
|
||||||
|
function funcSort($a, $b)
|
||||||
|
{
|
||||||
|
$a = str_replace("*", "", $a);
|
||||||
|
$b = str_replace("*", "", $b);
|
||||||
|
|
||||||
|
$aParts = explode(" ", $a);
|
||||||
|
$bParts = explode(" ", $b);
|
||||||
|
|
||||||
|
return strcmp($aParts[2], $bParts[2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateExterns($header, $defines, $functions, $structs)
|
||||||
|
{
|
||||||
|
asort($defines);
|
||||||
|
usort($functions, "funcSort");
|
||||||
|
asort($structs);
|
||||||
|
|
||||||
|
$newHeader = [];
|
||||||
|
|
||||||
|
foreach ($header as $line)
|
||||||
|
{
|
||||||
|
$newHeader[] = $line;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($defines) > 0)
|
||||||
|
{
|
||||||
|
$newHeader[] = "\n";
|
||||||
|
$newHeader = array_merge($newHeader, $defines);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($functions) > 0)
|
||||||
|
{
|
||||||
|
$newHeader[] = "\n";
|
||||||
|
$newHeader = array_merge($newHeader, $functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($structs) > 0)
|
||||||
|
{
|
||||||
|
$newHeader[] = "\n";
|
||||||
|
$newHeader = array_merge($newHeader, $structs);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $newHeader;
|
||||||
|
}
|
||||||
|
|
||||||
function cleanHeader($headerFile)
|
function cleanHeader($headerFile)
|
||||||
{
|
{
|
||||||
global $UPDATE_FILES;
|
global $UPDATE_FILES;
|
||||||
|
@ -39,22 +84,28 @@ function cleanHeader($headerFile)
|
||||||
{
|
{
|
||||||
$header = file($headerFile);
|
$header = file($headerFile);
|
||||||
$body = file_get_contents($bodyFile);
|
$body = file_get_contents($bodyFile);
|
||||||
|
$isMain = strpos($body, "int main(int argc, char *argv[])");
|
||||||
$lines = [];
|
$lines = [];
|
||||||
|
$defines = [];
|
||||||
|
$functions = [];
|
||||||
|
$structs = [];
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$hasChanges = false;
|
$hasChanges = false;
|
||||||
|
|
||||||
foreach ($header as $line)
|
foreach ($header as $line)
|
||||||
{
|
{
|
||||||
if (preg_match("/extern|define/", $line) && strstr($line, "getTranslatedString") === FALSE)
|
if ((preg_match("/extern|define/", $line) || preg_match("/;$/", $line)) && strstr($line, "getTranslatedString") === FALSE)
|
||||||
{
|
{
|
||||||
preg_match($func_pattern, $line, $matches);
|
preg_match($func_pattern, $line, $matches);
|
||||||
|
|
||||||
if (count($matches) == 3)
|
if (count($matches) == 3)
|
||||||
{
|
{
|
||||||
|
unset($header[$i]);
|
||||||
|
|
||||||
$extern = $matches[2];
|
$extern = $matches[2];
|
||||||
|
|
||||||
if (!preg_match_all("/\b[(]?${extern}[\\(;,)\\n]/", $body))
|
if (!preg_match_all("/\b${extern}\b/", $body))
|
||||||
{
|
{
|
||||||
if (!$hasChanges)
|
if (!$hasChanges)
|
||||||
{
|
{
|
||||||
|
@ -62,22 +113,10 @@ function cleanHeader($headerFile)
|
||||||
$hasChanges = true;
|
$hasChanges = true;
|
||||||
}
|
}
|
||||||
echo "\t- $line";
|
echo "\t- $line";
|
||||||
unset($header[$i]);
|
|
||||||
}
|
}
|
||||||
|
else if (!in_array($line, $lines))
|
||||||
if (!in_array($line, $lines))
|
|
||||||
{
|
{
|
||||||
$lines[] = $line;
|
$functions[] = $line;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!$hasChanges)
|
|
||||||
{
|
|
||||||
echo "$headerFile\n";
|
|
||||||
$hasChanges = true;
|
|
||||||
}
|
|
||||||
echo "\t- $line";
|
|
||||||
unset($header[$i]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,34 +124,31 @@ function cleanHeader($headerFile)
|
||||||
|
|
||||||
if (count($matches) == 2)
|
if (count($matches) == 2)
|
||||||
{
|
{
|
||||||
|
unset($header[$i]);
|
||||||
|
|
||||||
$extern = $matches[1];
|
$extern = $matches[1];
|
||||||
|
|
||||||
$externs[] = $extern;
|
$externs[] = $extern;
|
||||||
|
|
||||||
if (!preg_match_all("/\b${extern}[\\.\\-\\)]/", $body))
|
if (!$isMain)
|
||||||
{
|
{
|
||||||
if (!$hasChanges)
|
if (!preg_match_all("/\b${extern}\b/", $body))
|
||||||
{
|
{
|
||||||
echo "$headerFile\n";
|
if (!$hasChanges)
|
||||||
$hasChanges = true;
|
{
|
||||||
|
echo "$headerFile\n";
|
||||||
|
$hasChanges = true;
|
||||||
|
}
|
||||||
|
echo "\t- $line";
|
||||||
}
|
}
|
||||||
echo "\t- $line";
|
else if (!in_array($line, $lines))
|
||||||
unset($header[$i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!in_array($line, $lines))
|
|
||||||
{
|
|
||||||
$lines[] = $line;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!$hasChanges)
|
|
||||||
{
|
{
|
||||||
echo "$headerFile\n";
|
$structs[] = $line;
|
||||||
$hasChanges = true;
|
|
||||||
}
|
}
|
||||||
echo "\t- $line";
|
}
|
||||||
unset($header[$i]);
|
else if (!in_array($line, $lines))
|
||||||
|
{
|
||||||
|
$structs[] = $line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +156,8 @@ function cleanHeader($headerFile)
|
||||||
|
|
||||||
if (count($matches) == 2)
|
if (count($matches) == 2)
|
||||||
{
|
{
|
||||||
|
unset($header[$i]);
|
||||||
|
|
||||||
$extern = $matches[1];
|
$extern = $matches[1];
|
||||||
|
|
||||||
$externs[] = $extern;
|
$externs[] = $extern;
|
||||||
|
@ -132,30 +170,36 @@ function cleanHeader($headerFile)
|
||||||
$hasChanges = true;
|
$hasChanges = true;
|
||||||
}
|
}
|
||||||
echo "\t- $line";
|
echo "\t- $line";
|
||||||
unset($header[$i]);
|
|
||||||
}
|
}
|
||||||
|
else if (!in_array($line, $lines))
|
||||||
if (!in_array($line, $lines))
|
|
||||||
{
|
{
|
||||||
$lines[] = $line;
|
$defines[] = $line;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!$hasChanges)
|
|
||||||
{
|
|
||||||
echo "$headerFile\n";
|
|
||||||
$hasChanges = true;
|
|
||||||
}
|
|
||||||
echo "\t- $line";
|
|
||||||
unset($header[$i]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
$wasBlank = false;
|
||||||
|
$line = trim(end($header));
|
||||||
|
if (strlen($line) == 0)
|
||||||
|
{
|
||||||
|
array_pop($header);
|
||||||
|
$wasBlank = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while ($wasBlank);
|
||||||
|
|
||||||
if ($UPDATE_FILES && $hasChanges)
|
$defines = array_unique($defines);
|
||||||
|
$functions = array_unique($functions);
|
||||||
|
$structs = array_unique($structs);
|
||||||
|
|
||||||
|
$header = updateExterns($header, $defines, $functions, $structs);
|
||||||
|
|
||||||
|
if ($UPDATE_FILES)
|
||||||
{
|
{
|
||||||
file_put_contents($headerFile, $header);
|
file_put_contents($headerFile, $header);
|
||||||
}
|
}
|
||||||
|
@ -174,7 +218,7 @@ function recurseDir($dir)
|
||||||
{
|
{
|
||||||
recurseDir("$dir/$file");
|
recurseDir("$dir/$file");
|
||||||
}
|
}
|
||||||
else if (strstr($file, ".h") !== FALSE)
|
else if (strstr($file, ".h") !== FALSE && $file != 'i18n.h')
|
||||||
{
|
{
|
||||||
cleanHeader("$dir/$file");
|
cleanHeader("$dir/$file");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue