From 3c6f9393aa657d8b8e52452a01da78d79dcc4edd Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 21 Oct 2011 21:58:09 -0400
Subject: [PATCH] We don't do pixel operations anymore. Yay! :)
---
init.cpp | 28 +++++++++++++-------------
screenlib/Makefile.am | 4 +---
screenlib/pixel.cpp | 47 -------------------------------------------
screenlib/pixel.h | 33 ------------------------------
4 files changed, 15 insertions(+), 97 deletions(-)
delete mode 100644 screenlib/pixel.cpp
delete mode 100644 screenlib/pixel.h
diff --git a/init.cpp b/init.cpp
index 3fe7a931..a55b5d72 100644
--- a/init.cpp
+++ b/init.cpp
@@ -752,20 +752,6 @@ int DoInitializations(Uint32 video_flags)
}
#endif
- /* Load the Font Server */
- fontserv = new FontServ(screen, "Maelstrom Fonts");
- if ( fontserv->Error() ) {
- error("Fatal: %s\n", fontserv->Error());
- return(-1);
- }
-
- /* Load the Sound Server and initialize sound */
- sound = new Sound("Maelstrom Sounds", gSoundLevel);
- if ( sound->Error() ) {
- error("Fatal: %s\n", sound->Error());
- return(-1);
- }
-
/* Load the Maelstrom icon */
icon = SDL_LoadBMP_RW(PHYSFSRWOPS_openRead("icon.bmp"), 1);
if ( icon == NULL ) {
@@ -784,6 +770,20 @@ int DoInitializations(Uint32 video_flags)
atexit(CleanUp); // Need to reset this under X11 DGA
SDL_FreeSurface(icon);
+ /* Load the Font Server */
+ fontserv = new FontServ(screen, "Maelstrom Fonts");
+ if ( fontserv->Error() ) {
+ error("Fatal: %s\n", fontserv->Error());
+ return(-1);
+ }
+
+ /* Load the Sound Server and initialize sound */
+ sound = new Sound("Maelstrom Sounds", gSoundLevel);
+ if ( sound->Error() ) {
+ error("Fatal: %s\n", sound->Error());
+ return(-1);
+ }
+
/* -- We want to access the FULL screen! */
SetRect(&gScrnRect, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
gStatusLine = (gScrnRect.bottom - gScrnRect.top - STATUS_HEIGHT);
diff --git a/screenlib/Makefile.am b/screenlib/Makefile.am
index 71cf13c9..3c5ce620 100644
--- a/screenlib/Makefile.am
+++ b/screenlib/Makefile.am
@@ -3,6 +3,4 @@ noinst_LIBRARIES = libSDLscreen.a
libSDLscreen_a_SOURCES = \
SDL_FrameBuf.cpp \
- SDL_FrameBuf.h \
- pixel.cpp \
- pixel.h
+ SDL_FrameBuf.h
diff --git a/screenlib/pixel.cpp b/screenlib/pixel.cpp
deleted file mode 100644
index aaf622ce..00000000
--- a/screenlib/pixel.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- SCREENLIB: A framebuffer library based on the SDL library
- Copyright (C) 1997 Sam Lantinga
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- 5635-34 Springhouse Dr.
- Pleasanton, CA 94588 (USA)
- slouken@devolution.com
-*/
-
-#include "SDL.h"
-#include "pixel.h"
-
-void PutPixel1(Uint8 *screen_loc, SDL_Surface *screen, Uint32 pixel) {
- *((Uint8 *)screen_loc) = pixel;
-}
-void PutPixel2(Uint8 *screen_loc, SDL_Surface *screen, Uint32 pixel) {
- *((Uint16 *)screen_loc) = pixel;
-}
-void PutPixel3(Uint8 *screen_loc, SDL_Surface *screen, Uint32 pixel) {
- int shift;
-
- /* Gack - slow, but endian correct */
- shift = screen->format->Rshift;
- *(screen_loc+shift/8) = pixel>>shift;
- shift = screen->format->Gshift;
- *(screen_loc+shift/8) = pixel>>shift;
- shift = screen->format->Bshift;
- *(screen_loc+shift/8) = pixel>>shift;
-}
-void PutPixel4(Uint8 *screen_loc, SDL_Surface *screen, Uint32 pixel) {
- *((Uint32 *)screen_loc) = pixel;
-}
diff --git a/screenlib/pixel.h b/screenlib/pixel.h
deleted file mode 100644
index 2d1c49cc..00000000
--- a/screenlib/pixel.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SCREENLIB: A framebuffer library based on the SDL library
- Copyright (C) 1997 Sam Lantinga
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- 5635-34 Springhouse Dr.
- Pleasanton, CA 94588 (USA)
- slouken@devolution.com
-*/
-
-#ifndef _pixel_h
-#define _pixel_h
-
-extern void PutPixel1(Uint8 *screen_loc, SDL_Surface *screen, Uint32 pixel);
-extern void PutPixel2(Uint8 *screen_loc, SDL_Surface *screen, Uint32 pixel);
-extern void PutPixel3(Uint8 *screen_loc, SDL_Surface *screen, Uint32 pixel);
-extern void PutPixel4(Uint8 *screen_loc, SDL_Surface *screen, Uint32 pixel);
-
-#endif /* _pixel_h */