Skip to content

Commit

Permalink
QNX changes from Mike Gorchak
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Mar 8, 2006
1 parent f7f7b84 commit f236a8e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/cdrom/qnx/SDL_syscdrom.c
Expand Up @@ -170,7 +170,7 @@ int SDL_SYS_CDInit(void)
{
char *cdpath, *delim;
size_t len = SDL_strlen(SDLcdrom)+1;
cdpath = SDL_stack_alloc(len);
cdpath = SDL_stack_alloc(char, len);
if (cdpath != NULL)
{
SDL_strlcpy(cdpath, SDLcdrom, len);
Expand Down
44 changes: 22 additions & 22 deletions src/video/photon/SDL_ph_events.c
Expand Up @@ -119,15 +119,15 @@ static int ph_DispatchEvent(_THIS)

posted = 0;

switch (event->type)
switch (phevent->type)
{
case Ph_EV_BOUNDARY:
{
if (event->subtype == Ph_EV_PTR_ENTER)
if (phevent->subtype == Ph_EV_PTR_ENTER)
{
posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
}
else if (event->subtype ==Ph_EV_PTR_LEAVE)
else if (phevent->subtype ==Ph_EV_PTR_LEAVE)
{
posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
}
Expand All @@ -139,12 +139,12 @@ static int ph_DispatchEvent(_THIS)
{
if (SDL_VideoSurface)
{
pointerEvent = PhGetData(event);
rect = PhGetRects(event);
pointerEvent = PhGetData(phevent);
rect = PhGetRects(phevent);

if (mouse_relative)
{
posted = ph_WarpedMotion(this, event);
posted = ph_WarpedMotion(this, phevent);
}
else
{
Expand All @@ -156,8 +156,8 @@ static int ph_DispatchEvent(_THIS)

case Ph_EV_BUT_PRESS:
{
pointerEvent = PhGetData( event );
buttons = ph2sdl_mousebutton( pointerEvent->buttons );
pointerEvent = PhGetData(phevent);
buttons = ph2sdl_mousebutton(pointerEvent->buttons);
if (buttons != 0)
{
posted = SDL_PrivateMouseButton(SDL_PRESSED, buttons, 0, 0);
Expand All @@ -167,13 +167,13 @@ static int ph_DispatchEvent(_THIS)

case Ph_EV_BUT_RELEASE:
{
pointerEvent = PhGetData(event);
pointerEvent = PhGetData(phevent);
buttons = ph2sdl_mousebutton(pointerEvent->buttons);
if (event->subtype == Ph_EV_RELEASE_REAL && buttons != 0)
if (phevent->subtype == Ph_EV_RELEASE_REAL && buttons != 0)
{
posted = SDL_PrivateMouseButton(SDL_RELEASED, buttons, 0, 0);
}
else if(event->subtype == Ph_EV_RELEASE_PHANTOM)
else if(phevent->subtype == Ph_EV_RELEASE_PHANTOM)
{
/* If the mouse is outside the window,
* only a phantom release event is sent, so
Expand All @@ -191,7 +191,7 @@ static int ph_DispatchEvent(_THIS)

case Ph_EV_WM:
{
winEvent = PhGetData(event);
winEvent = PhGetData(phevent);

/* losing focus */
if ((winEvent->event_f==Ph_WM_FOCUS) && (winEvent->event_state==Ph_WM_EVSTATE_FOCUSLOST))
Expand Down Expand Up @@ -279,28 +279,28 @@ static int ph_DispatchEvent(_THIS)
/* window has been resized, moved or removed */
case Ph_EV_EXPOSE:
{
if (event->num_rects!=0)
if (phevent->num_rects!=0)
{
int numrects;

if (SDL_VideoSurface)
{
rect = PhGetRects(event);
if (event->num_rects>PH_SDL_MAX_RECTS)
rect = PhGetRects(phevent);
if (phevent->num_rects>PH_SDL_MAX_RECTS)
{
/* sorry, buffers underrun, we'll update only first PH_SDL_MAX_RECTS rects */
numrects=PH_SDL_MAX_RECTS;
}

for(i=0; i<event->num_rects; i++)
for(i=0; i<phevent->num_rects; i++)
{
sdlrects[i].x = rect[i].ul.x;
sdlrects[i].y = rect[i].ul.y;
sdlrects[i].w = rect[i].lr.x - rect[i].ul.x + 1;
sdlrects[i].h = rect[i].lr.y - rect[i].ul.y + 1;
}

this->UpdateRects(this, event->num_rects, sdlrects);
this->UpdateRects(this, phevent->num_rects, sdlrects);

if (current_overlay!=NULL)
{
Expand Down Expand Up @@ -332,7 +332,7 @@ static int ph_DispatchEvent(_THIS)

posted = 0;

keyEvent = PhGetData( event );
keyEvent = PhGetData(phevent);

if (Pk_KF_Key_Down & keyEvent->key_flags)
{
Expand Down Expand Up @@ -369,11 +369,11 @@ static int ph_DispatchEvent(_THIS)

case Ph_EV_INFO:
{
if (event->subtype==Ph_OFFSCREEN_INVALID)
if (phevent->subtype==Ph_OFFSCREEN_INVALID)
{
unsigned long* EvInfoData;

EvInfoData=(unsigned long*)PhGetData(event);
EvInfoData=(unsigned long*)PhGetData(phevent);

switch (*EvInfoData)
{
Expand Down Expand Up @@ -410,7 +410,7 @@ int ph_Pending(_THIS)

while (1)
{
switch(PhEventPeek(event, EVENT_SIZE))
switch(PhEventPeek(phevent, EVENT_SIZE))
{
case Ph_EVENT_MSG:
return 1;
Expand All @@ -433,7 +433,7 @@ void ph_PumpEvents(_THIS)

while (ph_Pending(this))
{
PtEventHandler(event);
PtEventHandler(phevent);
ph_DispatchEvent(this);
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/video/photon/SDL_ph_video.c
Expand Up @@ -362,12 +362,12 @@ static int ph_VideoInit(_THIS, SDL_PixelFormat* vformat)
old_video_mode=-1;
old_refresh_rate=-1;

if (NULL == (event = SDL_malloc(EVENT_SIZE)))
if (NULL == (phevent = SDL_malloc(EVENT_SIZE)))
{
SDL_OutOfMemory();
return -1;
}
SDL_memset(event, 0x00, EVENT_SIZE);
SDL_memset(phevent, 0x00, EVENT_SIZE);

window = ph_CreateWindow(this);
if (window == NULL)
Expand Down Expand Up @@ -580,10 +580,10 @@ static void ph_VideoQuit(_THIS)
window=NULL;
}

if (event!=NULL)
if (phevent!=NULL)
{
SDL_free(event);
event=NULL;
SDL_free(phevent);
phevent=NULL;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/video/photon/SDL_ph_video.h
Expand Up @@ -140,7 +140,7 @@ struct SDL_PrivateVideoData
#define currently_fullscreen (this->hidden->currently_fullscreen)
#define currently_hided (this->hidden->currently_hided)
#define currently_maximized (this->hidden->currently_maximized)
#define event (this->hidden->event)
#define phevent (this->hidden->event)
#define current_overlay (this->hidden->overlay)
#define desktop_mode (this->hidden->desktop_mode)
#define mouse_relative (this->hidden->mouse_relative)
Expand Down
2 changes: 1 addition & 1 deletion src/video/photon/SDL_ph_wm.c
Expand Up @@ -61,7 +61,7 @@ int ph_IconifyWindow(_THIS)

SDL_Lock_EventThread();

SDL_memset( &windowevent, 0, sizeof (event) );
SDL_memset(&windowevent, 0, sizeof(windowevent));
windowevent.event_f = Ph_WM_HIDE;
windowevent.event_state = Ph_WM_EVSTATE_HIDE;
windowevent.rid = PtWidgetRid(window);
Expand Down

0 comments on commit f236a8e

Please sign in to comment.