Changed to standard C++ getenv/putenv calls instead of SDL-specific

ones (reported to not compile by Alex, the GP2X maintainer).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1156 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-11-27 02:18:47 +00:00
parent 563ba6b24b
commit 9fa5ea44ab
2 changed files with 12 additions and 12 deletions

View File

@ -13,10 +13,11 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: mainSDL.cxx,v 1.67 2006-11-13 00:21:40 stephena Exp $
// $Id: mainSDL.cxx,v 1.68 2006-11-27 02:18:46 stephena Exp $
//============================================================================
#include <SDL.h>
#include <cstdlib>
#include "bspf.hxx"
#include "Console.hxx"
@ -88,7 +89,7 @@ int main(int argc, char* argv[])
// Get the base directory for storing all Stella settings/statefiles/etc
// This can't be stored in the actual settings file for obvious reasons,
// so we get it from an environment var (if it exists)
const char* bd_ptr = SDL_getenv("STELLA_BASEDIR");
const char* bd_ptr = getenv("STELLA_BASEDIR");
const string& basedir = bd_ptr ? string(bd_ptr) : "";
// Create the parent OSystem object and settings
@ -142,7 +143,7 @@ int main(int argc, char* argv[])
// Request that the SDL window be centered, if possible
// At some point, this should be properly integrated into the UI
if(theOSystem->settings().getBool("center"))
SDL_putenv("SDL_VIDEO_CENTERED=1");
putenv("SDL_VIDEO_CENTERED=1");
//// Main loop ////
// First we check if a ROM is specified on the commandline. If so, and if

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Console.cxx,v 1.101 2006-11-25 01:34:34 stephena Exp $
// $Id: Console.cxx,v 1.102 2006-11-27 02:18:47 stephena Exp $
//============================================================================
#include <assert.h>
@ -297,12 +297,12 @@ void Console::togglePalette()
if(palette == "standard") // switch to original
{
palette = "original";
message = "Original Stella colors";
message = "Original Stella palette";
}
else if(palette == "original") // switch to z26
{
palette = "z26";
message = "Z26 colors";
message = "Z26 palette";
}
else if(palette == "z26") // switch to user or standard
{
@ -311,23 +311,23 @@ void Console::togglePalette()
if(myUserPaletteDefined)
{
palette = "user";
message = "User-defined Stella colors";
message = "User-defined palette";
}
else
{
palette = "standard";
message = "Standard Stella colors";
message = "Standard Stella palette";
}
}
else if(palette == "user") // switch to standard
{
palette = "standard";
message = "Standard Stella colors";
message = "Standard Stella palette";
}
else // switch to standard mode if we get this far
{
palette = "standard";
message = "Standard Stella colors";
message = "Standard Stella palette";
}
myOSystem->settings().setString("palette", palette);
@ -379,7 +379,6 @@ void Console::togglePhosphor()
}
myOSystem->frameBuffer().enablePhosphor(enable, blend);
// setPalette();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -798,7 +797,7 @@ void Console::loadUserPalette()
// Now that we have valid data, create the user-defined buffers
ourUserNTSCPalette = new uInt32[256];
ourUserPALPalette = new uInt32[256];
uInt8 pixbuf[3]; // Temporary buffer for a palette
uInt8 pixbuf[3]; // Temporary buffer for one 24-bit pixel
for(int i = 0; i < 128; i++) // NTSC palette
{