[Fix] Fixed grep|sed screwup.
This commit is contained in:
parent
a23d2c7810
commit
b7cfc2bac2
@ -201,7 +201,7 @@
|
||||
<general>
|
||||
<prodfactor>0.8</prodfactor>
|
||||
<bar>The Tau Prime algae has a very strong stench which seems to envelope the bar completely. The smell is so strong you can actually taste it. It doesn't taste nearly as good unprocessed. Most algae runners stop to grab drinks between runs to try to get the taste of the algae out of their mouth, although the usually use liquor made out of processed algae to do that.</bar>
|
||||
<description>Tau Station was constructed with the sole purpose of exploiting the algae produced on Tau Prime. Being a completely watery algae world with a very corrosive environment, it was deemed more profitable to build a space station then a city on the planet surface. From the station linux you can see heavy algae collectors flying to and from the surface on their endless algae runs.</description>
|
||||
<description>Tau Station was constructed with the sole purpose of exploiting the algae produced on Tau Prime. Being a completely watery algae world with a very corrosive environment, it was deemed more profitable to build a space station then a city on the planet surface. From the station windows you can see heavy algae collectors flying to and from the surface on their endless algae runs.</description>
|
||||
<faction>Empire</faction>
|
||||
<commodities>
|
||||
<commodity>Food</commodity>
|
||||
|
@ -89,7 +89,7 @@ static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {
|
||||
** =======================================================================
|
||||
*/
|
||||
|
||||
#include <linux.h>
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
#undef setprogdir
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* @brief Handle read/write abstractions to the users directory.
|
||||
*
|
||||
* @todo Add support for linux and mac OS.
|
||||
* @todo Add support for windows and mac OS.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
110
src/toolkit.c
110
src/toolkit.c
@ -140,9 +140,9 @@ static unsigned int genwid = 0; /* Generate unique id > 0. */
|
||||
int toolkit = 0;
|
||||
|
||||
#define MIN_WINDOWS 3
|
||||
static Window* linux = NULL;
|
||||
static int nlinux = 0;
|
||||
static int mlinux = 0;
|
||||
static Window* windows = NULL;
|
||||
static int nwindows = 0;
|
||||
static int mwindows = 0;
|
||||
|
||||
/* Default outline colours. */
|
||||
static glColour* toolkit_colLight = &cGrey90;
|
||||
@ -507,10 +507,10 @@ static Widget* window_newWidget(Window* w) {
|
||||
/* Return the window of id wid. */
|
||||
static Window* window_wget(const unsigned int wid) {
|
||||
int i;
|
||||
for(i = 0; i < nlinux; i++)
|
||||
if(linux[i].id == wid)
|
||||
return &linux[i];
|
||||
DEBUG("Window '%d' not found in linux stack", wid);
|
||||
for(i = 0; i < nwindows; i++)
|
||||
if(windows[i].id == wid)
|
||||
return &windows[i];
|
||||
DEBUG("Window '%d' not found in windows stack", wid);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -637,8 +637,8 @@ double window_getFaderValue(const unsigned int wid, char* name) {
|
||||
/* Check if a window exists. */
|
||||
int window_exists(const char* wdwname) {
|
||||
int i;
|
||||
for(i = 0; i < nlinux; i++)
|
||||
if(strcmp(linux[i].name, wdwname)==0)
|
||||
for(i = 0; i < nwindows; i++)
|
||||
if(strcmp(windows[i].name, wdwname)==0)
|
||||
return 1; /* Exists. */
|
||||
|
||||
return 0; /* Does not exits! */
|
||||
@ -647,9 +647,9 @@ int window_exists(const char* wdwname) {
|
||||
/* Return the id of a window. */
|
||||
unsigned int window_get(const char* wdwname) {
|
||||
int i;
|
||||
for(i = 0; i < nlinux; i++)
|
||||
if(strcmp(linux[i].name, wdwname)==0)
|
||||
return linux[i].id;
|
||||
for(i = 0; i < nwindows; i++)
|
||||
if(strcmp(windows[i].name, wdwname)==0)
|
||||
return windows[i].id;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -659,15 +659,15 @@ unsigned int window_create(char* name, const int x, const int y,
|
||||
|
||||
Window* wdw;
|
||||
|
||||
if(nlinux >= mlinux) {
|
||||
if(nwindows >= mwindows) {
|
||||
/* We have reached our memory limit. */
|
||||
linux = realloc(linux, sizeof(Window)*(++mlinux));
|
||||
if(linux == NULL) WARN("Out of memory");
|
||||
windows = realloc(windows, sizeof(Window)*(++mwindows));
|
||||
if(windows == NULL) WARN("Out of memory");
|
||||
}
|
||||
|
||||
const int wid = (++genwid); /* Unique id */
|
||||
|
||||
wdw = &linux[nlinux];
|
||||
wdw = &windows[nwindows];
|
||||
|
||||
wdw->id = wid;
|
||||
wdw->name = strdup(name);
|
||||
@ -684,23 +684,23 @@ unsigned int window_create(char* name, const int x, const int y,
|
||||
/* x pos. */
|
||||
if(x == -1)
|
||||
/* Center. */
|
||||
wdw->x = (SCREEN_W - linux[nlinux].w)/2.;
|
||||
wdw->x = (SCREEN_W - windows[nwindows].w)/2.;
|
||||
else if(x < 0)
|
||||
wdw->x = SCREEN_W - linux[nlinux].w + (double)x;
|
||||
else linux[nlinux].x = (double)x;
|
||||
wdw->x = SCREEN_W - windows[nwindows].w + (double)x;
|
||||
else windows[nwindows].x = (double)x;
|
||||
/* y pos. */
|
||||
if(y == -1)
|
||||
/* Center. */
|
||||
wdw->y = (SCREEN_H - linux[nlinux].h)/2.;
|
||||
wdw->y = (SCREEN_H - windows[nwindows].h)/2.;
|
||||
else if(y < 0)
|
||||
wdw->y = SCREEN_H - linux[nlinux].h + (double)y;
|
||||
wdw->y = SCREEN_H - windows[nwindows].h + (double)y;
|
||||
else wdw->y = (double)y;
|
||||
|
||||
/* Widgets. */
|
||||
wdw->widgets = NULL;
|
||||
wdw->nwidgets = 0;
|
||||
|
||||
nlinux++;
|
||||
nwindows++;
|
||||
|
||||
if(toolkit == 0) {
|
||||
/* Toolkit is enabled. */
|
||||
@ -807,27 +807,27 @@ void window_destroy(const unsigned int wid) {
|
||||
int i, j;
|
||||
|
||||
/* Destroy the window. */
|
||||
for(i = 0; i < nlinux; i++)
|
||||
if(linux[i].id == wid) {
|
||||
if(linux[i].name) free(linux[i].name);
|
||||
for(j = 0; j < linux[i].nwidgets; j++)
|
||||
widget_cleanup(&linux[i].widgets[j]);
|
||||
free(linux[i].widgets);
|
||||
for(i = 0; i < nwindows; i++)
|
||||
if(windows[i].id == wid) {
|
||||
if(windows[i].name) free(windows[i].name);
|
||||
for(j = 0; j < windows[i].nwidgets; j++)
|
||||
widget_cleanup(&windows[i].widgets[j]);
|
||||
free(windows[i].widgets);
|
||||
break;
|
||||
}
|
||||
|
||||
if(i == nlinux) { /* Not found. */
|
||||
if(i == nwindows) { /* Not found. */
|
||||
WARN("Window of id '%u' not found in window stack!", wid);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Move the other linux down a layer. */
|
||||
for(; i<(nlinux-1); i++)
|
||||
linux[i] = linux[i+1];
|
||||
/* Move the other windows down a layer. */
|
||||
for(; i<(nwindows-1); i++)
|
||||
windows[i] = windows[i+1];
|
||||
|
||||
nlinux--;
|
||||
if(nlinux == 0) {
|
||||
/* No linux left. */
|
||||
nwindows--;
|
||||
if(nwindows == 0) {
|
||||
/* No windows left. */
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
toolkit = 0; /* Disable the toolkit. */
|
||||
if(paused) unpause_game();
|
||||
@ -1622,8 +1622,8 @@ void toolkit_render(void) {
|
||||
if(gl_has(OPENGL_AA_LINE)) glEnable(GL_LINE_SMOOTH);
|
||||
if(gl_has(OPENGL_AA_POLYGON)) glEnable(GL_POLYGON_SMOOTH);
|
||||
|
||||
for(i = 0; i < nlinux; i++)
|
||||
window_render(&linux[i]);
|
||||
for(i = 0; i < nwindows; i++)
|
||||
window_render(&windows[i]);
|
||||
|
||||
if(gl_has(OPENGL_AA_LINE)) glDisable(GL_LINE_SMOOTH);
|
||||
if(gl_has(OPENGL_AA_POLYGON)) glDisable(GL_POLYGON_SMOOTH);
|
||||
@ -1680,7 +1680,7 @@ static void toolkit_mouseEvent(SDL_Event* event) {
|
||||
y *= gl_screen.myscale;
|
||||
|
||||
/* Get the window. */
|
||||
w = &linux[nlinux-1];
|
||||
w = &windows[nwindows-1];
|
||||
|
||||
/* Always treat button ups to stop hanging states. */
|
||||
if((event->type != SDL_MOUSEBUTTONUP) &&
|
||||
@ -1806,9 +1806,9 @@ static int toolkit_keyEvent(SDL_Event* event) {
|
||||
Widget* wgt;
|
||||
SDLKey key;
|
||||
|
||||
if(nlinux <= 0) return 0;
|
||||
if(nwindows <= 0) return 0;
|
||||
|
||||
wdw = &linux[nlinux-1];
|
||||
wdw = &windows[nwindows-1];
|
||||
wgt = (wdw->focus != -1) ? &wdw->widgets[wdw->focus] : NULL;
|
||||
key = event->key.keysym.sym;
|
||||
|
||||
@ -1874,8 +1874,8 @@ void toolkit_update(void) {
|
||||
|
||||
input_keyCounter++;
|
||||
|
||||
if(nlinux > 0) {
|
||||
wdw = &linux[nlinux-1];
|
||||
if(nwindows > 0) {
|
||||
wdw = &windows[nwindows-1];
|
||||
wgt = (wdw->focus >= 0) ? &wdw->widgets[wdw->focus] : NULL;
|
||||
if(wgt && (wgt->type == WIDGET_INPUT) &&
|
||||
(input_key == SDLK_BACKSPACE || isalnum(input_key)))
|
||||
@ -1896,7 +1896,7 @@ void toolkit_update(void) {
|
||||
|
||||
/* Focus next widget. */
|
||||
static void toolkit_nextFocus(void) {
|
||||
Window* wdw = &linux[nlinux-1]; /* Get active window. */
|
||||
Window* wdw = &windows[nwindows-1]; /* Get active window. */
|
||||
|
||||
if(wdw->nwidgets==0) /* Special case no widgets. */
|
||||
wdw->focus = -1;
|
||||
@ -1929,7 +1929,7 @@ static void toolkit_triggerFocus(void) {
|
||||
Window* wdw;
|
||||
Widget* wgt;
|
||||
|
||||
wdw = &linux[nlinux-1];
|
||||
wdw = &windows[nwindows-1];
|
||||
|
||||
if(wdw->focus == -1) return;
|
||||
|
||||
@ -1958,7 +1958,7 @@ static void toolkit_listScroll(Widget* wgt, int direction) {
|
||||
|
||||
if(wgt == NULL) return;
|
||||
|
||||
wdw = &linux[nlinux-1]; /* Get active window. */
|
||||
wdw = &windows[nwindows-1]; /* Get active window. */
|
||||
|
||||
switch(wgt->type) {
|
||||
case WIDGET_LIST:
|
||||
@ -2016,7 +2016,7 @@ static void toolkit_listScroll(Widget* wgt, int direction) {
|
||||
* @brief Change fader value.
|
||||
*/
|
||||
static void toolkit_faderSetValue(Widget* fad, double value) {
|
||||
Window* w = &linux[nlinux-1];
|
||||
Window* w = &windows[nwindows-1];
|
||||
value = MAX(MIN(value, fad->dat.fad.max), fad->dat.fad.min);
|
||||
fad->dat.fad.value = value;
|
||||
if(fad->dat.fad.fptr != NULL)
|
||||
@ -2112,7 +2112,7 @@ static void toolkit_imgarrFocus(Widget* iar, double bx, double by) {
|
||||
int xelem, xspace, yelem;
|
||||
Window* wdw;
|
||||
|
||||
wdw = &linux[nlinux-1]; /* Get active window. */
|
||||
wdw = &windows[nwindows-1]; /* Get active window. */
|
||||
|
||||
/* Positions. */
|
||||
x = bx + iar->x;
|
||||
@ -2198,7 +2198,7 @@ static void toolkit_listMove(Widget* lst, double ay) {
|
||||
/* Run change if position changed. */
|
||||
if(lst->dat.lst.selected != psel)
|
||||
if(lst->dat.lst.fptr) {
|
||||
wdw = &linux[nlinux-1]; /* Get active windw. */
|
||||
wdw = &windows[nwindows-1]; /* Get active windw. */
|
||||
(*lst->dat.lst.fptr)(wdw->id, lst->name);
|
||||
}
|
||||
}
|
||||
@ -2237,7 +2237,7 @@ static void toolkit_imgarrMove(Widget* iar, double ry) {
|
||||
/* Return the focused widget. */
|
||||
static Widget* toolkit_getFocus(void) {
|
||||
Window* wdw;
|
||||
wdw = &linux[nlinux-1];
|
||||
wdw = &windows[nwindows-1];
|
||||
|
||||
if(wdw->focus == -1) return NULL;
|
||||
|
||||
@ -2246,17 +2246,17 @@ static Widget* toolkit_getFocus(void) {
|
||||
|
||||
/* Init. */
|
||||
int toolkit_init(void) {
|
||||
linux = malloc(sizeof(Window)*MIN_WINDOWS);
|
||||
nlinux = 0;
|
||||
mlinux = MIN_WINDOWS;
|
||||
windows = malloc(sizeof(Window)*MIN_WINDOWS);
|
||||
nwindows = 0;
|
||||
mwindows = MIN_WINDOWS;
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Exit the toolkit. */
|
||||
void toolkit_exit(void) {
|
||||
while(nlinux > 0)
|
||||
window_destroy(linux[0].id);
|
||||
free(linux);
|
||||
while(nwindows > 0)
|
||||
window_destroy(windows[0].id);
|
||||
free(windows);
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -31,7 +31,7 @@
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX /* Don't defined min() and max() */
|
||||
#endif
|
||||
#include <linux.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#ifndef NO_SDL_GLEXT
|
||||
#define __glext_h_ /* Don't let gl.h include glext.h */
|
||||
@ -95,7 +95,7 @@ extern "C" {
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <linux.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
|
@ -122,7 +122,7 @@ struct SDL_SysWMmsg {
|
||||
int data;
|
||||
};
|
||||
|
||||
/** The linux custom window manager information structure */
|
||||
/** The windows custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version ;
|
||||
GR_WINDOW_ID window ; /* The display window */
|
||||
@ -130,9 +130,9 @@ typedef struct SDL_SysWMinfo {
|
||||
|
||||
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <linux.h>
|
||||
#include <windows.h>
|
||||
|
||||
/** The linux custom event structure */
|
||||
/** The windows custom event structure */
|
||||
struct SDL_SysWMmsg {
|
||||
SDL_version version;
|
||||
HWND hwnd; /**< The window for the message */
|
||||
@ -141,7 +141,7 @@ struct SDL_SysWMmsg {
|
||||
LPARAM lParam; /**< LONG message parameter */
|
||||
};
|
||||
|
||||
/** The linux custom window manager information structure */
|
||||
/** The windows custom window manager information structure */
|
||||
typedef struct SDL_SysWMinfo {
|
||||
SDL_version version;
|
||||
HWND window; /**< The Win32 display window */
|
||||
|
Loading…
Reference in New Issue
Block a user