Commit aa0e3710 authored by Steven Fuller's avatar Steven Fuller

Moved some functions around

parent 5ca1ed61
...@@ -20,6 +20,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -20,6 +20,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "wolfdef.h" #include "wolfdef.h"
/*
Utility functions
*/
unsigned short int sMSB(unsigned short int x)
{
int x1 = (x & 0x00FF) << 8;
int x2 = (x & 0xFF00) >> 8;
return x1 | x2;
}
unsigned long lMSB(unsigned long x)
{
int x1 = (x & 0x000000FF) << 24;
int x2 = (x & 0x0000FF00) << 8;
int x3 = (x & 0x00FF0000) >> 8;
int x4 = (x & 0xFF000000) >> 24;
return x1 | x2 | x3 | x4;
}
/*
Save and load save games
These functions must be updated if the saved structures are ever changed!
*/
Boolean SaveGame(char *file) Boolean SaveGame(char *file)
{ {
return FALSE; return FALSE;
...@@ -29,3 +56,47 @@ Boolean LoadGame(char *file) ...@@ -29,3 +56,47 @@ Boolean LoadGame(char *file)
{ {
return FALSE; return FALSE;
} }
void FinishLoadGame(void)
{
}
/*
Load initial game data
*/
void FixMapList(maplist_t *m)
{
int i;
m->MaxMap = sMSB(m->MaxMap);
m->MapRezNum = sMSB(m->MapRezNum);
for (i = 0; i < m->MaxMap; i++) {
m->InfoArray[i].NextLevel = sMSB(m->InfoArray[i].NextLevel);
m->InfoArray[i].SecretLevel = sMSB(m->InfoArray[i].SecretLevel);
m->InfoArray[i].ParTime = sMSB(m->InfoArray[i].ParTime);
m->InfoArray[i].ScenarioNum = sMSB(m->InfoArray[i].ScenarioNum);
m->InfoArray[i].FloorNum = sMSB(m->InfoArray[i].FloorNum);
}
}
void InitData()
{
/*
InitSoundMusicSystem(8,8,5, 11025);
SoundListPtr = (Word *) LoadAResource(MySoundList);
RegisterSounds(SoundListPtr,FALSE);
ReleaseAResource(MySoundList);
*/
GetTableMemory();
MapListPtr = (maplist_t *)LoadAResource(rMapList);
FixMapList(MapListPtr);
SongListPtr = (unsigned short *)LoadAResource(rSongList);
WallListPtr = (unsigned short *)LoadAResource(MyWallList);
}
...@@ -30,6 +30,36 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -30,6 +30,36 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
LongWord pow10[] = {1,10,100,1000,10000,100000,1000000}; LongWord pow10[] = {1,10,100,1000,10000,100000,1000000};
Word NumberIndex = 36; /* First number in the shape list... */ Word NumberIndex = 36; /* First number in the shape list... */
extern int VidSize;
Word ScaleX(Word x)
{
switch(VidSize) {
case 1:
return x*8/5;
case 2:
case 3:
return x*2;
}
return x;
}
Word ScaleY(Word y)
{
switch(VidSize) {
case 1:
y = (y*8/5)+64;
if (y == 217)
y++;
return y;
case 2:
return y*2;
case 3:
return y*2+80;
}
return y;
}
void SetNumber(LongWord number,Word x,Word y,Word digits) void SetNumber(LongWord number,Word x,Word y,Word digits)
{ {
LongWord val; LongWord val;
......
...@@ -56,6 +56,8 @@ TODO: ...@@ -56,6 +56,8 @@ TODO:
* Mouse * Mouse
* Psyched bar * Psyched bar
* Finish GTK+ code * Finish GTK+ code
* vi_glx.c will probably be the most updated of the frontends. Be sure to
update the others later.
BUGS: BUGS:
* Software Drawing seems like its imprecise, stationary sprites move back and * Software Drawing seems like its imprecise, stationary sprites move back and
...@@ -66,15 +68,15 @@ BUGS: ...@@ -66,15 +68,15 @@ BUGS:
IDEAS: IDEAS:
* Menu Keys * Menu Keys
- ESC: Quit - ESC: Quit (?)
- F1: Help - F1: Help
- XXX: Load Game - F2: Save Game
- F3: Load Game
- F4: Options
- XXX: Load Previously Loaded Game - XXX: Load Previously Loaded Game
- XXX: Save Game
- XXX: Save Game to Previously used File - XXX: Save Game to Previously used File
- XXX: Options - F10: Quit
* How about adding red/white shifts (from PC wolf3d)? So screen changes * How about adding red/white shifts (from PC wolf3d)? So screen changes
color when you are hit or pick up items. color when you are hit or pick up items.
* when saving/loading games, run them through htons/etc.
MISC: MISC:
...@@ -81,90 +81,6 @@ void PrintTimeCounter(TimeCounter *t, char *header) ...@@ -81,90 +81,6 @@ void PrintTimeCounter(TimeCounter *t, char *header)
printf("Min: %lu, max:%lu\n", t->mintime, t->maxtime); printf("Min: %lu, max:%lu\n", t->mintime, t->maxtime);
} }
unsigned short int sMSB(unsigned short int x)
{
int x1 = (x & 0x00FF) << 8;
int x2 = (x & 0xFF00) >> 8;
return x1 | x2;
}
unsigned long lMSB(unsigned long x)
{
int x1 = (x & 0x000000FF) << 24;
int x2 = (x & 0x0000FF00) << 8;
int x3 = (x & 0x00FF0000) >> 8;
int x4 = (x & 0xFF000000) >> 24;
return x1 | x2 | x3 | x4;
}
void FixMapList(maplist_t *m)
{
int i;
m->MaxMap = sMSB(m->MaxMap);
m->MapRezNum = sMSB(m->MapRezNum);
for (i = 0; i < m->MaxMap; i++) {
m->InfoArray[i].NextLevel = sMSB(m->InfoArray[i].NextLevel);
m->InfoArray[i].SecretLevel = sMSB(m->InfoArray[i].SecretLevel);
m->InfoArray[i].ParTime = sMSB(m->InfoArray[i].ParTime);
m->InfoArray[i].ScenarioNum = sMSB(m->InfoArray[i].ScenarioNum);
m->InfoArray[i].FloorNum = sMSB(m->InfoArray[i].FloorNum);
}
}
void InitData()
{
/*
InitSoundMusicSystem(8,8,5, 11025);
SoundListPtr = (Word *) LoadAResource(MySoundList);
RegisterSounds(SoundListPtr,FALSE);
ReleaseAResource(MySoundList);
*/
GetTableMemory();
MapListPtr = (maplist_t *) LoadAResource(rMapList);
FixMapList(MapListPtr);
SongListPtr = (unsigned short *)LoadAResource(rSongList);
WallListPtr = (unsigned short *)LoadAResource(MyWallList);
}
extern int VidSize;
Word ScaleX(Word x)
{
switch(VidSize) {
case 1:
return x*8/5;
case 2:
case 3:
return x*2;
}
return x;
}
Word ScaleY(Word y)
{
switch(VidSize) {
case 1:
y = (y*8/5)+64;
if (y == 217)
y++;
return y;
case 2:
return y*2;
case 3:
return y*2+80;
}
return y;
}
Boolean SetupScalers() Boolean SetupScalers()
{ {
return TRUE; return TRUE;
...@@ -291,7 +207,3 @@ Word WaitTicksEvent(Word Time) ...@@ -291,7 +207,3 @@ Word WaitTicksEvent(Word Time)
} }
return RetVal; return RetVal;
} }
void FinishLoadGame(void)
{
}
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