Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Flachy Joe
purr-data
Commits
1ddf78f8
Commit
1ddf78f8
authored
May 24, 2018
by
Jonathan Wilkes
Browse files
first draft of porting fix for pd~ from Vanilla
parent
f084898b
Changes
3
Hide whitespace changes
Inline
Side-by-side
pd/src/m_class.c
View file @
1ddf78f8
...
...
@@ -786,7 +786,7 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv)
ap
++
;
break
;
case
A_FLOAT
:
if
(
!
argc
)
goto
badarg
;
if
(
!
argc
)
goto
badarg
;
/* falls through */
case
A_DEFFLOAT
:
if
(
!
argc
)
*
dp
=
0
;
else
...
...
@@ -814,7 +814,7 @@ void pd_typedmess(t_pd *x, t_symbol *s, int argc, t_atom *argv)
ap
++
;
break
;
case
A_SYMBOL
:
if
(
!
argc
)
goto
badarg
;
if
(
!
argc
)
goto
badarg
;
/* falls through */
case
A_DEFSYM
:
if
(
!
argc
)
*
ap
=
(
t_int
)(
&
s_
);
else
...
...
pd/src/m_sched.c
View file @
1ddf78f8
...
...
@@ -405,8 +405,6 @@ void sched_set_using_audio(int flag)
post
(
"sorry, can't turn off callbacks yet; restart Pd"
);
/* not right yet! */
sys_time_per_dsp_tick
=
(
TIMEUNITPERSECOND
)
*
((
double
)
sys_schedblocksize
)
/
sys_dacsr
;
// XXXFIXME
//sys_vgui("pdtk_pd_dsp %s\n", flag ? "on" : "off");
}
...
...
@@ -414,7 +412,8 @@ void sched_set_using_audio(int flag)
/* take the scheduler forward one DSP tick, also handling clock timeouts */
void
sched_tick
(
void
)
{
double
next_sys_time
=
pd_this
->
pd_systime
+
sys_time_per_dsp_tick
;
double
next_sys_time
=
pd_this
->
pd_systime
+
(
sys_schedblocksize
/
sys_dacsr
)
*
TIMEUNITPERSECOND
;
int
countdown
=
5000
;
while
(
pd_this
->
pd_clock_setlist
&&
pd_this
->
pd_clock_setlist
->
c_settime
<
next_sys_time
)
...
...
@@ -459,6 +458,7 @@ int (*sys_idlehook)(void);
static
void
m_pollingscheduler
(
void
)
{
int
idlecount
=
0
;
/* delete this when I'm sure it's not needed for back compatibilty? */
sys_time_per_dsp_tick
=
(
TIMEUNITPERSECOND
)
*
((
double
)
sys_schedblocksize
)
/
sys_dacsr
;
...
...
@@ -635,8 +635,6 @@ int m_mainloop(void)
int
m_batchmain
(
void
)
{
sys_time_per_dsp_tick
=
(
TIMEUNITPERSECOND
)
*
((
double
)
sys_schedblocksize
)
/
sys_dacsr
;
while
(
sys_quit
!=
SYS_QUIT_QUIT
)
sched_tick
();
return
(
0
);
...
...
pd/src/s_main.c
View file @
1ddf78f8
...
...
@@ -243,6 +243,41 @@ void glob_initfromgui(void *dummy, t_symbol *s, int argc, t_atom *argv)
sys_messagelist
=
0
;
}
// font char metric triples: pointsize width(pixels) height(pixels)
static
int
defaultfontshit
[]
=
{
8
,
5
,
11
,
9
,
6
,
12
,
10
,
6
,
13
,
12
,
7
,
16
,
14
,
8
,
17
,
16
,
10
,
19
,
18
,
11
,
22
,
24
,
14
,
29
,
30
,
18
,
37
,
36
,
22
,
44
};
#define NDEFAULTFONT (sizeof(defaultfontshit)/sizeof(*defaultfontshit))
static
t_clock
*
sys_fakefromguiclk
;
static
void
sys_fakefromgui
(
void
)
{
/* fake the GUI's message giving cwd and font sizes in case
we aren't starting the gui. */
t_atom
zz
[
NDEFAULTFONT
+
2
];
int
i
;
char
buf
[
MAXPDSTRING
];
#ifdef _WIN32
if
(
GetCurrentDirectory
(
MAXPDSTRING
,
buf
)
==
0
)
strcpy
(
buf
,
"."
);
#else
if
(
!
getcwd
(
buf
,
MAXPDSTRING
))
strcpy
(
buf
,
"."
);
#endif
SETSYMBOL
(
zz
,
gensym
(
buf
));
for
(
i
=
0
;
i
<
(
int
)
NDEFAULTFONT
;
i
++
)
SETFLOAT
(
zz
+
i
+
1
,
defaultfontshit
[
i
]);
SETFLOAT
(
zz
+
NDEFAULTFONT
+
1
,
0
);
glob_initfromgui
(
0
,
0
,
2
+
NDEFAULTFONT
,
zz
);
clock_free
(
sys_fakefromguiclk
);
}
static
void
sys_afterargparse
(
void
);
static
void
pd_makeversion
(
void
)
...
...
@@ -298,6 +333,18 @@ int sys_main(int argc, char **argv)
#ifdef PD_DEBUG
fprintf
(
stderr
,
"Pd-L2Ork: COMPILED FOR DEBUGGING
\n
"
);
#endif
/* use Win32 "binary" mode by default since we don't want the
* translation that Win32 does by default */
#ifdef _WIN32
# ifdef _MSC_VER
/* MS Visual Studio */
_set_fmode
(
_O_BINARY
);
# else
/* MinGW */
{
extern
int
_fmode
;
_fmode
=
_O_BINARY
;
}
# endif
/* _MSC_VER */
#endif
/* _WIN32 */
pd_init
();
/* start the message system */
sys_findprogdir
(
argv
[
0
]);
/* set sys_progname, guipath */
for
(
i
=
noprefs
=
0
;
i
<
argc
;
i
++
)
/* prescan args for noprefs */
...
...
@@ -319,7 +366,10 @@ int sys_main(int argc, char **argv)
pd_version
,
pd_compiletime
,
pd_compiledate
);
if
(
sys_version
)
/* if we were just asked our version, exit here. */
return
(
0
);
if
(
sys_startgui
(
sys_guidir
->
s_name
))
/* start the gui */
if
(
sys_nogui
)
clock_set
((
sys_fakefromguiclk
=
clock_new
(
0
,
(
t_method
)
sys_fakefromgui
)),
0
);
else
if
(
sys_startgui
(
sys_guidir
->
s_name
))
/* start the gui */
return
(
1
);
/* send the libdir to the GUI */
gui_vmess
(
"gui_set_lib_dir"
,
"s"
,
sys_libdir
->
s_name
);
...
...
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