Commit 39c8e8d7 authored by alistert's avatar alistert

Applied Pickle's GP2X/Wiz patch.

parent 59165d12
......@@ -27,7 +27,7 @@
#include "controls.h"
#ifdef WIZ
#if defined(WIZ) || defined(GP2X)
#include "platforms/wiz.h"
#endif
......@@ -53,7 +53,7 @@ Controls::Controls () {
keys[C_STATS].key = SDLK_F9;
keys[C_PAUSE].key = SDLK_p;
#ifdef WIZ
#if defined(WIZ) || defined(GP2X)
buttons[C_UP].button = GP2X_BUTTON_UP;
buttons[C_DOWN].button = GP2X_BUTTON_DOWN;
buttons[C_LEFT].button = GP2X_BUTTON_LEFT;
......
......@@ -61,15 +61,14 @@ SDL_Surface * createSurface (unsigned char * pixels, int width, int height) {
void createFullscreen () {
SDL_ShowCursor(SDL_DISABLE);
#ifdef WIZ
screen = SDL_SetVideoMode(screenW, screenH, 8,
#if defined(WIZ) || defined(GP2X)
screen = SDL_SetVideoMode(320, 240, 8,
SDL_FULLSCREEN | SDL_SWSURFACE | SDL_HWPALETTE);
#else
screen = SDL_SetVideoMode(screenW, screenH, 8,
SDL_FULLSCREEN | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE);
#endif
SDL_ShowCursor(SDL_DISABLE);
SDL_SetPalette(screen, SDL_LOGPAL, logicalPalette, 0, 256);
SDL_SetPalette(screen, SDL_PHYSPAL, currentPalette, 0, 256);
......
......@@ -48,10 +48,15 @@ ModPlugFile *musicFile;
#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
SDL_AudioSpec audioSpec;
......
......@@ -47,7 +47,7 @@
#include <string.h>
#ifdef WIZ
#if defined(WIZ) || defined(GP2X)
#include "platforms/wiz.h"
extern int volume;
extern int volume_direction;
......@@ -570,7 +570,7 @@ int loop (int type) {
}
#endif
#ifdef WIZ
#if defined(WIZ) || defined(GP2X)
SDL_ShowCursor(SDL_DISABLE);
#endif
// Break statement intentionally omitted
......@@ -584,7 +584,7 @@ int loop (int type) {
if (ret != E_NONE) return ret;
#ifdef WIZ
#if defined(WIZ) || defined(GP2X)
if (event.jbutton.button == GP2X_BUTTON_VOLUP ) {
if( event.type == SDL_JOYBUTTONDOWN )
volume_direction = VOLUME_UP;
......@@ -655,7 +655,7 @@ int loop (int type) {
}
#ifdef WIZ
#if defined(WIZ) || defined(GP2X)
WIZ_AdjustVolume( volume_direction );
#endif
......
......@@ -258,8 +258,6 @@ int Menu::setupJoystick () {
int Menu::setupResolution () {
#ifndef FULLSCREEN_ONLY
int widthOptions[] = {320, 400, 512, 640, 720, 768, 800, 960, 1024, 1152,
1280, 1440, 1600, 1920};
int heightOptions[] = {200, 240, 300, 384, 400, 480, 576, 600, 720, 768,
......@@ -269,20 +267,25 @@ int Menu::setupResolution () {
dimension = 0;
if (fullscreen)
#ifndef FULLSCREEN_ONLY
if (!fullscreen)
resolutions = SDL_ListModes(NULL,
SDL_FULLSCREEN | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE);
SDL_RESIZABLE | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE);
else
#endif
resolutions = SDL_ListModes(NULL,
SDL_RESIZABLE | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE);
SDL_FULLSCREEN | SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE);
#if defined(WIZ) || defined(GP2X)
maxW = 320;
maxH = 240;
#else
if (resolutions == (SDL_Rect **)(-1)) {
maxW = 1920;
maxH = 1200;
} else {
maxW = 320;
maxH = 200;
......@@ -292,8 +295,8 @@ int Menu::setupResolution () {
if (resolutions[count]->h > maxH) maxH = resolutions[count]->h;
}
}
#endif
while (true) {
......@@ -386,15 +389,19 @@ int Menu::setupResolution () {
playSound(S_ORB);
if (fullscreen) createFullscreen();
else createWindow();
#ifndef FULLSCREEN_ONLY
if (!fullscreen)
{
createWindow();
}
else
#endif
createFullscreen();
}
}
#endif
return E_NONE;
}
......@@ -461,9 +468,9 @@ int Menu::setup () {
break;
case 1:
#if !defined(WIZ) && !defined(GP2X)
setupKeyboard();
#endif
break;
case 2:
......
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