extern float screenwidth, screenheight;
extern float viewdistance;
extern XYZ viewer;
-extern XYZ lightlocation;
extern float fadestart;
extern float texscale;
extern float gravity;
extern Light light;
-extern Skeleton testskeleton;
-extern int numsounds;
extern Terrain terrain;
-//extern Sprites sprites;
extern int kTextureSize;
extern float texdetail;
extern float realtexdetail;
extern int netdatanew;
extern float mapinfo;
extern bool stillloading;
-extern ImageRec texture;
-extern short vRefNum;
-extern long dirID;
extern int mainmenu;
extern bool visibleloading;
extern float flashamount, flashr, flashg, flashb;
extern int whichjointstartarray[26];
extern int whichjointendarray[26];
extern int difficulty;
-extern float tintr, tintg, tintb;
extern float slomospeed;
extern bool gamestarted;
-extern int numdialogues;
-extern int numdialogueboxes[20];
-extern int dialoguetype[20];
-extern int dialogueboxlocation[20][20];
-extern float dialogueboxcolor[20][20][3];
-extern int dialogueboxsound[20][20];
-extern char dialoguetext[20][20][128];
-extern char dialoguename[20][20][64];
-extern XYZ dialoguecamera[20][20];
-extern float dialoguecamerayaw[20][20];
-extern float dialoguecamerapitch[20][20];
-extern int indialogue;
-extern int whichdialogue;
-extern float dialoguetime;
-
extern float accountcampaignhighscore[10];
extern float accountcampaignfasttime[10];
extern float accountcampaignscore[10];
}
OPENAL_Close();
- if (texture.data) {
- free(texture.data);
- }
- texture.data = 0;
#endif
}
texdetail = 1;
//Load Image
- upload_image(ConvertFileName(fileName));
+ ImageRec texture;
+ load_image(ConvertFileName(fileName), texture);
texdetail = temptexdetail;
int bytesPerPixel = texture.bpp / 8;
swap_gl_buffers();
}
-
-extern bool cmdline(const char *cmd);
-
void Game::InitGame()
{
LOGFUNC;
accountactive = Account::loadFile(":Data:Users");
- tintr = 1;
- tintg = 1;
- tintb = 1;
-
whichjointstartarray[0] = righthip;
whichjointendarray[0] = rightfoot;
stillloading = 1;
- texture.data = ( GLubyte* )malloc( 1024 * 1024 * 4 );
-
int temptexdetail = texdetail;
texdetail = 1;
text->LoadFontTexture(":Data:Textures:Font.png");
#if PLATFORM_LINUX
unsigned char rc = 0;
int output = OPENAL_OUTPUT_ALSA; // Try alsa first...
- if (cmdline("forceoss")) // ...but let user override that.
- output = OPENAL_OUTPUT_OSS;
- else if (cmdline("nosound"))
- output = OPENAL_OUTPUT_NOSOUND;
+ if (commandLineOptions[SOUND]) {
+ output = commandLineOptions[SOUND].last()->type(); // ...but let user override that.
+ }
OPENAL_SetOutput(output);
if ((rc = OPENAL_Init(44100, 32, 0)) == false) {
// if we tried ALSA and failed, fall back to OSS.
- if ( (output == OPENAL_OUTPUT_ALSA) && (!cmdline("forcealsa")) ) {
+ if ( (output == OPENAL_OUTPUT_ALSA) && (commandLineOptions[SOUND].last()->type() != OPENAL_OUTPUT_ALSA) ) {
OPENAL_Close();
output = OPENAL_OUTPUT_OSS;
OPENAL_SetOutput(output);
if (musictoggle)
emit_stream_np(stream_menutheme);
- cursortexture.load(":Data:Textures:Cursor.png", 0, 1);
+ cursortexture.load(":Data:Textures:Cursor.png", 0);
- Mapcircletexture.load(":Data:Textures:MapCircle.png", 0, 1);
- Mapboxtexture.load(":Data:Textures:MapBox.png", 0, 1);
- Maparrowtexture.load(":Data:Textures:MapArrow.png", 0, 1);
+ Mapcircletexture.load(":Data:Textures:MapCircle.png", 0);
+ Mapboxtexture.load(":Data:Textures:MapBox.png", 0);
+ Maparrowtexture.load(":Data:Textures:MapArrow.png", 0);
temptexdetail = texdetail;
if (texdetail > 2)
texdetail = 2;
- Mainmenuitems[0].load(":Data:Textures:Lugaru.png", 0, 0);
- Mainmenuitems[1].load(":Data:Textures:Newgame.png", 0, 0);
- Mainmenuitems[2].load(":Data:Textures:Options.png", 0, 0);
- Mainmenuitems[3].load(":Data:Textures:Quit.png", 0, 0);
- Mainmenuitems[4].load(":Data:Textures:Eyelid.png", 0, 1);
- Mainmenuitems[5].load(":Data:Textures:Resume.png", 0, 0);
- Mainmenuitems[6].load(":Data:Textures:Endgame.png", 0, 0);
-
- //LoadTexture(":Data:Textures:Eye.jpg",&Mainmenuitems[5],0,1);
- //~ LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0); // LoadCampaign will take care of that
+ Mainmenuitems[0].load(":Data:Textures:Lugaru.png", 0);
+ Mainmenuitems[1].load(":Data:Textures:Newgame.png", 0);
+ Mainmenuitems[2].load(":Data:Textures:Options.png", 0);
+ Mainmenuitems[3].load(":Data:Textures:Quit.png", 0);
+ Mainmenuitems[4].load(":Data:Textures:Eyelid.png", 0);
+ Mainmenuitems[5].load(":Data:Textures:Resume.png", 0);
+ Mainmenuitems[6].load(":Data:Textures:Endgame.png", 0);
+
texdetail = temptexdetail;
FadeLoadingScreen(95);
i = abs(Random() % 4);
visibleloading = 0; //don't use loadscreentexture yet
- loadscreentexture.load(":Data:Textures:fire.jpg", 1, 0);
+ loadscreentexture.load(":Data:Textures:fire.jpg", 1);
visibleloading = 1;
temptexdetail = texdetail;
text->BuildFont();
texdetail = temptexdetail;
- numsounds = 71;
-
viewdistdetail = 2;
viewdistance = 50 * megascale * viewdistdetail;
LOG("Loading weapon data...");
- Weapon::knifetextureptr.load(":Data:Textures:knife.png", 0, 1);
- Weapon::bloodknifetextureptr.load(":Data:Textures:bloodknife.png", 0, 1);
- Weapon::lightbloodknifetextureptr.load(":Data:Textures:lightbloodknife.png", 0, 1);
- Weapon::swordtextureptr.load(":Data:Textures:sword.jpg", 1, 0);
- Weapon::bloodswordtextureptr.load(":Data:Textures:Swordblood.jpg", 1, 0);
- Weapon::lightbloodswordtextureptr.load(":Data:Textures:Swordbloodlight.jpg", 1, 0);
- Weapon::stafftextureptr.load(":Data:Textures:Staff.jpg", 1, 0);
+ Weapon::knifetextureptr.load(":Data:Textures:knife.png", 0);
+ Weapon::bloodknifetextureptr.load(":Data:Textures:bloodknife.png", 0);
+ Weapon::lightbloodknifetextureptr.load(":Data:Textures:lightbloodknife.png", 0);
+ Weapon::swordtextureptr.load(":Data:Textures:sword.jpg", 1);
+ Weapon::bloodswordtextureptr.load(":Data:Textures:Swordblood.jpg", 1);
+ Weapon::lightbloodswordtextureptr.load(":Data:Textures:Swordbloodlight.jpg", 1);
+ Weapon::stafftextureptr.load(":Data:Textures:Staff.jpg", 1);
Weapon::throwingknifemodel.load((char *)":Data:Models:throwingknife.solid", 1);
Weapon::throwingknifemodel.Scale(.001, .001, .001);
- //Weapon::throwingknifemodel.Rotate(0,0,-90);
Weapon::throwingknifemodel.Rotate(90, 0, 0);
Weapon::throwingknifemodel.Rotate(0, 90, 0);
Weapon::throwingknifemodel.flat = 0;
Weapon::throwingknifemodel.CalculateNormals(1);
- //Weapon::throwingknifemodel.ScaleNormals(-1,-1,-1);
Weapon::swordmodel.load((char *)":Data:Models:sword.solid", 1);
Weapon::swordmodel.Scale(.001, .001, .001);
- //Weapon::swordmodel.Rotate(0,0,-90);
Weapon::swordmodel.Rotate(90, 0, 0);
Weapon::swordmodel.Rotate(0, 90, 0);
Weapon::swordmodel.Rotate(0, 0, 90);
Weapon::swordmodel.flat = 1;
Weapon::swordmodel.CalculateNormals(1);
- //Weapon::swordmodel.ScaleNormals(-1,-1,-1);
Weapon::staffmodel.load((char *)":Data:Models:staff.solid", 1);
Weapon::staffmodel.Scale(.005, .005, .005);
- //Weapon::staffmodel.Rotate(0,0,-90);
Weapon::staffmodel.Rotate(90, 0, 0);
Weapon::staffmodel.Rotate(0, 90, 0);
Weapon::staffmodel.Rotate(0, 0, 90);
Weapon::staffmodel.flat = 1;
Weapon::staffmodel.CalculateNormals(1);
- //Weapon::staffmodel.ScaleNormals(-1,-1,-1);
-
- terrain.shadowtexture.load(":Data:Textures:shadow.png", 0, 1);
- terrain.bloodtexture.load(":Data:Textures:blood.png", 0, 1);
- terrain.breaktexture.load(":Data:Textures:break.png", 0, 1);
- terrain.bloodtexture2.load(":Data:Textures:blood.png", 0, 1);
-
-
- terrain.footprinttexture.load(":Data:Textures:footprint.png", 0, 1);
- terrain.bodyprinttexture.load(":Data:Textures:bodyprint.png", 0, 1);
- hawktexture.load(":Data:Textures:hawk.png", 0, 1);
-
-
- Sprite::cloudtexture.load(":Data:Textures:cloud.png", 1, 1);
- Sprite::cloudimpacttexture.load(":Data:Textures:cloudimpact.png", 1, 1);
- Sprite::bloodtexture.load(":Data:Textures:bloodparticle.png", 1, 1);
- Sprite::snowflaketexture.load(":Data:Textures:snowflake.png", 1, 1);
- Sprite::flametexture.load(":Data:Textures:flame.png", 1, 1);
- Sprite::bloodflametexture.load(":Data:Textures:bloodflame.png", 1, 1);
- Sprite::smoketexture.load(":Data:Textures:smoke.png", 1, 1);
- Sprite::shinetexture.load(":Data:Textures:shine.png", 1, 0);
- Sprite::splintertexture.load(":Data:Textures:splinter.png", 1, 1);
- Sprite::leaftexture.load(":Data:Textures:leaf.png", 1, 1);
- Sprite::toothtexture.load(":Data:Textures:tooth.png", 1, 1);
+
+ terrain.shadowtexture.load(":Data:Textures:shadow.png", 0);
+ terrain.bloodtexture.load(":Data:Textures:blood.png", 0);
+ terrain.breaktexture.load(":Data:Textures:break.png", 0);
+ terrain.bloodtexture2.load(":Data:Textures:blood.png", 0);
+
+
+ terrain.footprinttexture.load(":Data:Textures:footprint.png", 0);
+ terrain.bodyprinttexture.load(":Data:Textures:bodyprint.png", 0);
+ hawktexture.load(":Data:Textures:hawk.png", 0);
+
+
+ Sprite::cloudtexture.load(":Data:Textures:cloud.png", 1);
+ Sprite::cloudimpacttexture.load(":Data:Textures:cloudimpact.png", 1);
+ Sprite::bloodtexture.load(":Data:Textures:bloodparticle.png", 1);
+ Sprite::snowflaketexture.load(":Data:Textures:snowflake.png", 1);
+ Sprite::flametexture.load(":Data:Textures:flame.png", 1);
+ Sprite::bloodflametexture.load(":Data:Textures:bloodflame.png", 1);
+ Sprite::smoketexture.load(":Data:Textures:smoke.png", 1);
+ Sprite::shinetexture.load(":Data:Textures:shine.png", 1);
+ Sprite::splintertexture.load(":Data:Textures:splinter.png", 1);
+ Sprite::leaftexture.load(":Data:Textures:leaf.png", 1);
+ Sprite::toothtexture.load(":Data:Textures:tooth.png", 1);
yaw = 0;
pitch = 0;