Commit ac000e21 authored by alistert's avatar alistert

Palette effects are now interface-specific rather than global. Added planet approach sequences.

parent 6aad385b
...@@ -12,9 +12,10 @@ objects = src/bonus/bonus.o \ ...@@ -12,9 +12,10 @@ objects = src/bonus/bonus.o \
src/level/levelframe.o src/level/levelload.o \ src/level/levelframe.o src/level/levelload.o \
src/menu/gamemenu.o src/menu/mainmenu.o src/menu/menu.o \ src/menu/gamemenu.o src/menu/mainmenu.o src/menu/menu.o \
src/menu/menuutil.o src/menu/setupmenu.o \ src/menu/menuutil.o src/menu/setupmenu.o \
src/planet/planet.o \
src/player/bird.o src/player/player.o src/player/playerframe.o \ src/player/bird.o src/player/player.o src/player/playerframe.o \
src/scene/scene.o src/scene/sceneload.o \ src/scene/scene.o src/scene/sceneload.o \
src/baselevel.o src/main.o src/movable.o src/planet.o src/util.o \ src/baselevel.o src/main.o src/movable.o src/util.o \
src/io/gfx/scale2x/getopt.o src/io/gfx/scale2x/pixel.o \ src/io/gfx/scale2x/getopt.o src/io/gfx/scale2x/pixel.o \
src/io/gfx/scale2x/scale2x.o src/io/gfx/scale2x/scale3x.o \ src/io/gfx/scale2x/scale2x.o src/io/gfx/scale2x/scale3x.o \
src/io/gfx/scale2x/scalebit.o src/io/gfx/scale2x/simple2x.o src/io/gfx/scale2x/scalebit.o src/io/gfx/scale2x/simple2x.o
......
...@@ -36,9 +36,10 @@ OBJS = src/bonus/bonus.o \ ...@@ -36,9 +36,10 @@ OBJS = src/bonus/bonus.o \
src/level/levelframe.o src/level/levelload.o \ src/level/levelframe.o src/level/levelload.o \
src/menu/gamemenu.o src/menu/mainmenu.o src/menu/menu.o \ src/menu/gamemenu.o src/menu/mainmenu.o src/menu/menu.o \
src/menu/menuutil.o src/menu/setupmenu.o \ src/menu/menuutil.o src/menu/setupmenu.o \
src/planet/planet.o \
src/player/bird.o src/player/player.o src/player/playerframe.o \ src/player/bird.o src/player/player.o src/player/playerframe.o \
src/scene/scene.o src/scene/sceneload.o \ src/scene/scene.o src/scene/sceneload.o \
src/baselevel.o src/main.o src/movable.o src/planet.o src/util.o \ src/baselevel.o src/main.o src/movable.o src/util.o \
src/io/gfx/scale2x/getopt.o src/io/gfx/scale2x/pixel.o \ src/io/gfx/scale2x/getopt.o src/io/gfx/scale2x/pixel.o \
src/io/gfx/scale2x/scale2x.o src/io/gfx/scale2x/scale3x.o \ src/io/gfx/scale2x/scale2x.o src/io/gfx/scale2x/scale3x.o \
src/io/gfx/scale2x/scalebit.o src/io/gfx/scale2x/simple2x.o src/io/gfx/scale2x/scalebit.o src/io/gfx/scale2x/simple2x.o
......
...@@ -12,9 +12,10 @@ objects = src/bonus/bonus.o \ ...@@ -12,9 +12,10 @@ objects = src/bonus/bonus.o \
src/level/levelframe.o src/level/levelload.o \ src/level/levelframe.o src/level/levelload.o \
src/menu/gamemenu.o src/menu/mainmenu.o src/menu/menu.o \ src/menu/gamemenu.o src/menu/mainmenu.o src/menu/menu.o \
src/menu/menuutil.o src/menu/setupmenu.o \ src/menu/menuutil.o src/menu/setupmenu.o \
src/planet/planet.o \
src/player/bird.o src/player/player.o src/player/playerframe.o \ src/player/bird.o src/player/player.o src/player/playerframe.o \
src/scene/scene.o src/scene/sceneload.o \ src/scene/scene.o src/scene/sceneload.o \
src/baselevel.o src/main.o src/movable.o src/planet.o src/util.o \ src/baselevel.o src/main.o src/movable.o src/util.o \
src/io/gfx/scale2x/getopt.o src/io/gfx/scale2x/pixel.o \ src/io/gfx/scale2x/getopt.o src/io/gfx/scale2x/pixel.o \
src/io/gfx/scale2x/scale2x.o src/io/gfx/scale2x/scale3x.o \ src/io/gfx/scale2x/scale2x.o src/io/gfx/scale2x/scale3x.o \
src/io/gfx/scale2x/scalebit.o src/io/gfx/scale2x/simple2x.o src/io/gfx/scale2x/scalebit.o src/io/gfx/scale2x/simple2x.o
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
* 3rd June 2009: Created network.h from parts of OpenJazz.h * 3rd June 2009: Created network.h from parts of OpenJazz.h
* 13th July 2009: Created controls.h from parts of OpenJazz.h * 13th July 2009: Created controls.h from parts of OpenJazz.h
* 13th July 2009: Created graphics.h from parts of OpenJazz.h * 13th July 2009: Created graphics.h from parts of OpenJazz.h
* 30th April 2010: Created util.h from parts of OpenJazz.h
* 30th April 2010: Created loop.h from parts of OpenJazz.h
* *
* Part of the OpenJazz project * Part of the OpenJazz project
* *
...@@ -142,14 +144,11 @@ ...@@ -142,14 +144,11 @@
#define MUL(x, y) (((x) * (y)) >> 10) #define MUL(x, y) (((x) * (y)) >> 10)
#define DIV(x, y) (((x) << 10) / (y)) #define DIV(x, y) (((x) << 10) / (y))
#ifdef VERBOSE
// Enum #define LOG(x, y) log(x, y)
#else
enum LoopType { #define LOG(x, y)
#endif
NORMAL_LOOP, TYPING_LOOP, SET_KEY_LOOP, SET_JOYSTICK_LOOP
};
// Datatype // Datatype
...@@ -159,39 +158,8 @@ typedef int fixed; ...@@ -159,39 +158,8 @@ typedef int fixed;
// Variable // Variable
// Time
EXTERN unsigned int globalTicks; EXTERN unsigned int globalTicks;
// Trigonometric function look-up tables
EXTERN fixed sinLut[1024];
// Functions in main.cpp
EXTERN int loop (LoopType type);
// Functions in util.cpp
EXTERN bool fileExists (const char *fileName);
EXTERN char * createString (const char *string);
EXTERN char * createString (const char *first, const char *second);
EXTERN char * createFileName (const char *type, int extension);
EXTERN char * createFileName (const char *type, const char *extension);
EXTERN char * createFileName (const char *type, int level, int extension);
EXTERN char * createEditableString (const char *string);
EXTERN void log (const char *message);
EXTERN void log (const char *message, const char *detail);
EXTERN void log (const char *message, int number);
EXTERN void logError (const char *message, const char *detail);
EXTERN fixed fSin (fixed angle);
EXTERN fixed fCos (fixed angle);
#ifdef VERBOSE
#define LOG(x, y) log(x, y)
#else
#define LOG(x, y)
#endif
#endif #endif
...@@ -42,6 +42,8 @@ BaseLevel::BaseLevel () { ...@@ -42,6 +42,8 @@ BaseLevel::BaseLevel () {
// Arbitrary initial value // Arbitrary initial value
smoothfps = 50.0f; smoothfps = 50.0f;
paletteEffects = NULL;
paused = false; paused = false;
// Set the level stage // Set the level stage
...@@ -56,13 +58,7 @@ BaseLevel::~BaseLevel () { ...@@ -56,13 +58,7 @@ BaseLevel::~BaseLevel () {
stopMusic(); stopMusic();
// Free the palette effects if (paletteEffects) delete paletteEffects;
if (paletteEffects) {
delete paletteEffects;
paletteEffects = NULL;
}
SDL_FreeSurface(tileSet); SDL_FreeSurface(tileSet);
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#define _BASELEVEL_H #define _BASELEVEL_H
#include "OpenJazz.h" #include "io/gfx/paletteeffects.h"
#include <SDL/SDL.h> #include <SDL/SDL.h>
...@@ -63,6 +63,7 @@ class BaseLevel { ...@@ -63,6 +63,7 @@ class BaseLevel {
protected: protected:
SDL_Surface* tileSet; SDL_Surface* tileSet;
Sprite* spriteSet; Sprite* spriteSet;
PaletteEffect* paletteEffects;
SDL_Color palette[256]; SDL_Color palette[256];
int sprites; int sprites;
unsigned int tickOffset, prevStepTicks, prevTicks, ticks; unsigned int tickOffset, prevStepTicks, prevTicks, ticks;
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include "io/sound.h" #include "io/sound.h"
#include "menu/menu.h" #include "menu/menu.h"
#include "player/player.h" #include "player/player.h"
#include "loop.h"
#include "util.h"
#include <string.h> #include <string.h>
...@@ -598,8 +600,8 @@ void Bonus::draw () { ...@@ -598,8 +600,8 @@ void Bonus::draw () {
if (sprite) { if (sprite) {
nX = DIV(MUL(sX, playerCos) + MUL(sY, playerSin), divisor); nX = DIV(MUL(sX, playerCos) + MUL(sY, playerSin), divisor);
dst.x = FTOI(nX * canvasW) + ((canvasW - (ITOF(sprite->getWidth() << 5) / divisor)) >> 1); dst.x = FTOI(nX * canvasW) + (canvasW >> 1);
dst.y = (canvasH - (ITOF(sprite->getHeight() << 5) / divisor)) >> 1; dst.y = canvasH >> 1;
sprite->drawScaled(dst.x, dst.y, DIV(F32, divisor)); sprite->drawScaled(dst.x, dst.y, DIV(F32, divisor));
} }
...@@ -642,7 +644,6 @@ void Bonus::draw () { ...@@ -642,7 +644,6 @@ void Bonus::draw () {
int Bonus::play () { int Bonus::play () {
const char *options[3] = {"continue game", "setup options", "quit game"}; const char *options[3] = {"continue game", "setup options", "quit game"};
PaletteEffect *levelPE;
bool pmenu, pmessage; bool pmenu, pmessage;
int stats, option; int stats, option;
unsigned int returnTime; unsigned int returnTime;
...@@ -663,7 +664,7 @@ int Bonus::play () { ...@@ -663,7 +664,7 @@ int Bonus::play () {
while (true) { while (true) {
if (loop(NORMAL_LOOP) == E_QUIT) return E_QUIT; if (loop(NORMAL_LOOP, paletteEffects) == E_QUIT) return E_QUIT;
if (controls.release(C_ESCAPE)) { if (controls.release(C_ESCAPE)) {
...@@ -703,18 +704,11 @@ int Bonus::play () { ...@@ -703,18 +704,11 @@ int Bonus::play () {
if (!gameMode) { if (!gameMode) {
// Don't want palette effects in setup menu
levelPE = paletteEffects;
paletteEffects = NULL;
if (menu->setup() == E_QUIT) return E_QUIT; if (menu->setup() == E_QUIT) return E_QUIT;
// Restore level palette // Restore level palette
video.setPalette(palette); video.setPalette(palette);
// Restore palette effects
paletteEffects = levelPE;
} }
break; break;
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include "level/level.h" #include "level/level.h"
#include "menu/menu.h" #include "menu/menu.h"
#include "player/player.h" #include "player/player.h"
#include "loop.h"
#include "util.h"
#include <string.h> #include <string.h>
...@@ -246,14 +248,6 @@ int ClientGame::setLevel (char* fileName) { ...@@ -246,14 +248,6 @@ int ClientGame::setLevel (char* fileName) {
int ret; int ret;
// Free the palette effects
if (paletteEffects) {
delete paletteEffects;
paletteEffects = NULL;
}
video.setPalette(menu->palettes[1]); video.setPalette(menu->palettes[1]);
// Wait for level data to start arriving // Wait for level data to start arriving
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "io/sound.h" #include "io/sound.h"
#include "level/level.h" #include "level/level.h"
#include "planet/planet.h"
#include "player/player.h" #include "player/player.h"
#include "util.h"
#include <string.h> #include <string.h>
...@@ -92,12 +94,15 @@ int Game::setLevel (char *fileName) { ...@@ -92,12 +94,15 @@ int Game::setLevel (char *fileName) {
int Game::play () { int Game::play () {
Planet* planet;
Bonus* bonus; Bonus* bonus;
char* bonusFile; char* fileName;
bool checkpoint; bool checkpoint;
int ret; int ret;
int planetId;
checkpoint = false; checkpoint = false;
planetId = -1;
// Play the level(s) // Play the level(s)
while (true) { while (true) {
...@@ -134,9 +139,9 @@ int Game::play () { ...@@ -134,9 +139,9 @@ int Game::play () {
} else if (ret == WON) { } else if (ret == WON) {
// Go to next level // Go to next level
bonusFile = createFileName(F_BONUSMAP, (levelFile[10] * 10) + levelFile[11] - 527); fileName = createFileName(F_BONUSMAP, (levelFile[10] * 10) + levelFile[11] - 527);
setLevel(bonusFile); setLevel(fileName);
delete[] bonusFile; delete[] fileName;
} }
...@@ -154,6 +159,38 @@ int Game::play () { ...@@ -154,6 +159,38 @@ int Game::play () {
} }
planet = NULL;
fileName = createFileName(F_PLANET, levelFile + strlen(levelFile) - 3);
try {
planet = new Planet(fileName, planetId);
} catch (int e) {
// Do nothing
}
delete[] fileName;
if (planet) {
if (planet->play() == E_QUIT) {
delete planet;
delete level;
return E_QUIT;
}
planetId = planet->getId();
delete planet;
}
ret = level->play(); ret = level->play();
if (ret <= 0) { if (ret <= 0) {
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "io/network.h" #include "io/network.h"
#include "level/level.h" #include "level/level.h"
#include "player/player.h" #include "player/player.h"
#include "util.h"
#include <string.h> #include <string.h>
......
...@@ -26,11 +26,13 @@ ...@@ -26,11 +26,13 @@
#include "controls.h" #include "controls.h"
#include "loop.h"
#if defined(WIZ) || defined(GP2X) #if defined(WIZ) || defined(GP2X)
#include "platforms/wiz.h" #include "platforms/wiz.h"
#endif #endif
Controls::Controls () { Controls::Controls () {
int count; int count;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "file.h" #include "file.h"
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "util.h"
#include <string.h> #include <string.h>
...@@ -74,7 +75,7 @@ bool File::open (const char* path, const char* name, bool write) { ...@@ -74,7 +75,7 @@ bool File::open (const char* path, const char* name, bool write) {
filePath = createString(path, name); filePath = createString(path, name);
#ifdef UPPERCASE_FILENAMES #ifdef UPPERCASE_FILENAMES
for (count = strlen(path); count < strlen(filePath); count++) { for (count = strlen(path); filePath[count]; count++) {
if ((filePath[count] >= 97) && (filePath[count] <= 122)) filePath[count] -= 32; if ((filePath[count] >= 97) && (filePath[count] <= 122)) filePath[count] -= 32;
...@@ -82,7 +83,7 @@ bool File::open (const char* path, const char* name, bool write) { ...@@ -82,7 +83,7 @@ bool File::open (const char* path, const char* name, bool write) {
#endif #endif
#ifdef LOWERCASE_FILENAMES #ifdef LOWERCASE_FILENAMES
for (count = strlen(path); count < strlen(filePath); count++) { for (count = strlen(path); filePath[count]; count++) {
if ((filePath[count] >= 65) && (filePath[count] <= 90)) filePath[count] += 32; if ((filePath[count] >= 65) && (filePath[count] <= 90)) filePath[count] += 32;
...@@ -428,12 +429,13 @@ unsigned char* File::loadPixels (int length, int key) { ...@@ -428,12 +429,13 @@ unsigned char* File::loadPixels (int length, int key) {
} }
void File::loadPalette (SDL_Color* palette) { void File::loadPalette (SDL_Color* palette, bool rle) {
unsigned char* buffer; unsigned char* buffer;
int count; int count;
buffer = loadRLE(768); if (rle) buffer = loadRLE(768);
else buffer = loadBlock(768);
for (count = 0; count < 256; count++) { for (count = 0; count < 256; count++) {
......
...@@ -60,7 +60,7 @@ class File { ...@@ -60,7 +60,7 @@ class File {
SDL_Surface* loadSurface (int width, int height); SDL_Surface* loadSurface (int width, int height);
unsigned char* loadPixels (int length); unsigned char* loadPixels (int length);
unsigned char* loadPixels (int length, int key); unsigned char* loadPixels (int length, int key);
void loadPalette (SDL_Color* palette); void loadPalette (SDL_Color* palette, bool rle = true);
}; };
......
...@@ -124,8 +124,7 @@ class FlashPaletteEffect : public PaletteEffect { ...@@ -124,8 +124,7 @@ class FlashPaletteEffect : public PaletteEffect {
unsigned char red, green, blue; // Flash colour unsigned char red, green, blue; // Flash colour
public: public:
FlashPaletteEffect (unsigned char newRed, unsigned char newGreen, FlashPaletteEffect (unsigned char newRed, unsigned char newGreen, unsigned char newBlue, int newDuration, PaletteEffect* nextPE);
unsigned char newBlue, int newDuration, PaletteEffect* nextPE);
void apply (SDL_Color* shownPalette, bool direct, int mspf); void apply (SDL_Color* shownPalette, bool direct, int mspf);
...@@ -141,8 +140,7 @@ class RotatePaletteEffect : public PaletteEffect { ...@@ -141,8 +140,7 @@ class RotatePaletteEffect : public PaletteEffect {
fixed position; fixed position;
public: public:
RotatePaletteEffect (unsigned char newFirst, int newAmount, RotatePaletteEffect (unsigned char newFirst, int newAmount, fixed newSpeed, PaletteEffect* nextPE);
fixed newSpeed, PaletteEffect* nextPE);
void apply (SDL_Color* shownPalette, bool direct, int mspf); void apply (SDL_Color* shownPalette, bool direct, int mspf);
...@@ -152,14 +150,13 @@ class RotatePaletteEffect : public PaletteEffect { ...@@ -152,14 +150,13 @@ class RotatePaletteEffect : public PaletteEffect {
class SkyPaletteEffect : public PaletteEffect { class SkyPaletteEffect : public PaletteEffect {
private: private:
SDL_Color *skyPalette; SDL_Color* skyPalette;
unsigned char first; /* The first palette index affected */ unsigned char first; /* The first palette index affected */
int amount; /* The number of (consecutive) palette indices affected */ int amount; /* The number of (consecutive) palette indices affected */
fixed speed; // Relative Y speed - as in Jazz 2 fixed speed; // Relative Y speed - as in Jazz 2
public: public:
SkyPaletteEffect (unsigned char newFirst, int newAmount, SkyPaletteEffect (unsigned char newFirst, int newAmount, fixed newSpeed, SDL_Color* newSkyPalette, PaletteEffect* nextPE);
fixed newSpeed, SDL_Color* newSkyPalette, PaletteEffect* nextPE);
void apply (SDL_Color* shownPalette, bool direct, int mspf); void apply (SDL_Color* shownPalette, bool direct, int mspf);
...@@ -174,8 +171,7 @@ class P2DPaletteEffect : public PaletteEffect { ...@@ -174,8 +171,7 @@ class P2DPaletteEffect : public PaletteEffect {
fixed speed; // Relative X & Y speed - as in Jazz 2 fixed speed; // Relative X & Y speed - as in Jazz 2
public: public:
P2DPaletteEffect (unsigned char newFirst, int newAmount, P2DPaletteEffect (unsigned char newFirst, int newAmount, fixed newSpeed, PaletteEffect* nextPE);
fixed newSpeed, PaletteEffect* nextPE);
void apply (SDL_Color* shownPalette, bool direct, int mspf); void apply (SDL_Color* shownPalette, bool direct, int mspf);
...@@ -190,8 +186,7 @@ class P1DPaletteEffect : public PaletteEffect { ...@@ -190,8 +186,7 @@ class P1DPaletteEffect : public PaletteEffect {
fixed speed; // Relative X & Y speed - as in Jazz 2 fixed speed; // Relative X & Y speed - as in Jazz 2
public: public:
P1DPaletteEffect (unsigned char newFirst, int newAmount, P1DPaletteEffect (unsigned char newFirst, int newAmount, fixed newSpeed, PaletteEffect* nextPE);
fixed newSpeed, PaletteEffect* nextPE);
void apply (SDL_Color* shownPalette, bool direct, int mspf); void apply (SDL_Color* shownPalette, bool direct, int mspf);
...@@ -211,10 +206,6 @@ class WaterPaletteEffect : public PaletteEffect { ...@@ -211,10 +206,6 @@ class WaterPaletteEffect : public PaletteEffect {
}; };
// Variable
EXTERN PaletteEffect* paletteEffects;
#endif #endif
...@@ -138,31 +138,33 @@ void Sprite::drawScaled (int x, int y, fixed scale) { ...@@ -138,31 +138,33 @@ void Sprite::drawScaled (int x, int y, fixed scale) {
unsigned char* srcRow; unsigned char* srcRow;
unsigned char* dstRow; unsigned char* dstRow;
unsigned char pixel, key; unsigned char pixel, key;
int width, height; int width, height, fullWidth, fullHeight;
int dstX, dstY; int dstX, dstY;
int srcX, srcY; int srcX, srcY;
key = pixels->format->colorkey; key = pixels->format->colorkey;
width = FTOI(pixels->w * scale); fullWidth = FTOI(pixels->w * scale);
if (x + width > canvasW) width = canvasW - x; if (x < -(fullWidth >> 1)) return; // Off-screen
if (x < -width) return; // Off-screen if (x + (fullWidth >> 1) > canvasW) width = canvasW + (fullWidth >> 1) - x;
else width = fullWidth;
height = FTOI(pixels->h * scale); fullHeight = FTOI(pixels->h * scale);
if (y + height > canvasH) height = canvasH - y; if (y < -(fullHeight >> 1)) return; // Off-screen
if (y < -height) return; // Off-screen if (y + (fullHeight >> 1) > canvasH) height = canvasH + (fullHeight >> 1) - y;
else height = fullHeight;
if (SDL_MUSTLOCK(canvas)) SDL_LockSurface(canvas); if (SDL_MUSTLOCK(canvas)) SDL_LockSurface(canvas);
if (y < 0) { if (y < (fullHeight >> 1)) {
srcY = -y; srcY = (fullHeight >> 1) - y;
dstY = 0; dstY = 0;
} else { } else {
srcY = 0; srcY = 0;
dstY = y; dstY = y - (fullHeight >> 1);
} }
...@@ -171,15 +173,15 @@ void Sprite::drawScaled (int x, int y, fixed scale) { ...@@ -171,15 +173,15 @@ void Sprite::drawScaled (int x, int y, fixed scale) {
srcRow = ((unsigned char *)(pixels->pixels)) + (pixels->pitch * DIV(srcY, scale)); srcRow = ((unsigned char *)(pixels->pixels)) + (pixels->pitch * DIV(srcY, scale));
dstRow = ((unsigned char *)(canvas->pixels)) + (canvas->pitch * dstY); dstRow = ((unsigned char *)(canvas->pixels)) + (canvas->pitch * dstY);
if (x < 0) { if (x < (fullWidth >> 1)) {
srcX = -x; srcX = (fullWidth >> 1) - x;
dstX = 0; dstX = 0;
} else { } else {
srcX = 0; srcX = 0;
dstX = x; dstX = x - (fullWidth >> 1);
} }
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#define _SPRITE_H #define _SPRITE_H
#include "OpenJazz.h"
#include <SDL/SDL.h> #include <SDL/SDL.h>
......
...@@ -267,7 +267,7 @@ void Video::expose () { ...@@ -267,7 +267,7 @@ void Video::expose () {
} }
void Video::flip (int mspf) { void Video::flip (int mspf, PaletteEffect* paletteEffects) {
SDL_Color shownPalette[256]; SDL_Color shownPalette[256];
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#define _VIDEO_H #define _VIDEO_H
#include "OpenJazz.h" #include "paletteeffects.h"
#include <SDL/SDL.h> #include <SDL/SDL.h>
...@@ -91,7 +91,7 @@ class Video { ...@@ -91,7 +91,7 @@ class Video {
#endif #endif
void expose (); void expose ();
void flip (int mspf); void flip (int mspf, PaletteEffect* paletteEffects);
}; };
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
#include "gfx/video.h" #include "gfx/video.h"
#include "network.h" #include "network.h"
#include "loop.h"
#include "util.h"
#ifdef USE_SOCKETS #ifdef USE_SOCKETS
#ifdef WIN32 #ifdef WIN32
#include <winsock.h> #include <winsock.h>
......
...@@ -30,32 +30,37 @@ ...@@ -30,32 +30,37 @@
#include "file.h" #include "file.h"
#include "sound.h" #include "sound.h"
#include "util.h"
#include <SDL/SDL_audio.h> #include <SDL/SDL_audio.h>
#ifdef USE_MODPLUG
#include <modplug.h>
#endif
#ifdef __SYMBIAN32__ #ifdef __SYMBIAN32__
#define SOUND_FREQ 22050 #define SOUND_FREQ 22050
#else #else
#define SOUND_FREQ 44100 #define SOUND_FREQ 44100
#endif #endif
#ifdef USE_MODPLUG #ifdef USE_MODPLUG
#include <modplug.h>
#ifdef __SYMBIAN32__
#define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_LINEAR
#define MUSIC_FLAGS MODPLUG_ENABLE_MEGABASS
#elif defined(WIZ) || defined(GP2X)
#define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_LINEAR
#define MUSIC_FLAGS 0
#else
#define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_FIR
#define MUSIC_FLAGS MODPLUG_ENABLE_NOISE_REDUCTION | MODPLUG_ENABLE_REVERB | MODPLUG_ENABLE_MEGABASS | MODPLUG_ENABLE_SURROUND
#endif
ModPlugFile *musicFile; ModPlugFile *musicFile;
#ifdef __SYMBIAN32__
#define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_LINEAR
#define MUSIC_FLAGS MODPLUG_ENABLE_MEGABASS
#else
#if defined(WIZ) || defined(GP2X)
#define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_LINEAR
#define MUSIC_FLAGS 0
#else
#define MUSIC_RESAMPLEMODE MODPLUG_RESAMPLE_FIR
#define MUSIC_FLAGS MODPLUG_ENABLE_NOISE_REDUCTION | MODPLUG_ENABLE_REVERB | MODPLUG_ENABLE_MEGABASS | MODPLUG_ENABLE_SURROUND
#endif
#endif
#endif #endif
SDL_AudioSpec audioSpec; SDL_AudioSpec audioSpec;
......
...@@ -66,7 +66,7 @@ Bullet::Bullet (Player* sourcePlayer, bool lower, unsigned int ticks) { ...@@ -66,7 +66,7 @@ Bullet::Bullet (Player* sourcePlayer, bool lower, unsigned int ticks) {
time = ticks + T_TNT; time = ticks + T_TNT;
// Red flash // Red flash
paletteEffects = new FlashPaletteEffect(255, 0, 0, T_TNT, paletteEffects); level->flash(255, 0, 0, T_TNT);
} else { } else {
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#include "io/gfx/font.h" #include "io/gfx/font.h"
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "player/player.h" #include "player/player.h"
#include "loop.h"
#include "util.h"
DemoLevel::DemoLevel (const char* fileName) { DemoLevel::DemoLevel (const char* fileName) {
...@@ -108,7 +110,7 @@ int DemoLevel::play () { ...@@ -108,7 +110,7 @@ int DemoLevel::play () {
while (true) { while (true) {
// Do general processing // Do general processing
if (loop(NORMAL_LOOP) == E_QUIT) return E_QUIT; if (loop(NORMAL_LOOP, paletteEffects) == E_QUIT) return E_QUIT;
if (controls.release(C_ESCAPE)) return E_NONE; if (controls.release(C_ESCAPE)) return E_NONE;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "io/sound.h" #include "io/sound.h"
#include "player/player.h" #include "player/player.h"
#include "util.h"
#include <stdlib.h> #include <stdlib.h>
......
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
#include "menu/menu.h" #include "menu/menu.h"
#include "player/player.h" #include "player/player.h"
#include "scene/scene.h" #include "scene/scene.h"
#include "loop.h"
#include "util.h"
#include <string.h> #include <string.h>
...@@ -102,6 +104,7 @@ Level::~Level () { ...@@ -102,6 +104,7 @@ Level::~Level () {
} }
delete[] sceneFile; delete[] sceneFile;
delete[] musicFile;
return; return;
...@@ -387,6 +390,15 @@ void Level::playSound (int sound) { ...@@ -387,6 +390,15 @@ void Level::playSound (int sound) {
} }
void Level::flash (unsigned char red, unsigned char green, unsigned char blue, int duration) {
paletteEffects = new FlashPaletteEffect(red, green, blue, duration, paletteEffects);
return;
}
void Level::setStage (LevelStage newStage) { void Level::setStage (LevelStage newStage) {
unsigned char buffer[MTL_L_STAGE]; unsigned char buffer[MTL_L_STAGE];
...@@ -505,7 +517,6 @@ int Level::play () { ...@@ -505,7 +517,6 @@ int Level::play () {
const char* options[5] = const char* options[5] =
{"continue game", "save game", "load game", "setup options", "quit game"}; {"continue game", "save game", "load game", "setup options", "quit game"};
PaletteEffect *levelPE;
char *string; char *string;
bool pmessage, pmenu; bool pmessage, pmenu;
int stats, option; int stats, option;
...@@ -529,9 +540,11 @@ int Level::play () { ...@@ -529,9 +540,11 @@ int Level::play () {
video.setPalette(palette); video.setPalette(palette);
playMusic(musicFile);
while (true) { while (true) {
if (loop(NORMAL_LOOP) == E_QUIT) return E_QUIT; if (loop(NORMAL_LOOP, paletteEffects) == E_QUIT) return E_QUIT;
if (controls.release(C_ESCAPE)) { if (controls.release(C_ESCAPE)) {
...@@ -579,18 +592,11 @@ int Level::play () { ...@@ -579,18 +592,11 @@ int Level::play () {
if (!gameMode) { if (!gameMode) {
// Don't want palette effects in setup menu
levelPE = paletteEffects;
paletteEffects = NULL;
if (menu->setup() == E_QUIT) return E_QUIT; if (menu->setup() == E_QUIT) return E_QUIT;
// Restore level palette // Restore level palette
video.setPalette(palette); video.setPalette(palette);
// Restore palette effects
paletteEffects = levelPE;
} }
break; break;
......
...@@ -92,6 +92,7 @@ class Scene; ...@@ -92,6 +92,7 @@ class Scene;
class Level : public BaseLevel { class Level : public BaseLevel {
private: private:
char* musicFile;
char* sceneFile; char* sceneFile;
Anim animSet[ANIMS]; Anim animSet[ANIMS];
char miscAnims[4]; char miscAnims[4];
...@@ -148,6 +149,7 @@ class Level : public BaseLevel { ...@@ -148,6 +149,7 @@ class Level : public BaseLevel {
void setWaterLevel (unsigned char gridY); void setWaterLevel (unsigned char gridY);
fixed getWaterLevel (); fixed getWaterLevel ();
void playSound (int sound); void playSound (int sound);
void flash (unsigned char red, unsigned char green, unsigned char blue, int duration);
void setStage (LevelStage stage); void setStage (LevelStage stage);
LevelStage getStage (); LevelStage getStage ();
void receive (unsigned char* buffer); void receive (unsigned char* buffer);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "io/gfx/font.h" #include "io/gfx/font.h"
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "player/player.h" #include "player/player.h"
#include "util.h"
int Level::step () { int Level::step () {
......
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#include "io/sound.h" #include "io/sound.h"
#include "menu/menu.h" #include "menu/menu.h"
#include "player/player.h" #include "player/player.h"
#include "loop.h"
#include "util.h"
#include <string.h> #include <string.h>
...@@ -712,12 +714,10 @@ int Level::load (char *fileName, unsigned char diff, bool checkpoint) { ...@@ -712,12 +714,10 @@ int Level::load (char *fileName, unsigned char diff, bool checkpoint) {
file->seek(x + 288, true); file->seek(x + 288, true);
// Music file // Music file
string = file->loadString(); musicFile = file->loadString();
playMusic(string);
// 26 bytes of undiscovered usefulness, less the music file name // 26 bytes of undiscovered usefulness, less the music file name
file->seek(x + 314, true); file->seek(x + 314, true);
delete[] string;
// End of episode cutscene // End of episode cutscene
sceneFile = file->loadString(); sceneFile = file->loadString();
......
/*
*
* loop.h
*
* 30th April 2010: Created loop.h from parts of OpenJazz.h
*
* Part of the OpenJazz project
*
*
* Copyright (c) 2005-2010 Alister Thomson
*
* OpenJazz is distributed under the terms of
* the GNU General Public License, version 2.0
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _LOOP_H
#define _LOOP_H
#include "io/gfx/paletteeffects.h"
// Enum
enum LoopType {
NORMAL_LOOP, TYPING_LOOP, SET_KEY_LOOP, SET_JOYSTICK_LOOP
};
// Function in main.cpp
EXTERN int loop (LoopType type, PaletteEffect* paletteEffects = NULL);
#endif
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include "menu/menu.h" #include "menu/menu.h"
#include "player/player.h" #include "player/player.h"
#include "scene/scene.h" #include "scene/scene.h"
#include "loop.h"
#include "util.h"
#include <string.h> #include <string.h>
...@@ -304,9 +306,6 @@ int loadMain (int argc, char *argv[]) { ...@@ -304,9 +306,6 @@ int loadMain (int argc, char *argv[]) {
if (SDL_NumJoysticks() > 0) SDL_JoystickOpen(0); if (SDL_NumJoysticks() > 0) SDL_JoystickOpen(0);
paletteEffects = NULL;
// Set up audio // Set up audio
openAudio(); openAudio();
...@@ -581,7 +580,7 @@ void freeMain () { ...@@ -581,7 +580,7 @@ void freeMain () {
} }
int loop (LoopType type) { int loop (LoopType type, PaletteEffect* paletteEffects) {
SDL_Event event; SDL_Event event;
int prevTicks, ret; int prevTicks, ret;
...@@ -592,7 +591,7 @@ int loop (LoopType type) { ...@@ -592,7 +591,7 @@ int loop (LoopType type) {
globalTicks = SDL_GetTicks(); globalTicks = SDL_GetTicks();
// Show what has been drawn // Show what has been drawn
video.flip(globalTicks - prevTicks); video.flip(globalTicks - prevTicks, paletteEffects);
// Process system events // Process system events
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include "io/gfx/font.h" #include "io/gfx/font.h"
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "io/sound.h" #include "io/sound.h"
#include "loop.h"
#include "util.h"
int Menu::newGameDifficulty (GameModeType mode, int levelNum, int worldNum) { int Menu::newGameDifficulty (GameModeType mode, int levelNum, int worldNum) {
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "level/level.h" #include "level/level.h"
#include "player/player.h" #include "player/player.h"
#include "scene/scene.h" #include "scene/scene.h"
#include "loop.h"
int Menu::main () { int Menu::main () {
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include "io/gfx/font.h" #include "io/gfx/font.h"
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "io/sound.h" #include "io/sound.h"
#include "loop.h"
#include "util.h"
#include <string.h> #include <string.h>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "io/sound.h" #include "io/sound.h"
#include "player/player.h" #include "player/player.h"
#include "loop.h"
int Menu::setupKeyboard () { int Menu::setupKeyboard () {
......
...@@ -31,11 +31,20 @@ ...@@ -31,11 +31,20 @@
#include "io/controls.h" #include "io/controls.h"
#include "io/file.h" #include "io/file.h"
#include "io/gfx/font.h"
#include "io/gfx/video.h"
#include "io/sound.h"
#include "loop.h"
#include "util.h"
#include <string.h>
Planet::Planet (char * fileName) {
Planet::Planet (char * fileName, int previous) {
File *file; File *file;
unsigned char *pixels;
int count;
try { try {
...@@ -47,7 +56,36 @@ Planet::Planet (char * fileName) { ...@@ -47,7 +56,36 @@ Planet::Planet (char * fileName) {
} }
// TODO: Load planet file id = file->loadShort();
if (id == previous) {
// Not approaching a planet if already there
delete file;
throw E_NONE;
}
// Load planet name
name = file->loadString();
// Lower-case the name
for (count = 0; name[count]; count++) {
if ((name[count] >= 65) && (name[count] <= 90)) name[count] += 32;
}
// Load the palette
file->loadPalette(palette, false);
// Load the planet image
pixels = file->loadBlock(64 * 55);
sprite.setPixels(pixels, 64, 55, 0);
delete[] pixels;
delete file; delete file;
...@@ -58,22 +96,50 @@ Planet::Planet (char * fileName) { ...@@ -58,22 +96,50 @@ Planet::Planet (char * fileName) {
Planet::~Planet () { Planet::~Planet () {
// Nothing to do delete[] name;
return; return;
} }
int Planet::getId () {
return id;
}
int Planet::play () { int Planet::play () {
unsigned int tickOffset;
tickOffset = globalTicks;
stopMusic();
video.setPalette(palette);
while (true) { while (true) {
if (loop(NORMAL_LOOP) == E_QUIT) return E_QUIT; if (loop(NORMAL_LOOP) == E_QUIT) return E_QUIT;
if (controls.release(C_ESCAPE)) return E_NONE; if (controls.release(C_ESCAPE)) return E_NONE;
// TODO: Display planet SDL_Delay(T_FRAME);
clearScreen(0);
if (globalTicks - tickOffset < F2)
sprite.drawScaled(canvasW >> 1, canvasH >> 1, globalTicks - tickOffset);
else if (globalTicks - tickOffset < F4)
sprite.drawScaled(canvasW >> 1, canvasH >> 1, F2);
else if (globalTicks - tickOffset < F4 + FQ)
sprite.drawScaled(canvasW >> 1, canvasH >> 1, (globalTicks - tickOffset - F4) * 32 + F2);
else return E_NONE;
fontmn1->showString("now approaching", (canvasW - 288) >> 1, 0);
fontmn1->showString(name, (canvasW - fontmn1->getStringWidth(name)) >> 1, canvasH - 24);
} }
......
...@@ -24,14 +24,26 @@ ...@@ -24,14 +24,26 @@
#define _PLANET_H #define _PLANET_H
#include "io/gfx/sprite.h"
#include <SDL/SDL.h>
// Class // Class
class Planet { class Planet {
private:
SDL_Color palette[256];
Sprite sprite;
char* name;
int id;
public: public:
Planet (char * fileName); Planet (char * fileName, int previous);
~Planet (); ~Planet ();
int getId ();
int play (); int play ();
}; };
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "io/sound.h" #include "io/sound.h"
#include "level/event/event.h" #include "level/event/event.h"
#include "level/level.h" #include "level/level.h"
#include "util.h"
#include <string.h> #include <string.h>
...@@ -407,7 +408,7 @@ bool Player::takeEvent (unsigned char gridX, unsigned char gridY, unsigned int t ...@@ -407,7 +408,7 @@ bool Player::takeEvent (unsigned char gridX, unsigned char gridY, unsigned int t
gem = true; gem = true;
// Yellow flash // Yellow flash
paletteEffects = new FlashPaletteEffect(255, 255, 0, 320, paletteEffects); level->flash(255, 255, 0, 320);
break; break;
...@@ -459,7 +460,7 @@ bool Player::touchEvent (unsigned char gridX, unsigned char gridY, unsigned int ...@@ -459,7 +460,7 @@ bool Player::touchEvent (unsigned char gridX, unsigned char gridY, unsigned int
warpTime = ticks + T_WARP; warpTime = ticks + T_WARP;
// White flash // White flash
paletteEffects = new FlashPaletteEffect(255, 255, 255, T_WARP, paletteEffects); level->flash(255, 255, 255, T_WARP);
} }
...@@ -594,7 +595,7 @@ void Player::kill (Player *source, unsigned int ticks) { ...@@ -594,7 +595,7 @@ void Player::kill (Player *source, unsigned int ticks) {
} }
if (!gameMode) paletteEffects = new FadeOutPaletteEffect(T_END, paletteEffects); if (!gameMode) level->flash(0, 0, 0, T_END << 1);
return; return;
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "level/bullet.h" #include "level/bullet.h"
#include "level/event/event.h" #include "level/event/event.h"
#include "level/level.h" #include "level/level.h"
#include "util.h"
void Player::control (unsigned int ticks, int msps) { void Player::control (unsigned int ticks, int msps) {
...@@ -731,7 +732,7 @@ void Player::view (unsigned int ticks, int mspf) { ...@@ -731,7 +732,7 @@ void Player::view (unsigned int ticks, int mspf) {
// Apply lag proportional to player "speed" // Apply lag proportional to player "speed"
speed = ((dx >= 0? dx: -dx) + (dy >= 0? dy: -dy)) >> 14; speed = ((dx >= 0? dx: -dx) + (dy >= 0? dy: -dy)) >> 14;
if (mspf < speed) { if (speed && (mspf < speed)) {
viewX = ((oldViewX * (speed - mspf)) + (viewX * mspf)) / speed; viewX = ((oldViewX * (speed - mspf)) + (viewX * mspf)) / speed;
viewY = ((oldViewY * (speed - mspf)) + (viewY * mspf)) / speed; viewY = ((oldViewY * (speed - mspf)) + (viewY * mspf)) / speed;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "io/gfx/paletteeffects.h" #include "io/gfx/paletteeffects.h"
#include "io/gfx/video.h" #include "io/gfx/video.h"
#include "io/sound.h" #include "io/sound.h"
#include "loop.h"
#include <string.h> #include <string.h>
...@@ -256,6 +257,7 @@ int Scene::play () { ...@@ -256,6 +257,7 @@ int Scene::play () {
SceneAnimation* animation = NULL; SceneAnimation* animation = NULL;
SceneFrame* currentFrame = NULL; SceneFrame* currentFrame = NULL;
SceneFrame* lastFrame = NULL; SceneFrame* lastFrame = NULL;
PaletteEffect* paletteEffect = NULL;
int frameDelay = 0; int frameDelay = 0;
int prevFrame = 0; int prevFrame = 0;
int continueToNextPage = 0; int continueToNextPage = 0;
...@@ -269,9 +271,21 @@ int Scene::play () { ...@@ -269,9 +271,21 @@ int Scene::play () {
while (true) { while (true) {
if (loop(NORMAL_LOOP) == E_QUIT) return E_QUIT; if (loop(NORMAL_LOOP, paletteEffect) == E_QUIT) {
if (controls.release(C_ESCAPE) || (controls.release(C_NO) && pages[sceneIndex].askForYesNo)) return E_NONE; if (paletteEffect) delete paletteEffect;
return E_QUIT;
}
if (controls.release(C_ESCAPE) || (controls.release(C_NO) && pages[sceneIndex].askForYesNo)) {
if (paletteEffect) delete paletteEffect;
return E_NONE;
}
SDL_Delay(T_FRAME); SDL_Delay(T_FRAME);
...@@ -298,7 +312,13 @@ int Scene::play () { ...@@ -298,7 +312,13 @@ int Scene::play () {
if (upOrLeft) sceneIndex--; if (upOrLeft) sceneIndex--;
else sceneIndex++; else sceneIndex++;
if (sceneIndex == scriptItems) return E_NONE; if (sceneIndex == scriptItems) {
if (paletteEffect) delete paletteEffect;
return E_NONE;
}
lastTicks = globalTicks; lastTicks = globalTicks;
// Get bg for this page // Get bg for this page
...@@ -310,7 +330,8 @@ int Scene::play () { ...@@ -310,7 +330,8 @@ int Scene::play () {
if (newpage) { if (newpage) {
//paletteEffects = new FadeOutPaletteEffect(250, paletteEffects); //if (paletteEffect) delete paletteEffect;
//paletteEffect = new FadeOutPaletteEffect(250, NULL);
textRect.x = 0; textRect.x = 0;
textRect.y = 0; textRect.y = 0;
...@@ -325,7 +346,8 @@ int Scene::play () { ...@@ -325,7 +346,8 @@ int Scene::play () {
video.setPalette(palette->palette); video.setPalette(palette->palette);
// Fade in from black // Fade in from black
paletteEffects = new FadeInPaletteEffect(250, paletteEffects); if (paletteEffect) delete paletteEffect;
paletteEffect = new FadeInPaletteEffect(250, NULL);
} }
......
...@@ -239,20 +239,11 @@ void Scene::loadAni (File *f, int dataIndex) { ...@@ -239,20 +239,11 @@ void Scene::loadAni (File *f, int dataIndex) {
int nextPos = f->tell(); int nextPos = f->tell();
LOG("PL Read position", pos); LOG("PL Read position", pos);
unsigned short int len = f->loadShort(); unsigned short int len = f->loadShort();
unsigned char* buffer = f->loadBlock(len);
palettes = new ScenePalette(palettes); palettes = new ScenePalette(palettes);
for (int count = 0; count < 256; count++) { f->loadPalette(palettes->palette, false);
// Palette entries are 6-bit
// Shift them upwards to 8-bit, and fill in the lower 2 bits
palettes->palette[count].r = (buffer[count * 3] << 2) + (buffer[count * 3] >> 4);
palettes->palette[count].g = (buffer[(count * 3) + 1] << 2) + (buffer[(count * 3) + 1] >> 4);
palettes->palette[count].b = (buffer[(count * 3) + 2] << 2) + (buffer[(count * 3) + 2] >> 4);
}
delete[] buffer;
palettes->id = dataIndex; palettes->id = dataIndex;
unsigned short int value = 0; unsigned short int value = 0;
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
*/ */
#include "util.h"
#include "io/file.h" #include "io/file.h"
#include <string.h> #include <string.h>
......
/*
*
* util.h
*
* 30th April 2010: Created util.h from parts of OpenJazz.h
*
* Part of the OpenJazz project
*
*
* Copyright (c) 2005-2010 Alister Thomson
*
* OpenJazz is distributed under the terms of
* the GNU General Public License, version 2.0
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _UTIL_H
#define _UTIL_H
#include "OpenJazz.h"
// Variable
// Trigonometric function look-up table
EXTERN fixed sinLut[1024];
// Functions
EXTERN bool fileExists (const char *fileName);
EXTERN char * createString (const char *string);
EXTERN char * createString (const char *first, const char *second);
EXTERN char * createFileName (const char *type, int extension);
EXTERN char * createFileName (const char *type, const char *extension);
EXTERN char * createFileName (const char *type, int level, int extension);
EXTERN char * createEditableString (const char *string);
EXTERN void log (const char *message);
EXTERN void log (const char *message, const char *detail);
EXTERN void log (const char *message, int number);
EXTERN void logError (const char *message, const char *detail);
EXTERN fixed fSin (fixed angle);
EXTERN fixed fCos (fixed angle);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment