Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wolf3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
wolf3d
Commits
376b0103
Commit
376b0103
authored
Jan 13, 2002
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vi_sdl.c: small sdl update.
id_vh.c: force screen update when fading palette.
parent
f1278b84
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
20 deletions
+18
-20
id_vh.c
src/id_vh.c
+3
-0
vi_sdl.c
src/vi_sdl.c
+15
-20
No files found.
src/id_vh.c
View file @
376b0103
...
@@ -29,6 +29,7 @@ void VL_FillPalette(int red, int green, int blue)
...
@@ -29,6 +29,7 @@ void VL_FillPalette(int red, int green, int blue)
pal
[
i
*
3
+
2
]
=
blue
;
pal
[
i
*
3
+
2
]
=
blue
;
}
}
VL_SetPalette
(
pal
);
VL_SetPalette
(
pal
);
VW_UpdateScreen
();
}
}
/*
/*
...
@@ -71,6 +72,7 @@ void VL_FadeOut(int start, int end, int red, int green, int blue, int steps)
...
@@ -71,6 +72,7 @@ void VL_FadeOut(int start, int end, int red, int green, int blue, int steps)
}
}
VL_SetPalette
(
&
palette2
[
0
][
0
]);
VL_SetPalette
(
&
palette2
[
0
][
0
]);
VW_UpdateScreen
();
}
}
/* final color */
/* final color */
...
@@ -111,6 +113,7 @@ void VL_FadeIn(int start, int end, const byte *palette, int steps)
...
@@ -111,6 +113,7 @@ void VL_FadeIn(int start, int end, const byte *palette, int steps)
}
}
VL_SetPalette
(
&
palette2
[
0
][
0
]);
VL_SetPalette
(
&
palette2
[
0
][
0
]);
VW_UpdateScreen
();
}
}
/* final color */
/* final color */
...
...
src/vi_sdl.c
View file @
376b0103
...
@@ -2,9 +2,10 @@
...
@@ -2,9 +2,10 @@
#include "SDL.h"
#include "SDL.h"
byte
*
gfxbuf
=
NULL
;
static
SDL_Surface
*
surface
;
SDL_Surface
*
surfac
e
;
static
unsigned
int
sdl_palettemod
e
;
byte
*
gfxbuf
=
NULL
;
extern
void
keyboard_handler
(
int
code
,
int
press
);
extern
void
keyboard_handler
(
int
code
,
int
press
);
extern
boolean
InternalKeyboard
[
NumCodes
];
extern
boolean
InternalKeyboard
[
NumCodes
];
...
@@ -58,10 +59,6 @@ void VL_WaitVBL(int vbls)
...
@@ -58,10 +59,6 @@ void VL_WaitVBL(int vbls)
void
VW_UpdateScreen
()
void
VW_UpdateScreen
()
{
{
//VL_WaitVBL(1);
//memcpy(surface->pixels, gfxbuf, vwidth*vheight);
//SDL_UpdateRect(surface, 0, 0, 0, 0);
SDL_Flip
(
surface
);
SDL_Flip
(
surface
);
}
}
...
@@ -75,6 +72,9 @@ void VW_UpdateScreen()
...
@@ -75,6 +72,9 @@ void VW_UpdateScreen()
void
VL_Startup
()
void
VL_Startup
()
{
{
const
SDL_VideoInfo
*
vinfo
;
int
flags
;
vwidth
=
320
;
vwidth
=
320
;
vheight
=
200
;
vheight
=
200
;
...
@@ -86,23 +86,22 @@ void VL_Startup()
...
@@ -86,23 +86,22 @@ void VL_Startup()
vheight
*=
3
;
vheight
*=
3
;
}
}
//if (gfxbuf == NULL)
// gfxbuf = malloc(vwidth * vheight * 1);
/* TODO: renable parachute for release version? */
if
(
SDL_Init
(
SDL_INIT_VIDEO
|
SDL_INIT_NOPARACHUTE
)
<
0
)
{
if
(
SDL_Init
(
SDL_INIT_VIDEO
|
SDL_INIT_NOPARACHUTE
)
<
0
)
{
Quit
(
"Couldn't init SDL"
);
Quit
(
"Couldn't init SDL"
);
}
}
vinfo
=
SDL_GetVideoInfo
();
sdl_palettemode
=
(
vinfo
->
vfmt
->
BitsPerPixel
==
8
)
?
(
SDL_PHYSPAL
|
SDL_LOGPAL
)
:
SDL_LOGPAL
;
flags
=
SDL_SWSURFACE
|
SDL_HWPALETTE
|
SDL_DOUBLEBUF
;
if
(
MS_CheckParm
(
"fullscreen"
))
if
(
MS_CheckParm
(
"fullscreen"
))
//surface = SDL_SetVideoMode(vwidth, vheight, 8, SDL_SWSURFACE|SDL_HWPALETTE|SDL_FULLSCREEN);
flags
|=
SDL_FULLSCREEN
;
surface
=
SDL_SetVideoMode
(
vwidth
,
vheight
,
8
,
SDL_SWSURFACE
|
SDL_HWPALETTE
|
SDL_FULLSCREEN
|
SDL_DOUBLEBUF
);
else
surface
=
SDL_SetVideoMode
(
vwidth
,
vheight
,
8
,
flags
);
//surface = SDL_SetVideoMode(vwidth, vheight, 8, SDL_SWSURFACE|SDL_HWPALETTE);
surface
=
SDL_SetVideoMode
(
vwidth
,
vheight
,
8
,
SDL_SWSURFACE
|
SDL_HWPALETTE
|
SDL_DOUBLEBUF
);
if
(
surface
==
NULL
)
{
if
(
surface
==
NULL
)
{
SDL_Quit
();
SDL_Quit
();
Quit
(
"
Couldn't set 320x200
mode"
);
Quit
(
"
(SDL) Couldn't set video
mode"
);
}
}
gfxbuf
=
surface
->
pixels
;
gfxbuf
=
surface
->
pixels
;
...
@@ -122,10 +121,6 @@ void VL_Startup()
...
@@ -122,10 +121,6 @@ void VL_Startup()
void
VL_Shutdown
()
void
VL_Shutdown
()
{
{
//if (gfxbuf != NULL) {
// free(gfxbuf);
// gfxbuf = NULL;
//}
SDL_Quit
();
SDL_Quit
();
}
}
...
@@ -152,7 +147,7 @@ void VL_SetPalette(const byte *palette)
...
@@ -152,7 +147,7 @@ void VL_SetPalette(const byte *palette)
colors
[
i
].
g
=
palette
[
i
*
3
+
1
]
<<
2
;
colors
[
i
].
g
=
palette
[
i
*
3
+
1
]
<<
2
;
colors
[
i
].
b
=
palette
[
i
*
3
+
2
]
<<
2
;
colors
[
i
].
b
=
palette
[
i
*
3
+
2
]
<<
2
;
}
}
SDL_Set
Colors
(
surfac
e
,
colors
,
0
,
256
);
SDL_Set
Palette
(
surface
,
sdl_palettemod
e
,
colors
,
0
,
256
);
}
}
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment