[Fix] Fixed grep|sed screwup.
This commit is contained in:
parent
a23d2c7810
commit
b7cfc2bac2
@ -201,7 +201,7 @@
|
|||||||
<general>
|
<general>
|
||||||
<prodfactor>0.8</prodfactor>
|
<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>
|
<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>
|
<faction>Empire</faction>
|
||||||
<commodities>
|
<commodities>
|
||||||
<commodity>Food</commodity>
|
<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
|
#undef setprogdir
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* @brief Handle read/write abstractions to the users directory.
|
* @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>
|
#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;
|
int toolkit = 0;
|
||||||
|
|
||||||
#define MIN_WINDOWS 3
|
#define MIN_WINDOWS 3
|
||||||
static Window* linux = NULL;
|
static Window* windows = NULL;
|
||||||
static int nlinux = 0;
|
static int nwindows = 0;
|
||||||
static int mlinux = 0;
|
static int mwindows = 0;
|
||||||
|
|
||||||
/* Default outline colours. */
|
/* Default outline colours. */
|
||||||
static glColour* toolkit_colLight = &cGrey90;
|
static glColour* toolkit_colLight = &cGrey90;
|
||||||
@ -507,10 +507,10 @@ static Widget* window_newWidget(Window* w) {
|
|||||||
/* Return the window of id wid. */
|
/* Return the window of id wid. */
|
||||||
static Window* window_wget(const unsigned int wid) {
|
static Window* window_wget(const unsigned int wid) {
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < nlinux; i++)
|
for(i = 0; i < nwindows; i++)
|
||||||
if(linux[i].id == wid)
|
if(windows[i].id == wid)
|
||||||
return &linux[i];
|
return &windows[i];
|
||||||
DEBUG("Window '%d' not found in linux stack", wid);
|
DEBUG("Window '%d' not found in windows stack", wid);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -637,8 +637,8 @@ double window_getFaderValue(const unsigned int wid, char* name) {
|
|||||||
/* Check if a window exists. */
|
/* Check if a window exists. */
|
||||||
int window_exists(const char* wdwname) {
|
int window_exists(const char* wdwname) {
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < nlinux; i++)
|
for(i = 0; i < nwindows; i++)
|
||||||
if(strcmp(linux[i].name, wdwname)==0)
|
if(strcmp(windows[i].name, wdwname)==0)
|
||||||
return 1; /* Exists. */
|
return 1; /* Exists. */
|
||||||
|
|
||||||
return 0; /* Does not exits! */
|
return 0; /* Does not exits! */
|
||||||
@ -647,9 +647,9 @@ int window_exists(const char* wdwname) {
|
|||||||
/* Return the id of a window. */
|
/* Return the id of a window. */
|
||||||
unsigned int window_get(const char* wdwname) {
|
unsigned int window_get(const char* wdwname) {
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < nlinux; i++)
|
for(i = 0; i < nwindows; i++)
|
||||||
if(strcmp(linux[i].name, wdwname)==0)
|
if(strcmp(windows[i].name, wdwname)==0)
|
||||||
return linux[i].id;
|
return windows[i].id;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -659,15 +659,15 @@ unsigned int window_create(char* name, const int x, const int y,
|
|||||||
|
|
||||||
Window* wdw;
|
Window* wdw;
|
||||||
|
|
||||||
if(nlinux >= mlinux) {
|
if(nwindows >= mwindows) {
|
||||||
/* We have reached our memory limit. */
|
/* We have reached our memory limit. */
|
||||||
linux = realloc(linux, sizeof(Window)*(++mlinux));
|
windows = realloc(windows, sizeof(Window)*(++mwindows));
|
||||||
if(linux == NULL) WARN("Out of memory");
|
if(windows == NULL) WARN("Out of memory");
|
||||||
}
|
}
|
||||||
|
|
||||||
const int wid = (++genwid); /* Unique id */
|
const int wid = (++genwid); /* Unique id */
|
||||||
|
|
||||||
wdw = &linux[nlinux];
|
wdw = &windows[nwindows];
|
||||||
|
|
||||||
wdw->id = wid;
|
wdw->id = wid;
|
||||||
wdw->name = strdup(name);
|
wdw->name = strdup(name);
|
||||||
@ -684,23 +684,23 @@ unsigned int window_create(char* name, const int x, const int y,
|
|||||||
/* x pos. */
|
/* x pos. */
|
||||||
if(x == -1)
|
if(x == -1)
|
||||||
/* Center. */
|
/* Center. */
|
||||||
wdw->x = (SCREEN_W - linux[nlinux].w)/2.;
|
wdw->x = (SCREEN_W - windows[nwindows].w)/2.;
|
||||||
else if(x < 0)
|
else if(x < 0)
|
||||||
wdw->x = SCREEN_W - linux[nlinux].w + (double)x;
|
wdw->x = SCREEN_W - windows[nwindows].w + (double)x;
|
||||||
else linux[nlinux].x = (double)x;
|
else windows[nwindows].x = (double)x;
|
||||||
/* y pos. */
|
/* y pos. */
|
||||||
if(y == -1)
|
if(y == -1)
|
||||||
/* Center. */
|
/* Center. */
|
||||||
wdw->y = (SCREEN_H - linux[nlinux].h)/2.;
|
wdw->y = (SCREEN_H - windows[nwindows].h)/2.;
|
||||||
else if(y < 0)
|
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;
|
else wdw->y = (double)y;
|
||||||
|
|
||||||
/* Widgets. */
|
/* Widgets. */
|
||||||
wdw->widgets = NULL;
|
wdw->widgets = NULL;
|
||||||
wdw->nwidgets = 0;
|
wdw->nwidgets = 0;
|
||||||
|
|
||||||
nlinux++;
|
nwindows++;
|
||||||
|
|
||||||
if(toolkit == 0) {
|
if(toolkit == 0) {
|
||||||
/* Toolkit is enabled. */
|
/* Toolkit is enabled. */
|
||||||
@ -807,27 +807,27 @@ void window_destroy(const unsigned int wid) {
|
|||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
/* Destroy the window. */
|
/* Destroy the window. */
|
||||||
for(i = 0; i < nlinux; i++)
|
for(i = 0; i < nwindows; i++)
|
||||||
if(linux[i].id == wid) {
|
if(windows[i].id == wid) {
|
||||||
if(linux[i].name) free(linux[i].name);
|
if(windows[i].name) free(windows[i].name);
|
||||||
for(j = 0; j < linux[i].nwidgets; j++)
|
for(j = 0; j < windows[i].nwidgets; j++)
|
||||||
widget_cleanup(&linux[i].widgets[j]);
|
widget_cleanup(&windows[i].widgets[j]);
|
||||||
free(linux[i].widgets);
|
free(windows[i].widgets);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(i == nlinux) { /* Not found. */
|
if(i == nwindows) { /* Not found. */
|
||||||
WARN("Window of id '%u' not found in window stack!", wid);
|
WARN("Window of id '%u' not found in window stack!", wid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move the other linux down a layer. */
|
/* Move the other windows down a layer. */
|
||||||
for(; i<(nlinux-1); i++)
|
for(; i<(nwindows-1); i++)
|
||||||
linux[i] = linux[i+1];
|
windows[i] = windows[i+1];
|
||||||
|
|
||||||
nlinux--;
|
nwindows--;
|
||||||
if(nlinux == 0) {
|
if(nwindows == 0) {
|
||||||
/* No linux left. */
|
/* No windows left. */
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
toolkit = 0; /* Disable the toolkit. */
|
toolkit = 0; /* Disable the toolkit. */
|
||||||
if(paused) unpause_game();
|
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_LINE)) glEnable(GL_LINE_SMOOTH);
|
||||||
if(gl_has(OPENGL_AA_POLYGON)) glEnable(GL_POLYGON_SMOOTH);
|
if(gl_has(OPENGL_AA_POLYGON)) glEnable(GL_POLYGON_SMOOTH);
|
||||||
|
|
||||||
for(i = 0; i < nlinux; i++)
|
for(i = 0; i < nwindows; i++)
|
||||||
window_render(&linux[i]);
|
window_render(&windows[i]);
|
||||||
|
|
||||||
if(gl_has(OPENGL_AA_LINE)) glDisable(GL_LINE_SMOOTH);
|
if(gl_has(OPENGL_AA_LINE)) glDisable(GL_LINE_SMOOTH);
|
||||||
if(gl_has(OPENGL_AA_POLYGON)) glDisable(GL_POLYGON_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;
|
y *= gl_screen.myscale;
|
||||||
|
|
||||||
/* Get the window. */
|
/* Get the window. */
|
||||||
w = &linux[nlinux-1];
|
w = &windows[nwindows-1];
|
||||||
|
|
||||||
/* Always treat button ups to stop hanging states. */
|
/* Always treat button ups to stop hanging states. */
|
||||||
if((event->type != SDL_MOUSEBUTTONUP) &&
|
if((event->type != SDL_MOUSEBUTTONUP) &&
|
||||||
@ -1806,9 +1806,9 @@ static int toolkit_keyEvent(SDL_Event* event) {
|
|||||||
Widget* wgt;
|
Widget* wgt;
|
||||||
SDLKey key;
|
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;
|
wgt = (wdw->focus != -1) ? &wdw->widgets[wdw->focus] : NULL;
|
||||||
key = event->key.keysym.sym;
|
key = event->key.keysym.sym;
|
||||||
|
|
||||||
@ -1874,8 +1874,8 @@ void toolkit_update(void) {
|
|||||||
|
|
||||||
input_keyCounter++;
|
input_keyCounter++;
|
||||||
|
|
||||||
if(nlinux > 0) {
|
if(nwindows > 0) {
|
||||||
wdw = &linux[nlinux-1];
|
wdw = &windows[nwindows-1];
|
||||||
wgt = (wdw->focus >= 0) ? &wdw->widgets[wdw->focus] : NULL;
|
wgt = (wdw->focus >= 0) ? &wdw->widgets[wdw->focus] : NULL;
|
||||||
if(wgt && (wgt->type == WIDGET_INPUT) &&
|
if(wgt && (wgt->type == WIDGET_INPUT) &&
|
||||||
(input_key == SDLK_BACKSPACE || isalnum(input_key)))
|
(input_key == SDLK_BACKSPACE || isalnum(input_key)))
|
||||||
@ -1896,7 +1896,7 @@ void toolkit_update(void) {
|
|||||||
|
|
||||||
/* Focus next widget. */
|
/* Focus next widget. */
|
||||||
static void toolkit_nextFocus(void) {
|
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. */
|
if(wdw->nwidgets==0) /* Special case no widgets. */
|
||||||
wdw->focus = -1;
|
wdw->focus = -1;
|
||||||
@ -1929,7 +1929,7 @@ static void toolkit_triggerFocus(void) {
|
|||||||
Window* wdw;
|
Window* wdw;
|
||||||
Widget* wgt;
|
Widget* wgt;
|
||||||
|
|
||||||
wdw = &linux[nlinux-1];
|
wdw = &windows[nwindows-1];
|
||||||
|
|
||||||
if(wdw->focus == -1) return;
|
if(wdw->focus == -1) return;
|
||||||
|
|
||||||
@ -1958,7 +1958,7 @@ static void toolkit_listScroll(Widget* wgt, int direction) {
|
|||||||
|
|
||||||
if(wgt == NULL) return;
|
if(wgt == NULL) return;
|
||||||
|
|
||||||
wdw = &linux[nlinux-1]; /* Get active window. */
|
wdw = &windows[nwindows-1]; /* Get active window. */
|
||||||
|
|
||||||
switch(wgt->type) {
|
switch(wgt->type) {
|
||||||
case WIDGET_LIST:
|
case WIDGET_LIST:
|
||||||
@ -2016,7 +2016,7 @@ static void toolkit_listScroll(Widget* wgt, int direction) {
|
|||||||
* @brief Change fader value.
|
* @brief Change fader value.
|
||||||
*/
|
*/
|
||||||
static void toolkit_faderSetValue(Widget* fad, double 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);
|
value = MAX(MIN(value, fad->dat.fad.max), fad->dat.fad.min);
|
||||||
fad->dat.fad.value = value;
|
fad->dat.fad.value = value;
|
||||||
if(fad->dat.fad.fptr != NULL)
|
if(fad->dat.fad.fptr != NULL)
|
||||||
@ -2112,7 +2112,7 @@ static void toolkit_imgarrFocus(Widget* iar, double bx, double by) {
|
|||||||
int xelem, xspace, yelem;
|
int xelem, xspace, yelem;
|
||||||
Window* wdw;
|
Window* wdw;
|
||||||
|
|
||||||
wdw = &linux[nlinux-1]; /* Get active window. */
|
wdw = &windows[nwindows-1]; /* Get active window. */
|
||||||
|
|
||||||
/* Positions. */
|
/* Positions. */
|
||||||
x = bx + iar->x;
|
x = bx + iar->x;
|
||||||
@ -2198,7 +2198,7 @@ static void toolkit_listMove(Widget* lst, double ay) {
|
|||||||
/* Run change if position changed. */
|
/* Run change if position changed. */
|
||||||
if(lst->dat.lst.selected != psel)
|
if(lst->dat.lst.selected != psel)
|
||||||
if(lst->dat.lst.fptr) {
|
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);
|
(*lst->dat.lst.fptr)(wdw->id, lst->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2237,7 +2237,7 @@ static void toolkit_imgarrMove(Widget* iar, double ry) {
|
|||||||
/* Return the focused widget. */
|
/* Return the focused widget. */
|
||||||
static Widget* toolkit_getFocus(void) {
|
static Widget* toolkit_getFocus(void) {
|
||||||
Window* wdw;
|
Window* wdw;
|
||||||
wdw = &linux[nlinux-1];
|
wdw = &windows[nwindows-1];
|
||||||
|
|
||||||
if(wdw->focus == -1) return NULL;
|
if(wdw->focus == -1) return NULL;
|
||||||
|
|
||||||
@ -2246,17 +2246,17 @@ static Widget* toolkit_getFocus(void) {
|
|||||||
|
|
||||||
/* Init. */
|
/* Init. */
|
||||||
int toolkit_init(void) {
|
int toolkit_init(void) {
|
||||||
linux = malloc(sizeof(Window)*MIN_WINDOWS);
|
windows = malloc(sizeof(Window)*MIN_WINDOWS);
|
||||||
nlinux = 0;
|
nwindows = 0;
|
||||||
mlinux = MIN_WINDOWS;
|
mwindows = MIN_WINDOWS;
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Exit the toolkit. */
|
/* Exit the toolkit. */
|
||||||
void toolkit_exit(void) {
|
void toolkit_exit(void) {
|
||||||
while(nlinux > 0)
|
while(nwindows > 0)
|
||||||
window_destroy(linux[0].id);
|
window_destroy(windows[0].id);
|
||||||
free(linux);
|
free(windows);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
@ -31,7 +31,7 @@
|
|||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
#define NOMINMAX /* Don't defined min() and max() */
|
#define NOMINMAX /* Don't defined min() and max() */
|
||||||
#endif
|
#endif
|
||||||
#include <linux.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_SDL_GLEXT
|
#ifndef NO_SDL_GLEXT
|
||||||
#define __glext_h_ /* Don't let gl.h include glext.h */
|
#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__)
|
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
#include <linux.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef APIENTRY
|
#ifndef APIENTRY
|
||||||
|
@ -122,7 +122,7 @@ struct SDL_SysWMmsg {
|
|||||||
int data;
|
int data;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The linux custom window manager information structure */
|
/** The windows custom window manager information structure */
|
||||||
typedef struct SDL_SysWMinfo {
|
typedef struct SDL_SysWMinfo {
|
||||||
SDL_version version ;
|
SDL_version version ;
|
||||||
GR_WINDOW_ID window ; /* The display window */
|
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)
|
#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <linux.h>
|
#include <windows.h>
|
||||||
|
|
||||||
/** The linux custom event structure */
|
/** The windows custom event structure */
|
||||||
struct SDL_SysWMmsg {
|
struct SDL_SysWMmsg {
|
||||||
SDL_version version;
|
SDL_version version;
|
||||||
HWND hwnd; /**< The window for the message */
|
HWND hwnd; /**< The window for the message */
|
||||||
@ -141,7 +141,7 @@ struct SDL_SysWMmsg {
|
|||||||
LPARAM lParam; /**< LONG message parameter */
|
LPARAM lParam; /**< LONG message parameter */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The linux custom window manager information structure */
|
/** The windows custom window manager information structure */
|
||||||
typedef struct SDL_SysWMinfo {
|
typedef struct SDL_SysWMinfo {
|
||||||
SDL_version version;
|
SDL_version version;
|
||||||
HWND window; /**< The Win32 display window */
|
HWND window; /**< The Win32 display window */
|
||||||
|
Loading…
Reference in New Issue
Block a user